csharp-tmLanguage
csharp-tmLanguage copied to clipboard
Local variables declaration: Type keywords are not highlighted if the identifiers are on the next line
From @heshuimu on May 9, 2017 22:32
Environment data
dotnet --info
output:
VS Code version: 1.12.1
C# Extension version: 1.9.0
Steps to reproduce

Copied from original issue: OmniSharp/omnisharp-vscode#1468
I'm marking this as a bug for now. However, there may not be much we can do about the issue. VS Code colorization is handled by scanning a document line-by-line using regular expressions. This provides colorization that is generally "good enough", but won't every be perfect. If there's not enough information on a single line to identify a particular construct, it's unlikely that it will be colorized precisely.
This is impossible to fix. The only way to fix it is by using begin
end
, but then there's no way to differentiate between:
Foo // type
a, b;
and
Foo // method
();
since once begin
is captured, there's no way to backtrack it out and choose a different pattern.
This should instead be left to the semantic highlighting to handle.