如何查找Visual Studio 2017中JavaScript相关的语法高亮颜色设置列表?
Hey there! Let's break down your two questions about Visual Studio 2017's JavaScript syntax highlighting—first the full list of color settings you can tweak, then a trick to avoid that tedious "close and reopen" preview cycle.
一、JavaScript-specific syntax highlighting color settings in VS2017
Here are all the relevant items you'll find in the Fonts and Colors dialog (under Show settings for: Text Editor) that apply to JavaScript:
- JavaScript Comment: Controls color for single-line (
// ...) and multi-line (/* ... */) comments - JavaScript Identifier: Colors for variable names, function names, and other identifiers
- JavaScript Keyword: Highlights JS core keywords like
var,function,if,async,await - JavaScript Number: Colors numeric literals (e.g.,
42,3.14,0xFF) - JavaScript Operator: Styles operators like
+,-,=,&&,||,=== - JavaScript String: Colors standard string literals (
"hello"or'world') - JavaScript String Escape Sequence: Highlights escape characters inside strings, like
\n,\", or\t - JavaScript Regular Expression: Styles regex literals (e.g.,
/^\d+$/) - JavaScript Template String: Colors ES6 template strings wrapped in backticks (
`hello ${name}`) - JavaScript Template String Substitution: Highlights the variable parts inside template strings (
${variable}) - JavaScript XML Documentation Comment: Styles JSDoc-style comments like
/** ... */ - JavaScript XML Documentation Tag: Colors tags within JSDoc comments, such as
@param,@returns, or@example
二、Skip the "OK and close" cycle: Preview changes in real-time
You don't have to close the Fonts and Colors window every time to see your changes! Here's the trick:
- Open Tools > Options > Environment > Fonts and Colors like usual
- Keep this dialog open, then switch back to your JavaScript editor window (use Alt+Tab or just click the editor area—you can interact with both windows at once)
- After adjusting a color setting, click the Apply button at the bottom of the Fonts and Colors dialog
- Immediately switch back to your editor—you'll see the syntax highlighting update right away!
This saves you tons of time toggling between windows and re-opening the settings.
内容的提问来源于stack exchange,提问作者Klay
相关产品推荐
相关产品推荐

