mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
* Adding scope mapping configuration manifest in package.json
* Loading configurable scope mappings from settings. * Updating Readme with `rust-analyzer.scopeMappings`. `rust-analyzer.scopeMappings` -- a scheme backed JSON object to tweak Rust Analyzer scopes to TextMate scopes. ```jsonc { //Will autocomplete keys to available RA scopes. "keyword.unsafe": ["keyword", "keyword.control"], //Values are string | TextMateScope | [string | TextMateScope] "comments": "comment.block" } ```
This commit is contained in:
parent
dad9bc6caa
commit
c60f9bf4c6
6 changed files with 151 additions and 68 deletions
|
@ -48,11 +48,13 @@ export class Config {
|
|||
const config = vscode.workspace.getConfiguration('rust-analyzer');
|
||||
|
||||
Server.highlighter.removeHighlights();
|
||||
scopes.load()
|
||||
scopesMapper.load()
|
||||
if (config.has('highlightingOn')) {
|
||||
|
||||
if (config.has('highlightingOn')) {
|
||||
this.highlightingOn = config.get('highlightingOn') as boolean;
|
||||
if (this.highlightingOn) {
|
||||
scopes.load();
|
||||
scopesMapper.load();
|
||||
}
|
||||
}
|
||||
|
||||
if (config.has('rainbowHighlightingOn')) {
|
||||
|
@ -61,9 +63,6 @@ export class Config {
|
|||
) as boolean;
|
||||
}
|
||||
|
||||
if (!this.highlightingOn && Server) {
|
||||
Server.highlighter.removeHighlights();
|
||||
}
|
||||
|
||||
if (config.has('enableEnhancedTyping')) {
|
||||
this.enableEnhancedTyping = config.get(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue