[swift-evolution] [idea] Quick Help working for Keywords

Xiaodi Wu xiaodi.wu at gmail.com
Wed Jun 15 10:57:19 CDT 2016


On Wed, Jun 15, 2016 at 5:15 AM, Jo Albright via swift-evolution <
swift-evolution at swift.org> wrote:

> Creating a new thread for this, to gain more interest.
>
> I am proposing that we extend Quick Help in Xcode to include keywords
> (with context). This will allow for quick access to information about the
> keyword. But more importantly, it allows us to teach developers about the
> keyword in its current context (example “in” will have different
> information inside for loops than when it is being used inside closures).
> And “return” can also have the context of what Type it should have next to
> it (including Void).
>
> What would it take to implement this change to Quick Help?


I'd be enthusiastic to see an overall improvement in keyword support that
extends beyond Quick Help. I'm not familiar with how much of this is
supported through SourceKit, but code completion features that are aware of
the basic grammar of the language would be, I think, helpful for a wide
array of users. For instance, wouldn't it be nice if `in` could be
suggested after typing `for i `? Or `while` after the closing brace for a
`repeat...while` loop?

And I think you've also raised a great point about operators in the other
thread. They do have some keyword-like characteristics, and it'd be great
if, say, their precedence and associativity could be visually evident while
writing. Wouldn't it be nice if the lhs and rhs for infix operators could
be highlighted when your caret is over the operator itself (almost like
parenthesis matching, but for the arguments of an infix operator)?


>

_______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160615/4f42de29/attachment.html>


More information about the swift-evolution mailing list