Skip to content

Commit 4c9a22c

Browse files
committed
Document lsp module.
1 parent bf295fa commit 4c9a22c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lsp.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,13 @@ export function inverse_namespace(namespace: object): Record<number, string> {
4242
return records;
4343
}
4444

45+
/**
46+
* Why programmatic solution rather than hard-coding the namespace the other way around?
47+
* Because the namespaces are copy-paste from the LSP specification, and it will be easier
48+
* to maintain this way in the future.
49+
*
50+
* Why not simply import from lsProtocol?
51+
* Because this triggers some strange webpack issue as an additional package would need to be included.
52+
*/
4553
export const diagnosticSeverityNames = inverse_namespace(DiagnosticSeverity);
4654
export const completionItemKindNames = inverse_namespace(CompletionItemKind);

0 commit comments

Comments
 (0)