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

Specific JS construct breaks syntax highlighting #988

Open
YellowAfterlife opened this issue Aug 9, 2023 · 1 comment
Open

Specific JS construct breaks syntax highlighting #988

YellowAfterlife opened this issue Aug 9, 2023 · 1 comment

Comments

@YellowAfterlife
Copy link

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.81.0 / 6445d93c81ebe42c4cbd7a60712e0b17d9463e97
  • OS Version: Windows_NT x64 10.0.19045

Snippet:

function one() {
	return (
		{
			toString: () => {
				return "Something";
			}
		}
	);
}

function two() {
	return "??";
}

Screenshot:
image

Steps to Reproduce:

  1. Paste the following into a fresh file with JavaScript set as a language
  2. Observe keyword highlighting not working correctly for any functions following function one

This specific nesting (a lambda function with a block inside a property of an object inside parenthesis in a return statement) triggers the effect.

@mjbvz mjbvz transferred this issue from microsoft/vscode Aug 9, 2023
@mjbvz mjbvz removed their assignment Aug 9, 2023
@RedCMD
Copy link

RedCMD commented Nov 10, 2023

for a temporary workaround
you can just place a comment with a = equal sign at the end of the line of the first return statement

Broken:
image
Workaround:
image

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

No branches or pull requests

3 participants