mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-26 01:38:22 +00:00
vscode: redesigned config with simplicity and Dart extension config implementation in mind
This commit is contained in:
parent
9b47124e6e
commit
7ad15c3962
5 changed files with 98 additions and 218 deletions
|
|
@ -11,7 +11,7 @@ export function activateHighlighting(ctx: Ctx) {
|
|||
client.onNotification(
|
||||
'rust-analyzer/publishDecorations',
|
||||
(params: PublishDecorationsParams) => {
|
||||
if (!ctx.config.highlightingOn) return;
|
||||
if (!ctx.config.highlightingOn()) return;
|
||||
|
||||
const targetEditor = vscode.window.visibleTextEditors.find(
|
||||
editor => {
|
||||
|
|
@ -39,7 +39,7 @@ export function activateHighlighting(ctx: Ctx) {
|
|||
vscode.window.onDidChangeActiveTextEditor(
|
||||
async (editor: vscode.TextEditor | undefined) => {
|
||||
if (!editor || editor.document.languageId !== 'rust') return;
|
||||
if (!ctx.config.highlightingOn) return;
|
||||
if (!ctx.config.highlightingOn()) return;
|
||||
const client = ctx.client;
|
||||
if (!client) return;
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ class Highlighter {
|
|||
string,
|
||||
[vscode.Range[], boolean]
|
||||
> = new Map();
|
||||
const rainbowTime = this.ctx.config.rainbowHighlightingOn;
|
||||
const rainbowTime = this.ctx.config.rainbowHighlightingOn();
|
||||
|
||||
for (const tag of this.decorations.keys()) {
|
||||
byTag.set(tag, []);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue