Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cooolbros committed Feb 16, 2024
1 parent 571a000 commit b279c37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/lib/server/LanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ export abstract class LanguageServer<T extends DocumentSymbol[]> {

this.documentsConfiguration.add(e.document.uri)

let documentSymbols
let documentSymbols: T
let diagnostics: VDFSyntaxError | Diagnostic[] = []
try {
documentSymbols = this.languageServerConfiguration.parseDocumentSymbols(e.document.getText())
this.documentsSymbols.set(e.document.uri, documentSymbols)
diagnostics = await this.validateTextDocument(e.document.uri, documentSymbols)
}
catch (error: any) {
catch (error: unknown) {
documentSymbols = this.languageServerConfiguration.defaultDocumentSymbols()
this.documentsSymbols.set(e.document.uri, documentSymbols)
if (error instanceof VDFSyntaxError) {
Expand Down
7 changes: 2 additions & 5 deletions packages/lib/server/VDF/VDFLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export abstract class VDFLanguageServer extends LanguageServer<VDFDocumentSymbol
}
}

const diagnostic: Diagnostic = {
diagnostics.push({
range: documentSymbol.detailRange!,
severity: DiagnosticSeverity.Warning,
code: "invalid-value",
Expand All @@ -175,9 +175,7 @@ export abstract class VDFLanguageServer extends LanguageServer<VDFDocumentSymbol
documentSymbol: documentSymbol,
newText: valueData.fix?.[documentSymbolValue],
}
}

diagnostics.push(diagnostic)
})
}

const type = ((): number | null => {
Expand Down Expand Up @@ -1070,7 +1068,6 @@ export abstract class VDFLanguageServer extends LanguageServer<VDFDocumentSymbol
return { changes }
}


private async onDocumentSymbolKeys(params: unknown): Promise<string[] | null> {

const { uri } = await z.object({ uri: z.string() }).parseAsync(params)
Expand Down

0 comments on commit b279c37

Please sign in to comment.