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

new and delete not colorized #42

Closed
ember91 opened this issue Mar 21, 2019 · 2 comments
Closed

new and delete not colorized #42

ember91 opened this issue Mar 21, 2019 · 2 comments
Labels
theme-color More related to theme than it is the syntax wontfix This will not be worked on

Comments

@ember91
Copy link

ember91 commented Mar 21, 2019

Describe the bug

  • OS and Version: Ubuntu 18.04.2 LTS
  • VS Code Version: 1.32.3
  • Better C++ Syntax Extension Version: 1.6.5
  • Other extensions you installed (and if the issue persists after disabling them): C/C++. The issue persists after disabling it.
  • A clear and concise description of what the bug is: The keywords 'new' and 'delete' are not colorized at all.

To Reproduce

  1. Create a new file with extension '.cpp'.
  2. Input the code below in the newly created file.
int main()
{
    int* i = new int;
    delete i;
}

Expected behavior
'new' and 'delete' should be colorized.

Additional context
May be true for other keywords as well.

@matter123 matter123 added wontfix This will not be worked on theme-color More related to theme than it is the syntax labels Mar 21, 2019
@matter123
Copy link
Collaborator

matter123 commented Mar 21, 2019

This is an issue with your color theme.

new correctly has the textmate scope of keyword.operator.memory.new and delete
correctly has the scope of keyword.operator.memory.delete.

You can fix this by adding the following snippet to settings.json.

	"editor.tokenColorCustomizations": {
		"textMateRules": [
			{
				"name": "memory operators",
				"scope": ["source.cpp keyword.operator"],
				"settings": {
					"foreground": "#bc7ed7", // color you want it to be
					"fontStyle": "" // bold/underline/italics or none
				}
			}
		]
	},

You may want to file an issue with your theme as this grammar will soon be the default grammar for C/C++

Further discussion relating to theme colors should be directed at #7.

@ember91
Copy link
Author

ember91 commented Mar 22, 2019

This is correct. For reference, of the default themes Light (Visual Studio), Light+ (default light), Dark (Visual Studio), Dark+ (default dark), and High Contrast all have this problem with new and delete being just white or black. Sorry for the misreport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme-color More related to theme than it is the syntax wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants