better-cpp-syntax
better-cpp-syntax copied to clipboard
Issue with "delete"
Checklist
- [x] This problem exists even with the setting
"C_Cpp.enhancedColorization": "Disabled"
- [ ] This bug exists for C
- [x] This bug exists for C++
- [ ] This bug exists for Objective-C
- [ ] This bug exists for Objective-C++
The code with a problem is:
unique_dynarray(const unique_dynarray &) = delete;
unique_dynarray &
operator=(const unique_dynarray &) = delete;
It looks like:
** screenshot + theme name preferable **
It should look like:
The "delete" keyword should be the same color for both
This is likely an issue with your color theme.
The delete on line one is correctly recognized and has the scope keyword.other.delete.constructor
.
The delete on line one is correctly recognized and has the scope keyword.operator.delete
. (@jeff-hykin is that expected?)
You can use the vscode setting editor.tokenColorCustomizations
to change the coloring for the tokens.
For more information on how to do this see #7 or the visual studio code docs.
Alternatively, if you feel that this behavior should be fixed by default, you may wish to file an issue with your color-theme.
He is actually correct, there is a highlighting issue
class unique_dynarray {
public:
unique_dynarray(const unique_dynarray &) = delete;
unique_dynarray &
operator=(const unique_dynarray &) = delete;
}
Both of them should be keyword.other.delete
(light blue) since they're not operators (purple).
This seems to arise with default
, too. If you replace delete
with default
, the same colourisation occurs.
maybe you can try to use my theme.
https://marketplace.visualstudio.com/items?itemName=peaceshi.syntax-highlight
or added this with the color you like:
keyword.operator { "fontStyle": "", "foreground": "#f07178" },
keyword.other.delete { "fontStyle": "", "foreground": "#f07178" }
We got a similar report at https://github.com/microsoft/vscode-cpptools/issues/5715, with the additional issue with "default" on the operator having scope keyword.control.default.cpp (it's not a control flow "default"). Repro is
struct Test {
Test(Test&) = default;
Test(Test&&) = delete;
Test& operator=(const Test &) = default;
Test& operator=(Test&&) = delete;
};
Should be fixed now (v1.15.24
released just now), but let me know if it persists