Skip to content

Commit

Permalink
fix(diagnostic): set diagnostic state from global configuration
Browse files Browse the repository at this point in the history
Closes #5231
  • Loading branch information
chemzqm committed Feb 22, 2025
1 parent ed73d1d commit f11159a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/__tests__/core/files.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down
2 changes: 2 additions & 0 deletions src/diagnostic/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class DiagnosticManager implements Disposable {
execute: () => this.jumpRelated()
}, false, 'jump to related locations of current diagnostic.')
this.defineSigns(workspace.initialConfiguration.get<DiagnosticSignConfig>('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 => {
Expand Down

0 comments on commit f11159a

Please sign in to comment.