Skip to content
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

Syntax highlighting issue when null conditional accessor split with a newline #4734

Closed
AshleyWorkmanBoomi opened this issue Sep 1, 2021 · 1 comment

Comments

@AshleyWorkmanBoomi
Copy link

AshleyWorkmanBoomi commented Sep 1, 2021

Issue Description

Syntax highlighting breaks when the null conditional access operator is split, first the wrong colours are used and then this progresses to a complete lack of colour. Enabling the csharp.semanticHighlighting.enabled option corrects the highlighting issue.

Steps to Reproduce

The following example reproduces this issue:

            var list = new List<string>()?
                            .Select(x => x).Distinct().ToArray();

            foreach(var element in list)
            {
                switch (element)
                {
                    case "Case One":
                        break;
                    default:
                        break;

                }
            }

            return list;

Expected Behavior

image

Actual Behavior

image

Environment information

VSCode version: 1.59.1
C# Extension: 1.23.14

@JoeRobich
Copy link
Member

This was recently fixed in the C# textmate grammar (dotnet/csharp-tmLanguage#216). It should flow automatically flow into VS Code for the October release. You can set csharp.semanticHighlighting.enabled to true to enable our semantic highlighting which will also resolve this issues for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants