From f11159a35b8b59fa6d5ad3e9314fa65e433f8cd1 Mon Sep 17 00:00:00 2001 From: Qiming Zhao Date: Sat, 22 Feb 2025 22:54:51 +0800 Subject: [PATCH] fix(diagnostic): set diagnostic state from global configuration Closes #5231 --- src/__tests__/core/files.test.ts | 3 ++- src/diagnostic/manager.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/__tests__/core/files.test.ts b/src/__tests__/core/files.test.ts index bd94ea14f0f..5adeee36499 100644 --- a/src/__tests__/core/files.test.ts +++ b/src/__tests__/core/files.test.ts @@ -548,7 +548,8 @@ describe('getOriginalLine', () => { }) it('should render annotation label', async () => { - let doc = await helper.createDocument(uuid()) + let filepath = await createTmpFile('', disposables) + let doc = await helper.createDocument(filepath) let edit: WorkspaceEdit = { documentChanges: [ { diff --git a/src/diagnostic/manager.ts b/src/diagnostic/manager.ts index 3c63baf7d11..950e1633805 100644 --- a/src/diagnostic/manager.ts +++ b/src/diagnostic/manager.ts @@ -70,6 +70,8 @@ class DiagnosticManager implements Disposable { execute: () => this.jumpRelated() }, false, 'jump to related locations of current diagnostic.') this.defineSigns(workspace.initialConfiguration.get('diagnostic')) + let globalValue = workspace.initialConfiguration.inspect('diagnostic.enable').globalValue + this.enabled = globalValue !== false this.buffers = workspace.registerBufferSync(doc => { let buf = new DiagnosticBuffer(this.nvim, doc) buf.onDidRefresh(diagnostics => {