vscode-swift icon indicating copy to clipboard operation
vscode-swift copied to clipboard

SourceKit could provide more refined code highlighting

Open aaroncrespo opened this issue 7 years ago • 6 comments

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.

aaroncrespo avatar Jul 30 '16 14:07 aaroncrespo

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!

RLovelett avatar Jul 31 '16 00:07 RLovelett

The sourcekitten syntaxcommand returns ranges and decl types.

aaroncrespo avatar Jul 31 '16 02:07 aaroncrespo

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

aaroncrespo avatar Jul 31 '16 02:07 aaroncrespo

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

jchannon avatar Aug 03 '16 22:08 jchannon

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.

aaroncrespo avatar Aug 03 '16 23:08 aaroncrespo

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.

RLovelett avatar Aug 03 '16 23:08 RLovelett