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

C# syntax highlights ref inside variable names in lambdas #40911

Closed
matthewpwatkins opened this issue Dec 28, 2017 · 2 comments
Closed

C# syntax highlights ref inside variable names in lambdas #40911

matthewpwatkins opened this issue Dec 28, 2017 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug grammar Syntax highlighting grammar upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Milestone

Comments

@matthewpwatkins
Copy link

matthewpwatkins commented Dec 28, 2017

(Also reported in https://github.com/dotnet/csharp-tmLanguage/tree/master/test)

  • VSCode Version: Code 1.19.1 (0759f77, 2017-12-19T09:46:23.884Z)
  • OS Version: Windows_NT x64 10.0.16299
  • Extensions: none

Steps to Reproduce:

  1. Create or open a C# file
  2. Write a lambda expression in a LINQ Where clause where the variable name for the element starts with "ref". Example:
var refObjectsToKeep = allRefObjects.Where(refObject => refObject.ShouldKeep);

In Code, you will see that the C# syntax highlighting highlights the "ref" in "refObject" as if the first three characters were a reserved word. This does not seem to happen for other reserved words. For example, these highlight fine:

var intObjectsToKeep = allIntObjects.Where(intObject => intObject.ShouldKeep);
var outObjectsToKeep = allOutObjects.Where(outObject => outObject.ShouldKeep);

image

Reproduces without extensions: Yes

@vscodebot vscodebot bot added the javascript JavaScript support issues label Dec 28, 2017
@matthewpwatkins
Copy link
Author

@matthewpwatkins
Copy link
Author

Created dotnet/csharp-tmLanguage#95 to address this.

@mjbvz mjbvz added grammar Syntax highlighting grammar upstream Issue identified as 'upstream' component related (exists outside of VS Code) bug Issue identified by VS Code Team member as probable bug and removed javascript JavaScript support issues labels Jan 2, 2018
@mjbvz mjbvz added this to the December 2017/January 2018 milestone Jan 4, 2018
@mjbvz mjbvz closed this as completed in 99ff3eb Jan 4, 2018
@roblourens roblourens added the verified Verification succeeded label Feb 1, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug grammar Syntax highlighting grammar upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants