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

[Bug] Language C highlights "class" as token #4039

Open
2 tasks done
danieldietsch opened this issue Jun 23, 2023 · 2 comments · May be fixed by #4308
Open
2 tasks done

[Bug] Language C highlights "class" as token #4039

danieldietsch opened this issue Jun 23, 2023 · 2 comments · May be fixed by #4308
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities languages-basic

Comments

@danieldietsch
Copy link

danieldietsch commented Jun 23, 2023

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

Monaco Editor Playground Link

Monaco Editor Playground Code

const value = `typedef struct {
	xchar class;
} foo;`;

// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
	value,
	language: "cpp",
});

Reproduction Steps

  1. Go to https://microsoft.github.io/monaco-editor/
  2. Select Language c
  3. Write
typedef struct {
    int class;
}

Actual (Problematic) Behavior

See that class is highlighted as keyword

Expected Behavior

class is no keyword in C, it should be highlighted like any other variable

Additional Context

No response

@hediet hediet added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities languages-basic labels Jul 7, 2023
@ayushpatel-05
Copy link

It seems like not just "class" but all the keywords which where added in C++ but not present in C are highlighted as keyword.
I looked into it and it seems there is no special file made for C language in basic languages folder. The keywords returned for .c extension is same as the ones returned for .cpp
Take a look at this

os

What we can do is make a new folder for C language in basic languages.

@SamiKamal SamiKamal linked a pull request Dec 18, 2023 that will close this issue
@SamiKamal
Copy link

Created PR to address this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities languages-basic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants