RLovelett / vscode-swift

An extension for VS Code which provides support for the Swift language.
https://marketplace.visualstudio.com/items?itemName=rlovelett.vscode-swift-language
MIT License
128 stars 7 forks source link

SourceKit could provide more refined code highlighting #9

Open aaroncrespo opened 8 years ago

aaroncrespo commented 8 years ago

Most of the language plugins use textmate style code highlighting which is mostly based on regex matching. Sourcekitten/sourcekit can provide this information based on the AST which is how Xcode does it.

Super helpful in swift since it allows shadowing.

RLovelett commented 8 years ago

This is something that would be extremely high on my priority list to get done. Though sadly I'm not sure how we feed the information to VSCode.

Can you provide a link to VSCode docs?

Also thanks for collaborating!

aaroncrespo commented 8 years ago

The sourcekitten syntaxcommand returns ranges and decl types.

aaroncrespo commented 8 years ago

Missread the question yeah, looks like vscode only supports text mate style colorizers. And language servers and extensions might only support decorating text on top of that. This might be a 20% problem

jchannon commented 8 years ago

Could try seeing how omnisharp works for c#. Must have very similar issues integrating with VSCode as this extension will

aaroncrespo commented 8 years ago

looks like they use a text mate formatting file as well.

https://github.com/OmniSharp/omnisharp-vscode/issues?utf8=✓&q=is%3Aissue%20is%3Aopen%20color

Might be stuck unless vscode provides a different API.

RLovelett commented 8 years ago

It looks like the language server protocol that VS Code uses is going to be extended to support this in v3.0.

Implicitly though that means that as of right now it cannot support this. I am subscribed to the issue and plan to follow the implementation of it. That way whenever support for it does land this extension can take advantage of it.