@macroforge/svelte-language-server 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +331 -0
- package/bin/server.js +5 -0
- package/dist/src/importPackage.d.ts +16 -0
- package/dist/src/importPackage.js +76 -0
- package/dist/src/importPackage.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +23 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/DiagnosticsManager.d.ts +20 -0
- package/dist/src/lib/DiagnosticsManager.js +71 -0
- package/dist/src/lib/DiagnosticsManager.js.map +1 -0
- package/dist/src/lib/FallbackWatcher.d.ts +15 -0
- package/dist/src/lib/FallbackWatcher.js +66 -0
- package/dist/src/lib/FallbackWatcher.js.map +1 -0
- package/dist/src/lib/documentHighlight/wordHighlight.d.ts +3 -0
- package/dist/src/lib/documentHighlight/wordHighlight.js +62 -0
- package/dist/src/lib/documentHighlight/wordHighlight.js.map +1 -0
- package/dist/src/lib/documents/Document.d.ts +63 -0
- package/dist/src/lib/documents/Document.js +138 -0
- package/dist/src/lib/documents/Document.js.map +1 -0
- package/dist/src/lib/documents/DocumentBase.d.ts +65 -0
- package/dist/src/lib/documents/DocumentBase.js +69 -0
- package/dist/src/lib/documents/DocumentBase.js.map +1 -0
- package/dist/src/lib/documents/DocumentManager.d.ts +28 -0
- package/dist/src/lib/documents/DocumentManager.js +122 -0
- package/dist/src/lib/documents/DocumentManager.js.map +1 -0
- package/dist/src/lib/documents/DocumentMapper.d.ts +88 -0
- package/dist/src/lib/documents/DocumentMapper.js +258 -0
- package/dist/src/lib/documents/DocumentMapper.js.map +1 -0
- package/dist/src/lib/documents/configLoader.d.ts +80 -0
- package/dist/src/lib/documents/configLoader.js +265 -0
- package/dist/src/lib/documents/configLoader.js.map +1 -0
- package/dist/src/lib/documents/fileCollection.d.ts +41 -0
- package/dist/src/lib/documents/fileCollection.js +87 -0
- package/dist/src/lib/documents/fileCollection.js.map +1 -0
- package/dist/src/lib/documents/index.d.ts +5 -0
- package/dist/src/lib/documents/index.js +22 -0
- package/dist/src/lib/documents/index.js.map +1 -0
- package/dist/src/lib/documents/parseHtml.d.ts +13 -0
- package/dist/src/lib/documents/parseHtml.js +160 -0
- package/dist/src/lib/documents/parseHtml.js.map +1 -0
- package/dist/src/lib/documents/utils.d.ts +105 -0
- package/dist/src/lib/documents/utils.js +410 -0
- package/dist/src/lib/documents/utils.js.map +1 -0
- package/dist/src/lib/foldingRange/indentFolding.d.ts +26 -0
- package/dist/src/lib/foldingRange/indentFolding.js +142 -0
- package/dist/src/lib/foldingRange/indentFolding.js.map +1 -0
- package/dist/src/lib/semanticToken/semanticTokenLegend.d.ts +33 -0
- package/dist/src/lib/semanticToken/semanticTokenLegend.js +37 -0
- package/dist/src/lib/semanticToken/semanticTokenLegend.js.map +1 -0
- package/dist/src/logger.d.ts +9 -0
- package/dist/src/logger.js +28 -0
- package/dist/src/logger.js.map +1 -0
- package/dist/src/ls-config.d.ts +326 -0
- package/dist/src/ls-config.js +386 -0
- package/dist/src/ls-config.js.map +1 -0
- package/dist/src/plugins/PluginHost.d.ts +68 -0
- package/dist/src/plugins/PluginHost.js +447 -0
- package/dist/src/plugins/PluginHost.js.map +1 -0
- package/dist/src/plugins/css/CSSDocument.d.ts +46 -0
- package/dist/src/plugins/css/CSSDocument.js +78 -0
- package/dist/src/plugins/css/CSSDocument.js.map +1 -0
- package/dist/src/plugins/css/CSSPlugin.d.ts +35 -0
- package/dist/src/plugins/css/CSSPlugin.js +407 -0
- package/dist/src/plugins/css/CSSPlugin.js.map +1 -0
- package/dist/src/plugins/css/FileSystemProvider.d.ts +10 -0
- package/dist/src/plugins/css/FileSystemProvider.js +75 -0
- package/dist/src/plugins/css/FileSystemProvider.js.map +1 -0
- package/dist/src/plugins/css/StyleAttributeDocument.d.ts +41 -0
- package/dist/src/plugins/css/StyleAttributeDocument.js +65 -0
- package/dist/src/plugins/css/StyleAttributeDocument.js.map +1 -0
- package/dist/src/plugins/css/features/getIdClassCompletion.d.ts +19 -0
- package/dist/src/plugins/css/features/getIdClassCompletion.js +56 -0
- package/dist/src/plugins/css/features/getIdClassCompletion.js.map +1 -0
- package/dist/src/plugins/css/features/svelte-selectors.d.ts +2 -0
- package/dist/src/plugins/css/features/svelte-selectors.js +18 -0
- package/dist/src/plugins/css/features/svelte-selectors.js.map +1 -0
- package/dist/src/plugins/css/global-vars.d.ts +16 -0
- package/dist/src/plugins/css/global-vars.js +82 -0
- package/dist/src/plugins/css/global-vars.js.map +1 -0
- package/dist/src/plugins/css/service.d.ts +5 -0
- package/dist/src/plugins/css/service.js +66 -0
- package/dist/src/plugins/css/service.js.map +1 -0
- package/dist/src/plugins/documentContext.d.ts +3 -0
- package/dist/src/plugins/documentContext.js +36 -0
- package/dist/src/plugins/documentContext.js.map +1 -0
- package/dist/src/plugins/html/HTMLPlugin.d.ts +36 -0
- package/dist/src/plugins/html/HTMLPlugin.js +363 -0
- package/dist/src/plugins/html/HTMLPlugin.js.map +1 -0
- package/dist/src/plugins/html/dataProvider.d.ts +1 -0
- package/dist/src/plugins/html/dataProvider.js +481 -0
- package/dist/src/plugins/html/dataProvider.js.map +1 -0
- package/dist/src/plugins/index.d.ts +7 -0
- package/dist/src/plugins/index.js +24 -0
- package/dist/src/plugins/index.js.map +1 -0
- package/dist/src/plugins/interfaces.d.ts +132 -0
- package/dist/src/plugins/interfaces.js +3 -0
- package/dist/src/plugins/interfaces.js.map +1 -0
- package/dist/src/plugins/svelte/SvelteDocument.d.ts +98 -0
- package/dist/src/plugins/svelte/SvelteDocument.js +318 -0
- package/dist/src/plugins/svelte/SvelteDocument.js.map +1 -0
- package/dist/src/plugins/svelte/SveltePlugin.d.ts +24 -0
- package/dist/src/plugins/svelte/SveltePlugin.js +306 -0
- package/dist/src/plugins/svelte/SveltePlugin.js.map +1 -0
- package/dist/src/plugins/svelte/features/SvelteTags.d.ts +28 -0
- package/dist/src/plugins/svelte/features/SvelteTags.js +136 -0
- package/dist/src/plugins/svelte/features/SvelteTags.js.map +1 -0
- package/dist/src/plugins/svelte/features/getCodeActions/getQuickfixes.d.ts +11 -0
- package/dist/src/plugins/svelte/features/getCodeActions/getQuickfixes.js +140 -0
- package/dist/src/plugins/svelte/features/getCodeActions/getQuickfixes.js.map +1 -0
- package/dist/src/plugins/svelte/features/getCodeActions/getRefactorings.d.ts +9 -0
- package/dist/src/plugins/svelte/features/getCodeActions/getRefactorings.js +140 -0
- package/dist/src/plugins/svelte/features/getCodeActions/getRefactorings.js.map +1 -0
- package/dist/src/plugins/svelte/features/getCodeActions/index.d.ts +4 -0
- package/dist/src/plugins/svelte/features/getCodeActions/index.js +19 -0
- package/dist/src/plugins/svelte/features/getCodeActions/index.js.map +1 -0
- package/dist/src/plugins/svelte/features/getCompletions.d.ts +4 -0
- package/dist/src/plugins/svelte/features/getCompletions.js +184 -0
- package/dist/src/plugins/svelte/features/getCompletions.js.map +1 -0
- package/dist/src/plugins/svelte/features/getDiagnostics.d.ts +9 -0
- package/dist/src/plugins/svelte/features/getDiagnostics.js +284 -0
- package/dist/src/plugins/svelte/features/getDiagnostics.js.map +1 -0
- package/dist/src/plugins/svelte/features/getHoverInfo.d.ts +7 -0
- package/dist/src/plugins/svelte/features/getHoverInfo.js +93 -0
- package/dist/src/plugins/svelte/features/getHoverInfo.js.map +1 -0
- package/dist/src/plugins/svelte/features/getModifierData.d.ts +7 -0
- package/dist/src/plugins/svelte/features/getModifierData.js +56 -0
- package/dist/src/plugins/svelte/features/getModifierData.js.map +1 -0
- package/dist/src/plugins/svelte/features/getSelectionRanges.d.ts +3 -0
- package/dist/src/plugins/svelte/features/getSelectionRanges.js +46 -0
- package/dist/src/plugins/svelte/features/getSelectionRanges.js.map +1 -0
- package/dist/src/plugins/svelte/features/utils.d.ts +5 -0
- package/dist/src/plugins/svelte/features/utils.js +18 -0
- package/dist/src/plugins/svelte/features/utils.js.map +1 -0
- package/dist/src/plugins/typescript/ComponentInfoProvider.d.ts +27 -0
- package/dist/src/plugins/typescript/ComponentInfoProvider.js +116 -0
- package/dist/src/plugins/typescript/ComponentInfoProvider.js.map +1 -0
- package/dist/src/plugins/typescript/DocumentMapper.d.ts +10 -0
- package/dist/src/plugins/typescript/DocumentMapper.js +25 -0
- package/dist/src/plugins/typescript/DocumentMapper.js.map +1 -0
- package/dist/src/plugins/typescript/DocumentSnapshot.d.ts +173 -0
- package/dist/src/plugins/typescript/DocumentSnapshot.js +623 -0
- package/dist/src/plugins/typescript/DocumentSnapshot.js.map +1 -0
- package/dist/src/plugins/typescript/LSAndTSDocResolver.d.ts +100 -0
- package/dist/src/plugins/typescript/LSAndTSDocResolver.js +301 -0
- package/dist/src/plugins/typescript/LSAndTSDocResolver.js.map +1 -0
- package/dist/src/plugins/typescript/SnapshotManager.d.ts +59 -0
- package/dist/src/plugins/typescript/SnapshotManager.js +238 -0
- package/dist/src/plugins/typescript/SnapshotManager.js.map +1 -0
- package/dist/src/plugins/typescript/TypeScriptPlugin.d.ts +65 -0
- package/dist/src/plugins/typescript/TypeScriptPlugin.js +332 -0
- package/dist/src/plugins/typescript/TypeScriptPlugin.js.map +1 -0
- package/dist/src/plugins/typescript/features/CallHierarchyProvider.d.ts +24 -0
- package/dist/src/plugins/typescript/features/CallHierarchyProvider.js +325 -0
- package/dist/src/plugins/typescript/features/CallHierarchyProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/CodeActionsProvider.d.ts +72 -0
- package/dist/src/plugins/typescript/features/CodeActionsProvider.js +1030 -0
- package/dist/src/plugins/typescript/features/CodeActionsProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/CodeLensProvider.d.ts +28 -0
- package/dist/src/plugins/typescript/features/CodeLensProvider.js +205 -0
- package/dist/src/plugins/typescript/features/CodeLensProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/CompletionProvider.d.ts +57 -0
- package/dist/src/plugins/typescript/features/CompletionProvider.js +791 -0
- package/dist/src/plugins/typescript/features/CompletionProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/DiagnosticsProvider.d.ts +36 -0
- package/dist/src/plugins/typescript/features/DiagnosticsProvider.js +497 -0
- package/dist/src/plugins/typescript/features/DiagnosticsProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/DocumentHighlightProvider.d.ts +17 -0
- package/dist/src/plugins/typescript/features/DocumentHighlightProvider.js +211 -0
- package/dist/src/plugins/typescript/features/DocumentHighlightProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/FindComponentReferencesProvider.d.ts +9 -0
- package/dist/src/plugins/typescript/features/FindComponentReferencesProvider.js +66 -0
- package/dist/src/plugins/typescript/features/FindComponentReferencesProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/FindFileReferencesProvider.d.ts +9 -0
- package/dist/src/plugins/typescript/features/FindFileReferencesProvider.js +38 -0
- package/dist/src/plugins/typescript/features/FindFileReferencesProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/FindReferencesProvider.d.ts +20 -0
- package/dist/src/plugins/typescript/features/FindReferencesProvider.js +149 -0
- package/dist/src/plugins/typescript/features/FindReferencesProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/FoldingRangeProvider.d.ts +28 -0
- package/dist/src/plugins/typescript/features/FoldingRangeProvider.js +247 -0
- package/dist/src/plugins/typescript/features/FoldingRangeProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/HoverProvider.d.ts +11 -0
- package/dist/src/plugins/typescript/features/HoverProvider.js +75 -0
- package/dist/src/plugins/typescript/features/HoverProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/ImplementationProvider.d.ts +9 -0
- package/dist/src/plugins/typescript/features/ImplementationProvider.js +47 -0
- package/dist/src/plugins/typescript/features/ImplementationProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/InlayHintProvider.d.ts +22 -0
- package/dist/src/plugins/typescript/features/InlayHintProvider.js +225 -0
- package/dist/src/plugins/typescript/features/InlayHintProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/RenameProvider.d.ts +53 -0
- package/dist/src/plugins/typescript/features/RenameProvider.js +423 -0
- package/dist/src/plugins/typescript/features/RenameProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/SelectionRangeProvider.d.ts +18 -0
- package/dist/src/plugins/typescript/features/SelectionRangeProvider.js +62 -0
- package/dist/src/plugins/typescript/features/SelectionRangeProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/SemanticTokensProvider.d.ts +15 -0
- package/dist/src/plugins/typescript/features/SemanticTokensProvider.js +116 -0
- package/dist/src/plugins/typescript/features/SemanticTokensProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/SignatureHelpProvider.d.ts +22 -0
- package/dist/src/plugins/typescript/features/SignatureHelpProvider.js +110 -0
- package/dist/src/plugins/typescript/features/SignatureHelpProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/TypeDefinitionProvider.d.ts +9 -0
- package/dist/src/plugins/typescript/features/TypeDefinitionProvider.js +35 -0
- package/dist/src/plugins/typescript/features/TypeDefinitionProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/UpdateImportsProvider.d.ts +11 -0
- package/dist/src/plugins/typescript/features/UpdateImportsProvider.js +109 -0
- package/dist/src/plugins/typescript/features/UpdateImportsProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/WorkspaceSymbolProvider.d.ts +25 -0
- package/dist/src/plugins/typescript/features/WorkspaceSymbolProvider.js +176 -0
- package/dist/src/plugins/typescript/features/WorkspaceSymbolProvider.js.map +1 -0
- package/dist/src/plugins/typescript/features/getDirectiveCommentCompletions.d.ts +13 -0
- package/dist/src/plugins/typescript/features/getDirectiveCommentCompletions.js +58 -0
- package/dist/src/plugins/typescript/features/getDirectiveCommentCompletions.js.map +1 -0
- package/dist/src/plugins/typescript/features/getJsDocTemplateCompletion.d.ts +4 -0
- package/dist/src/plugins/typescript/features/getJsDocTemplateCompletion.js +57 -0
- package/dist/src/plugins/typescript/features/getJsDocTemplateCompletion.js.map +1 -0
- package/dist/src/plugins/typescript/features/utils.d.ts +81 -0
- package/dist/src/plugins/typescript/features/utils.js +331 -0
- package/dist/src/plugins/typescript/features/utils.js.map +1 -0
- package/dist/src/plugins/typescript/macroforgeAugmenter.d.ts +23 -0
- package/dist/src/plugins/typescript/macroforgeAugmenter.js +41 -0
- package/dist/src/plugins/typescript/macroforgeAugmenter.js.map +1 -0
- package/dist/src/plugins/typescript/module-loader.d.ts +28 -0
- package/dist/src/plugins/typescript/module-loader.js +254 -0
- package/dist/src/plugins/typescript/module-loader.js.map +1 -0
- package/dist/src/plugins/typescript/previewer.d.ts +7 -0
- package/dist/src/plugins/typescript/previewer.js +120 -0
- package/dist/src/plugins/typescript/previewer.js.map +1 -0
- package/dist/src/plugins/typescript/service.d.ts +105 -0
- package/dist/src/plugins/typescript/service.js +1073 -0
- package/dist/src/plugins/typescript/service.js.map +1 -0
- package/dist/src/plugins/typescript/serviceCache.d.ts +90 -0
- package/dist/src/plugins/typescript/serviceCache.js +50 -0
- package/dist/src/plugins/typescript/serviceCache.js.map +1 -0
- package/dist/src/plugins/typescript/svelte-ast-utils.d.ts +77 -0
- package/dist/src/plugins/typescript/svelte-ast-utils.js +100 -0
- package/dist/src/plugins/typescript/svelte-ast-utils.js.map +1 -0
- package/dist/src/plugins/typescript/svelte-sys.d.ts +9 -0
- package/dist/src/plugins/typescript/svelte-sys.js +79 -0
- package/dist/src/plugins/typescript/svelte-sys.js.map +1 -0
- package/dist/src/plugins/typescript/utils.d.ts +48 -0
- package/dist/src/plugins/typescript/utils.js +334 -0
- package/dist/src/plugins/typescript/utils.js.map +1 -0
- package/dist/src/server.d.ts +19 -0
- package/dist/src/server.js +434 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/svelte-check.d.ts +65 -0
- package/dist/src/svelte-check.js +288 -0
- package/dist/src/svelte-check.js.map +1 -0
- package/dist/src/utils.d.ts +111 -0
- package/dist/src/utils.js +337 -0
- package/dist/src/utils.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSemanticTokenLegends = getSemanticTokenLegends;
|
|
4
|
+
const vscode_languageserver_1 = require("vscode-languageserver");
|
|
5
|
+
function getSemanticTokenLegends() {
|
|
6
|
+
const tokenModifiers = [];
|
|
7
|
+
[
|
|
8
|
+
[0 /* TokenModifier.declaration */, vscode_languageserver_1.SemanticTokenModifiers.declaration],
|
|
9
|
+
[1 /* TokenModifier.static */, vscode_languageserver_1.SemanticTokenModifiers.static],
|
|
10
|
+
[2 /* TokenModifier.async */, vscode_languageserver_1.SemanticTokenModifiers.async],
|
|
11
|
+
[3 /* TokenModifier.readonly */, vscode_languageserver_1.SemanticTokenModifiers.readonly],
|
|
12
|
+
[4 /* TokenModifier.defaultLibrary */, vscode_languageserver_1.SemanticTokenModifiers.defaultLibrary],
|
|
13
|
+
[5 /* TokenModifier.local */, 'local']
|
|
14
|
+
].forEach(([tsModifier, legend]) => (tokenModifiers[tsModifier] = legend));
|
|
15
|
+
const tokenTypes = [];
|
|
16
|
+
[
|
|
17
|
+
[0 /* TokenType.class */, vscode_languageserver_1.SemanticTokenTypes.class],
|
|
18
|
+
[1 /* TokenType.enum */, vscode_languageserver_1.SemanticTokenTypes.enum],
|
|
19
|
+
[2 /* TokenType.interface */, vscode_languageserver_1.SemanticTokenTypes.interface],
|
|
20
|
+
[3 /* TokenType.namespace */, vscode_languageserver_1.SemanticTokenTypes.namespace],
|
|
21
|
+
[4 /* TokenType.typeParameter */, vscode_languageserver_1.SemanticTokenTypes.typeParameter],
|
|
22
|
+
[5 /* TokenType.type */, vscode_languageserver_1.SemanticTokenTypes.type],
|
|
23
|
+
[6 /* TokenType.parameter */, vscode_languageserver_1.SemanticTokenTypes.parameter],
|
|
24
|
+
[7 /* TokenType.variable */, vscode_languageserver_1.SemanticTokenTypes.variable],
|
|
25
|
+
[8 /* TokenType.enumMember */, vscode_languageserver_1.SemanticTokenTypes.enumMember],
|
|
26
|
+
[9 /* TokenType.property */, vscode_languageserver_1.SemanticTokenTypes.property],
|
|
27
|
+
[10 /* TokenType.function */, vscode_languageserver_1.SemanticTokenTypes.function],
|
|
28
|
+
// member is renamed to method in vscode codebase to match LSP default
|
|
29
|
+
[11 /* TokenType.member */, vscode_languageserver_1.SemanticTokenTypes.method],
|
|
30
|
+
[12 /* TokenType.event */, vscode_languageserver_1.SemanticTokenTypes.event]
|
|
31
|
+
].forEach(([tokenType, legend]) => (tokenTypes[tokenType] = legend));
|
|
32
|
+
return {
|
|
33
|
+
tokenModifiers,
|
|
34
|
+
tokenTypes
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=semanticTokenLegend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semanticTokenLegend.js","sourceRoot":"","sources":["../../../../src/lib/semanticToken/semanticTokenLegend.ts"],"names":[],"mappings":";;AAyCA,0DAwCC;AAjFD,iEAI+B;AAqC/B,SAAgB,uBAAuB;IACnC,MAAM,cAAc,GAAa,EAAE,CAAC;IAGhC;QACI,oCAA4B,8CAAsB,CAAC,WAAW,CAAC;QAC/D,+BAAuB,8CAAsB,CAAC,MAAM,CAAC;QACrD,8BAAsB,8CAAsB,CAAC,KAAK,CAAC;QACnD,iCAAyB,8CAAsB,CAAC,QAAQ,CAAC;QACzD,uCAA+B,8CAAsB,CAAC,cAAc,CAAC;QACrE,8BAAsB,OAAO,CAAC;KAErC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;IAE3E,MAAM,UAAU,GAAa,EAAE,CAAC;IAG5B;QACI,0BAAkB,0CAAkB,CAAC,KAAK,CAAC;QAC3C,yBAAiB,0CAAkB,CAAC,IAAI,CAAC;QACzC,8BAAsB,0CAAkB,CAAC,SAAS,CAAC;QACnD,8BAAsB,0CAAkB,CAAC,SAAS,CAAC;QACnD,kCAA0B,0CAAkB,CAAC,aAAa,CAAC;QAC3D,yBAAiB,0CAAkB,CAAC,IAAI,CAAC;QACzC,8BAAsB,0CAAkB,CAAC,SAAS,CAAC;QACnD,6BAAqB,0CAAkB,CAAC,QAAQ,CAAC;QACjD,+BAAuB,0CAAkB,CAAC,UAAU,CAAC;QACrD,6BAAqB,0CAAkB,CAAC,QAAQ,CAAC;QACjD,8BAAqB,0CAAkB,CAAC,QAAQ,CAAC;QAEjD,sEAAsE;QACtE,4BAAmB,0CAAkB,CAAC,MAAM,CAAC;QAC7C,2BAAkB,0CAAkB,CAAC,KAAK,CAAC;KAElD,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;IAErE,OAAO;QACH,cAAc;QACd,UAAU;KACb,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class Logger {
|
|
2
|
+
private static logErrorsOnly;
|
|
3
|
+
private static logDebug;
|
|
4
|
+
static setLogErrorsOnly(logErrorsOnly: boolean): void;
|
|
5
|
+
static setDebug(debug: boolean): void;
|
|
6
|
+
static log(...args: any): void;
|
|
7
|
+
static error(...args: any): void;
|
|
8
|
+
static debug(...args: any): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Logger = void 0;
|
|
4
|
+
class Logger {
|
|
5
|
+
static setLogErrorsOnly(logErrorsOnly) {
|
|
6
|
+
Logger.logErrorsOnly = logErrorsOnly;
|
|
7
|
+
}
|
|
8
|
+
static setDebug(debug) {
|
|
9
|
+
this.logDebug = debug;
|
|
10
|
+
}
|
|
11
|
+
static log(...args) {
|
|
12
|
+
if (!Logger.logErrorsOnly) {
|
|
13
|
+
console.log(...args);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
static error(...args) {
|
|
17
|
+
console.error(...args);
|
|
18
|
+
}
|
|
19
|
+
static debug(...args) {
|
|
20
|
+
if (!Logger.logErrorsOnly && this.logDebug) {
|
|
21
|
+
console.log(...args);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.Logger = Logger;
|
|
26
|
+
Logger.logErrorsOnly = false;
|
|
27
|
+
Logger.logDebug = false;
|
|
28
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":";;;AAAA,MAAa,MAAM;IAIf,MAAM,CAAC,gBAAgB,CAAC,aAAsB;QAC1C,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,KAAc;QAC1B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,GAAG,IAAS;QACnB,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;YACxB,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;QACzB,CAAC;IACL,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAG,IAAS;QACrB,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAG,IAAS;QACrB,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;QACzB,CAAC;IACL,CAAC;;AA1BL,wBA2BC;AA1BkB,oBAAa,GAAG,KAAK,CAAC;AACtB,eAAQ,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
import { VSCodeEmmetConfig } from '@vscode/emmet-helper';
|
|
3
|
+
import { Document } from './lib/documents';
|
|
4
|
+
import { ClientCapabilities } from 'vscode-languageserver-protocol';
|
|
5
|
+
/**
|
|
6
|
+
* Representation of the language server config.
|
|
7
|
+
* Should be kept in sync with infos in `packages/svelte-vscode/package.json`.
|
|
8
|
+
*/
|
|
9
|
+
export interface LSConfig {
|
|
10
|
+
typescript: LSTypescriptConfig;
|
|
11
|
+
css: LSCSSConfig;
|
|
12
|
+
html: LSHTMLConfig;
|
|
13
|
+
svelte: LSSvelteConfig;
|
|
14
|
+
}
|
|
15
|
+
export interface LSTypescriptConfig {
|
|
16
|
+
enable: boolean;
|
|
17
|
+
diagnostics: {
|
|
18
|
+
enable: boolean;
|
|
19
|
+
};
|
|
20
|
+
hover: {
|
|
21
|
+
enable: boolean;
|
|
22
|
+
};
|
|
23
|
+
documentSymbols: {
|
|
24
|
+
enable: boolean;
|
|
25
|
+
};
|
|
26
|
+
completions: {
|
|
27
|
+
enable: boolean;
|
|
28
|
+
};
|
|
29
|
+
codeActions: {
|
|
30
|
+
enable: boolean;
|
|
31
|
+
};
|
|
32
|
+
selectionRange: {
|
|
33
|
+
enable: boolean;
|
|
34
|
+
};
|
|
35
|
+
signatureHelp: {
|
|
36
|
+
enable: boolean;
|
|
37
|
+
};
|
|
38
|
+
semanticTokens: {
|
|
39
|
+
enable: boolean;
|
|
40
|
+
};
|
|
41
|
+
workspaceSymbols: {
|
|
42
|
+
enable: boolean;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface LSCSSConfig {
|
|
46
|
+
enable: boolean;
|
|
47
|
+
globals: string;
|
|
48
|
+
diagnostics: {
|
|
49
|
+
enable: boolean;
|
|
50
|
+
};
|
|
51
|
+
hover: {
|
|
52
|
+
enable: boolean;
|
|
53
|
+
};
|
|
54
|
+
completions: {
|
|
55
|
+
enable: boolean;
|
|
56
|
+
emmet: boolean;
|
|
57
|
+
};
|
|
58
|
+
documentColors: {
|
|
59
|
+
enable: boolean;
|
|
60
|
+
};
|
|
61
|
+
colorPresentations: {
|
|
62
|
+
enable: boolean;
|
|
63
|
+
};
|
|
64
|
+
documentSymbols: {
|
|
65
|
+
enable: boolean;
|
|
66
|
+
};
|
|
67
|
+
selectionRange: {
|
|
68
|
+
enable: boolean;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export interface LSHTMLConfig {
|
|
72
|
+
enable: boolean;
|
|
73
|
+
hover: {
|
|
74
|
+
enable: boolean;
|
|
75
|
+
};
|
|
76
|
+
completions: {
|
|
77
|
+
enable: boolean;
|
|
78
|
+
emmet: boolean;
|
|
79
|
+
};
|
|
80
|
+
tagComplete: {
|
|
81
|
+
enable: boolean;
|
|
82
|
+
};
|
|
83
|
+
documentSymbols: {
|
|
84
|
+
enable: boolean;
|
|
85
|
+
};
|
|
86
|
+
linkedEditing: {
|
|
87
|
+
enable: boolean;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export type CompilerWarningsSettings = Record<string, 'ignore' | 'error'>;
|
|
91
|
+
export interface LSSvelteConfig {
|
|
92
|
+
enable: boolean;
|
|
93
|
+
compilerWarnings: CompilerWarningsSettings;
|
|
94
|
+
diagnostics: {
|
|
95
|
+
enable: boolean;
|
|
96
|
+
};
|
|
97
|
+
format: {
|
|
98
|
+
enable: boolean;
|
|
99
|
+
config: {
|
|
100
|
+
svelteSortOrder: string;
|
|
101
|
+
svelteStrictMode: boolean;
|
|
102
|
+
svelteAllowShorthand: boolean;
|
|
103
|
+
svelteBracketNewLine: boolean;
|
|
104
|
+
svelteIndentScriptAndStyle: boolean;
|
|
105
|
+
printWidth: number;
|
|
106
|
+
singleQuote: boolean;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
rename: {
|
|
110
|
+
enable: boolean;
|
|
111
|
+
};
|
|
112
|
+
completions: {
|
|
113
|
+
enable: boolean;
|
|
114
|
+
};
|
|
115
|
+
hover: {
|
|
116
|
+
enable: boolean;
|
|
117
|
+
};
|
|
118
|
+
codeActions: {
|
|
119
|
+
enable: boolean;
|
|
120
|
+
};
|
|
121
|
+
selectionRange: {
|
|
122
|
+
enable: boolean;
|
|
123
|
+
};
|
|
124
|
+
runesLegacyModeCodeLens: {
|
|
125
|
+
enable: boolean;
|
|
126
|
+
};
|
|
127
|
+
defaultScriptLanguage: 'none' | 'ts';
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* A subset of the JS/TS VS Code settings which
|
|
131
|
+
* are transformed to ts.UserPreferences.
|
|
132
|
+
* It may not be available in other IDEs, that's why the keys are optional.
|
|
133
|
+
*/
|
|
134
|
+
export interface TSUserConfig {
|
|
135
|
+
preferences?: TsUserPreferencesConfig;
|
|
136
|
+
suggest?: TSSuggestConfig;
|
|
137
|
+
format?: TsFormatConfig;
|
|
138
|
+
inlayHints?: TsInlayHintsConfig;
|
|
139
|
+
referencesCodeLens?: TsReferenceCodeLensConfig;
|
|
140
|
+
implementationsCodeLens?: TsImplementationCodeLensConfig;
|
|
141
|
+
workspaceSymbols?: TsWorkspaceSymbolsConfig;
|
|
142
|
+
}
|
|
143
|
+
interface TsJsSharedConfig {
|
|
144
|
+
hover?: {
|
|
145
|
+
maximumLength?: number;
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* A subset of the JS/TS VS Code settings which
|
|
150
|
+
* are transformed to ts.UserPreferences.
|
|
151
|
+
*/
|
|
152
|
+
export interface TsUserPreferencesConfig {
|
|
153
|
+
importModuleSpecifier: ts.UserPreferences['importModuleSpecifierPreference'];
|
|
154
|
+
importModuleSpecifierEnding: ts.UserPreferences['importModuleSpecifierEnding'];
|
|
155
|
+
quoteStyle: ts.UserPreferences['quotePreference'];
|
|
156
|
+
autoImportFileExcludePatterns: ts.UserPreferences['autoImportFileExcludePatterns'];
|
|
157
|
+
/**
|
|
158
|
+
* only in typescript config
|
|
159
|
+
*/
|
|
160
|
+
includePackageJsonAutoImports?: ts.UserPreferences['includePackageJsonAutoImports'];
|
|
161
|
+
preferTypeOnlyAutoImports?: ts.UserPreferences['preferTypeOnlyAutoImports'];
|
|
162
|
+
autoImportSpecifierExcludeRegexes?: string[];
|
|
163
|
+
organizeImports?: TsOrganizeImportPreferencesConfig;
|
|
164
|
+
}
|
|
165
|
+
interface TsOrganizeImportPreferencesConfig {
|
|
166
|
+
accentCollation: ts.UserPreferences['organizeImportsAccentCollation'];
|
|
167
|
+
caseFirst: ts.UserPreferences['organizeImportsCaseFirst'] | 'default';
|
|
168
|
+
caseSensitivity: ts.UserPreferences['organizeImportsIgnoreCase'];
|
|
169
|
+
collation: ts.UserPreferences['organizeImportsCollation'];
|
|
170
|
+
locale: ts.UserPreferences['organizeImportsLocale'];
|
|
171
|
+
numericCollation: ts.UserPreferences['organizeImportsNumericCollation'];
|
|
172
|
+
typeOrder: ts.UserPreferences['organizeImportsTypeOrder'] | 'auto';
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* A subset of the JS/TS VS Code settings which
|
|
176
|
+
* are transformed to ts.UserPreferences.
|
|
177
|
+
*/
|
|
178
|
+
export interface TSSuggestConfig {
|
|
179
|
+
autoImports: ts.UserPreferences['includeCompletionsForModuleExports'];
|
|
180
|
+
includeAutomaticOptionalChainCompletions: boolean | undefined;
|
|
181
|
+
includeCompletionsForImportStatements: boolean | undefined;
|
|
182
|
+
classMemberSnippets: {
|
|
183
|
+
enabled: boolean;
|
|
184
|
+
} | undefined;
|
|
185
|
+
objectLiteralMethodSnippets: {
|
|
186
|
+
enabled: boolean;
|
|
187
|
+
} | undefined;
|
|
188
|
+
includeCompletionsWithSnippetText: boolean | undefined;
|
|
189
|
+
}
|
|
190
|
+
export type TsFormatConfig = Omit<ts.FormatCodeSettings, 'indentMultiLineObjectLiteralBeginningOnBlankLine' | keyof ts.EditorSettings>;
|
|
191
|
+
export interface TsInlayHintsConfig {
|
|
192
|
+
enumMemberValues: {
|
|
193
|
+
enabled: boolean;
|
|
194
|
+
} | undefined;
|
|
195
|
+
functionLikeReturnTypes: {
|
|
196
|
+
enabled: boolean;
|
|
197
|
+
} | undefined;
|
|
198
|
+
parameterNames: {
|
|
199
|
+
enabled: ts.UserPreferences['includeInlayParameterNameHints'];
|
|
200
|
+
suppressWhenArgumentMatchesName: boolean;
|
|
201
|
+
} | undefined;
|
|
202
|
+
parameterTypes: {
|
|
203
|
+
enabled: boolean;
|
|
204
|
+
} | undefined;
|
|
205
|
+
propertyDeclarationTypes: {
|
|
206
|
+
enabled: boolean;
|
|
207
|
+
} | undefined;
|
|
208
|
+
variableTypes: {
|
|
209
|
+
enabled: boolean;
|
|
210
|
+
suppressWhenTypeMatchesName: boolean;
|
|
211
|
+
} | undefined;
|
|
212
|
+
}
|
|
213
|
+
export interface TsReferenceCodeLensConfig {
|
|
214
|
+
showOnAllFunctions?: boolean | undefined;
|
|
215
|
+
enabled: boolean;
|
|
216
|
+
}
|
|
217
|
+
export interface TsImplementationCodeLensConfig {
|
|
218
|
+
enabled: boolean;
|
|
219
|
+
showOnInterfaceMethods?: boolean | undefined;
|
|
220
|
+
}
|
|
221
|
+
export interface TsWorkspaceSymbolsConfig {
|
|
222
|
+
excludeLibrarySymbols?: boolean;
|
|
223
|
+
}
|
|
224
|
+
export type TsUserConfigLang = 'typescript' | 'javascript';
|
|
225
|
+
interface TsUserConfigLangMap {
|
|
226
|
+
typescript?: TSUserConfig;
|
|
227
|
+
javascript?: TSUserConfig;
|
|
228
|
+
'js/ts'?: TsJsSharedConfig;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* The config as the vscode-css-languageservice understands it
|
|
232
|
+
*/
|
|
233
|
+
export interface CssConfig {
|
|
234
|
+
validate?: boolean;
|
|
235
|
+
lint?: any;
|
|
236
|
+
completion?: any;
|
|
237
|
+
hover?: any;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* The config as the vscode-html-languageservice understands it
|
|
241
|
+
*/
|
|
242
|
+
export interface HTMLConfig {
|
|
243
|
+
customData?: string[];
|
|
244
|
+
}
|
|
245
|
+
type DeepPartial<T> = T extends CompilerWarningsSettings ? T : {
|
|
246
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
247
|
+
};
|
|
248
|
+
export declare class LSConfigManager {
|
|
249
|
+
private config;
|
|
250
|
+
private listeners;
|
|
251
|
+
private tsUserPreferences;
|
|
252
|
+
private rawTsUserConfig;
|
|
253
|
+
private resolvedAutoImportExcludeCache;
|
|
254
|
+
private tsFormatCodeOptions;
|
|
255
|
+
private prettierConfig;
|
|
256
|
+
private emmetConfig;
|
|
257
|
+
private cssConfig;
|
|
258
|
+
private scssConfig;
|
|
259
|
+
private lessConfig;
|
|
260
|
+
private htmlConfig;
|
|
261
|
+
private isTrusted;
|
|
262
|
+
private clientCapabilities;
|
|
263
|
+
constructor();
|
|
264
|
+
/**
|
|
265
|
+
* Updates config.
|
|
266
|
+
*/
|
|
267
|
+
update(config: DeepPartial<LSConfig> | undefined): void;
|
|
268
|
+
/**
|
|
269
|
+
* Whether or not specified config is enabled
|
|
270
|
+
* @param key a string which is a path. Example: 'svelte.diagnostics.enable'.
|
|
271
|
+
*/
|
|
272
|
+
enabled(key: string): boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Get specific config
|
|
275
|
+
* @param key a string which is a path. Example: 'svelte.diagnostics.enable'.
|
|
276
|
+
*/
|
|
277
|
+
get<T>(key: string): T;
|
|
278
|
+
/**
|
|
279
|
+
* Get the whole config
|
|
280
|
+
*/
|
|
281
|
+
getConfig(): Readonly<LSConfig>;
|
|
282
|
+
/**
|
|
283
|
+
* Register a listener which is invoked when the config changed.
|
|
284
|
+
*/
|
|
285
|
+
onChange(callback: (config: LSConfigManager) => void): void;
|
|
286
|
+
updateEmmetConfig(config: VSCodeEmmetConfig): void;
|
|
287
|
+
getEmmetConfig(): VSCodeEmmetConfig;
|
|
288
|
+
updatePrettierConfig(config: any): void;
|
|
289
|
+
getPrettierConfig(): any;
|
|
290
|
+
/**
|
|
291
|
+
* Returns a merged Prettier config following these rules:
|
|
292
|
+
* - If `prettierFromFileConfig` exists, that one is returned
|
|
293
|
+
* - Else the Svelte extension's Prettier config is used as a starting point,
|
|
294
|
+
* and overridden by a possible Prettier config from the Prettier extension,
|
|
295
|
+
* or, if that doesn't exist, a possible fallback override.
|
|
296
|
+
*/
|
|
297
|
+
getMergedPrettierConfig(prettierFromFileConfig: any, overridesWhenNoPrettierConfig?: any): any;
|
|
298
|
+
updateTsJsUserPreferences(config: TsUserConfigLangMap): void;
|
|
299
|
+
/**
|
|
300
|
+
* Whether or not the current workspace can be trusted.
|
|
301
|
+
* If not, certain operations should be disabled.
|
|
302
|
+
*/
|
|
303
|
+
getIsTrusted(): boolean;
|
|
304
|
+
updateIsTrusted(isTrusted: boolean): void;
|
|
305
|
+
private _updateTsUserPreferences;
|
|
306
|
+
private withDefaultAsUndefined;
|
|
307
|
+
getTsUserPreferences(lang: TsUserConfigLang, normalizedWorkspacePath: string | null): ts.UserPreferences;
|
|
308
|
+
getClientTsUserConfig(lang: TsUserConfigLang): TSUserConfig;
|
|
309
|
+
updateCssConfig(config: CssConfig | undefined): void;
|
|
310
|
+
getCssConfig(): CssConfig | undefined;
|
|
311
|
+
updateScssConfig(config: CssConfig | undefined): void;
|
|
312
|
+
getScssConfig(): CssConfig | undefined;
|
|
313
|
+
updateLessConfig(config: CssConfig | undefined): void;
|
|
314
|
+
getLessConfig(): CssConfig | undefined;
|
|
315
|
+
updateHTMLConfig(config: HTMLConfig | undefined): void;
|
|
316
|
+
getHTMLConfig(): HTMLConfig | undefined;
|
|
317
|
+
updateTsJsFormateConfig(config: TsUserConfigLangMap): void;
|
|
318
|
+
private getDefaultFormatCodeOptions;
|
|
319
|
+
private _updateTsFormatConfig;
|
|
320
|
+
getFormatCodeSettingsForFile(document: Document, scriptKind: ts.ScriptKind): Promise<ts.FormatCodeSettings>;
|
|
321
|
+
private scheduledUpdate;
|
|
322
|
+
private notifyListeners;
|
|
323
|
+
updateClientCapabilities(clientCapabilities: ClientCapabilities): void;
|
|
324
|
+
getClientCapabilities(): ClientCapabilities | undefined;
|
|
325
|
+
}
|
|
326
|
+
export {};
|