Skip to content

Commit

Permalink
Create one DiagnosticCollection and reuse it
Browse files Browse the repository at this point in the history
Fix for issue #19
  • Loading branch information
pedro-w committed May 16, 2021
1 parent a00cd54 commit a87a16b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jsonTmLanguageDiagnosticProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import * as vscode from 'vscode'
import JsonTmLanguageAnalyser from './jsonTmLanguageAnalyser'

export default class jsonTmLanguageDiagnosticProvider {
private readonly uuidErrors = vscode.languages.createDiagnosticCollection('languageErrors')
public CreateDiagnostics (document: vscode.TextDocument): void {
const diagnostics: vscode.Diagnostic[] = []
const uuidErrors = vscode.languages.createDiagnosticCollection('languageErrors')

const analyser = new JsonTmLanguageAnalyser()

Expand Down Expand Up @@ -48,7 +48,7 @@ export default class jsonTmLanguageDiagnosticProvider {
}
}

uuidErrors.set(document.uri, diagnostics)
this.uuidErrors.set(document.uri, diagnostics)
}

private searchElements (element: any, matchingTitle: string): any[] {
Expand Down

0 comments on commit a87a16b

Please sign in to comment.