diff --git a/src/server.ts b/src/server.ts index 2b32516..e03ae4b 100644 --- a/src/server.ts +++ b/src/server.ts @@ -51,7 +51,13 @@ documents.onDidChangeContent((event) => { }) documents.onDidClose((event) => { - server?.close(event.document.uri) + const diagnostics = server?.close(event.document.uri) + if (diagnostics) { + connection.sendDiagnostics({ + uri: event.document.uri, + diagnostics, + }) + } }) connection.onDocumentSymbol((params) => { diff --git a/src/sksl-server.ts b/src/sksl-server.ts index 9d8498f..f830466 100644 --- a/src/sksl-server.ts +++ b/src/sksl-server.ts @@ -31,7 +31,7 @@ export class SkSLServer { ) } - public close(uri: string) { + public close(uri: string): ls.Diagnostic[] | undefined { const file = URI.parse(uri).fsPath const uris = this.files.get(file) if (uris) { @@ -55,6 +55,7 @@ export class SkSLServer { // Delete document this.documents.delete(file) } + return [] } public getSymbol(uri: string): ls.DocumentSymbol[] {