-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Better C# syntax colorizer #674
Comments
@aeschli: Note that this is a request for property semantic type colorization, which I do not believe is possible with VS Code today, since it relies on a syntactic grammar. Please let me know if I'm incorrect about that. |
@DustinCampbell You are correct, we only have syntax highlighting through text mate grammars. Some grammars go quite far as to also parse statements and expressions, but depending on the complexity of the language this is not feasible. |
@cwe1ss While it's still has plenty of room for improvement, since However, I do remember that switching themes at that moment did absolutely nothing but change the colors of what was already colorized in the shown theme. Currently, it looks something like this (using Dark+): It'd be great if classes whose static members are being accessed would be somewhat emphasized and not left completely white (like that |
Found this feature request in VSCode for exposing a way to plug-in programmatic (semantic) highlighting: microsoft/vscode#585 Until that's implemented we can only do syntax highlighting based on regular expressions, which can do only so much. |
Thanks @ivanz. I went ahead and commented on that issue as well. |
@DustinCampbell One thing I can't quite get my head around is why we need semantic knowledge of an instruction to change the color of The only complication I can think of is if someones uses PascalCase to name their variables or does not with classes names. But, then again, those people deserve not to have proper syntax highlighting. If you assume some kind of coding standard, you can begin to cover a very wide range of cases without semantic shenanigans. |
@nfantone: It's not shenanigans. Casing isn't enough to even make an educated guess. Without semantically knowing what Note that we actually already have all of this information with OmniSharp. We have all the same information that is used to colorize Visual Studio. We just need a way to present that information in VS Code. |
@DustinCampbell You are right. I know it's not "shenanigans". Bad wording, sorry. I disagree with this, tough:
Frankly, I believe it's more than enough. It won't be an exact match, but it'll sure be educated. My point was (is) why aren't we colorizing those terms anyway? Why is the alternative (mostly white text) preferable? Maybe I'm alone with this opinion here, but I'd take having Just for reference, that is what the Javascript syntax highlighter in, say, ST3 does. See below. Both |
We're definitely accepting pull requests. However, as we already have exactly the information to colorize, we're not willing to spend cycles adding heuristics to the reg-ex based grammar to make it look right some of the time. JavaScript is not really a fair comparison as the standard for casing is pretty different. In C#, we'd get it wrong a lot more often. |
Ok, fair enough. Understood. We'll just wait until there's a proper way to output the information you already have in the editor. Thanks! |
Just want to comment on this issue as well and still state that it's a headache on VSCode. Not sure if anything has changed, but the highlighting available is poor at best across almost all themes. @DustinCampbell - if you have any pointers about where to start to make this a community effort it would be much appreciated. |
@kkukshtel: The regular expressions used to colorize code are on this repo and we're definitely accepted pull requests. The problem (I think) is that you're looking for colorization that requires semantic information (i.e. is this identifier a class, an interface, a property, etc.?), which can't be determine via regular expressions. We already have all of that information with OmniSharp via Roslyn, but what is missing is an API to add it to VS Code. This issue is tracking a VS Code API that would allow us to take advantage of that information and provide better colorization (identical to Visual Studio) is here: microsoft/vscode#585. cc @chrisdias, @jrieken |
😍😍😍😍😍😍😍😍 |
From @nfantone on August 17, 2016 14:57
On latest Insiders (
1.5.0-55168276e4c0b6ec2404ac20af04eeed5f5b1000
), C# syntax highlighting look very bland.As you can see, almost 70% of the text is just plain white, with only a few keyword being blue. Tried different themes as well, and all of them colorize the same bits leaving what was white-ish in the default theme intact.
Am I doing something wrong? Is there an extension of sorts for enhancing this? I am new to C# in general, so perhaps this is to be expected? Or are there plans to support better syntax highlighting in the future?
Copied from original issue: microsoft/vscode#10619
The text was updated successfully, but these errors were encountered: