@platformos/platformos-language-server-common 0.0.7 → 0.0.9
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/CHANGELOG.md +20 -0
- package/dist/PropertyShapeInference.d.ts +18 -0
- package/dist/PropertyShapeInference.js +62 -0
- package/dist/PropertyShapeInference.js.map +1 -1
- package/dist/TypeSystem.d.ts +4 -9
- package/dist/TypeSystem.js +246 -390
- package/dist/TypeSystem.js.map +1 -1
- package/dist/codeActions/providers/GenerateDocBlockProvider.d.ts +10 -0
- package/dist/codeActions/providers/GenerateDocBlockProvider.js +39 -0
- package/dist/codeActions/providers/GenerateDocBlockProvider.js.map +1 -0
- package/dist/commands/providers/GenerateDocBlockCommandProvider.d.ts +19 -0
- package/dist/commands/providers/GenerateDocBlockCommandProvider.js +64 -0
- package/dist/commands/providers/GenerateDocBlockCommandProvider.js.map +1 -0
- package/dist/completions/CompletionsProvider.d.ts +6 -10
- package/dist/completions/CompletionsProvider.js +6 -9
- package/dist/completions/CompletionsProvider.js.map +1 -1
- package/dist/completions/params/LiquidCompletionParams.js +6 -17
- package/dist/completions/params/LiquidCompletionParams.js.map +1 -1
- package/dist/completions/providers/ContentForCompletionProvider.js +2 -4
- package/dist/completions/providers/ContentForCompletionProvider.js.map +1 -1
- package/dist/completions/providers/FilterNamedParameterCompletionProvider.d.ts +3 -3
- package/dist/completions/providers/FilterNamedParameterCompletionProvider.js +6 -6
- package/dist/completions/providers/FilterNamedParameterCompletionProvider.js.map +1 -1
- package/dist/completions/providers/LiquidDocParamTypeCompletionProvider.d.ts +3 -3
- package/dist/completions/providers/LiquidDocParamTypeCompletionProvider.js +3 -3
- package/dist/completions/providers/LiquidDocParamTypeCompletionProvider.js.map +1 -1
- package/dist/completions/providers/LiquidTagsCompletionProvider.d.ts +3 -3
- package/dist/completions/providers/LiquidTagsCompletionProvider.js +3 -3
- package/dist/completions/providers/LiquidTagsCompletionProvider.js.map +1 -1
- package/dist/completions/providers/RenderPartialParameterCompletionProvider.js +1 -1
- package/dist/completions/providers/RenderPartialParameterCompletionProvider.js.map +1 -1
- package/dist/completions/providers/index.d.ts +0 -3
- package/dist/completions/providers/index.js +1 -7
- package/dist/completions/providers/index.js.map +1 -1
- package/dist/css/CSSLanguageService.d.ts +19 -5
- package/dist/css/CSSLanguageService.js +77 -63
- package/dist/css/CSSLanguageService.js.map +1 -1
- package/dist/definitions/DefinitionProvider.d.ts +1 -1
- package/dist/definitions/DefinitionProvider.js +1 -3
- package/dist/definitions/DefinitionProvider.js.map +1 -1
- package/dist/diagnostics/offenseToDiagnostic.js +1 -1
- package/dist/diagnostics/offenseToDiagnostic.js.map +1 -1
- package/dist/diagnostics/runChecks.d.ts +3 -5
- package/dist/diagnostics/runChecks.js +12 -64
- package/dist/diagnostics/runChecks.js.map +1 -1
- package/dist/docset/MarkdownRenderer.js +1 -1
- package/dist/docset/MarkdownRenderer.js.map +1 -1
- package/dist/documentLinks/DocumentLinksProvider.d.ts +3 -3
- package/dist/documentLinks/DocumentLinksProvider.js +3 -3
- package/dist/documentLinks/DocumentLinksProvider.js.map +1 -1
- package/dist/documents/DocumentManager.d.ts +4 -5
- package/dist/documents/DocumentManager.js +17 -12
- package/dist/documents/DocumentManager.js.map +1 -1
- package/dist/documents/types.d.ts +16 -3
- package/dist/documents/types.js +3 -3
- package/dist/documents/types.js.map +1 -1
- package/dist/hover/HoverProvider.d.ts +5 -8
- package/dist/hover/HoverProvider.js +8 -14
- package/dist/hover/HoverProvider.js.map +1 -1
- package/dist/hover/providers/LiquidFilterArgumentHoverProvider.d.ts +3 -3
- package/dist/hover/providers/LiquidFilterArgumentHoverProvider.js +3 -3
- package/dist/hover/providers/LiquidFilterArgumentHoverProvider.js.map +1 -1
- package/dist/hover/providers/LiquidFilterHoverProvider.d.ts +3 -3
- package/dist/hover/providers/LiquidFilterHoverProvider.js +3 -3
- package/dist/hover/providers/LiquidFilterHoverProvider.js.map +1 -1
- package/dist/hover/providers/LiquidTagHoverProvider.d.ts +3 -3
- package/dist/hover/providers/LiquidTagHoverProvider.js +3 -3
- package/dist/hover/providers/LiquidTagHoverProvider.js.map +1 -1
- package/dist/hover/providers/RenderPartialHoverProvider.js +1 -1
- package/dist/hover/providers/RenderPartialHoverProvider.js.map +1 -1
- package/dist/hover/providers/RenderPartialParameterHoverProvider.js +1 -1
- package/dist/hover/providers/RenderPartialParameterHoverProvider.js.map +1 -1
- package/dist/hover/providers/TranslationHoverProvider.d.ts +3 -3
- package/dist/hover/providers/TranslationHoverProvider.js +3 -3
- package/dist/hover/providers/TranslationHoverProvider.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal-types.d.ts +1 -1
- package/dist/json/JSONContributions.d.ts +1 -5
- package/dist/json/JSONContributions.js +4 -36
- package/dist/json/JSONContributions.js.map +1 -1
- package/dist/json/JSONLanguageService.d.ts +4 -12
- package/dist/json/JSONLanguageService.js +17 -80
- package/dist/json/JSONLanguageService.js.map +1 -1
- package/dist/json/test/test-helpers.d.ts +1 -3
- package/dist/json/test/test-helpers.js +3 -19
- package/dist/json/test/test-helpers.js.map +1 -1
- package/dist/json/utils.d.ts +0 -5
- package/dist/json/utils.js +0 -24
- package/dist/json/utils.js.map +1 -1
- package/dist/rename/RenameProvider.d.ts +2 -2
- package/dist/rename/RenameProvider.js +2 -2
- package/dist/rename/RenameProvider.js.map +1 -1
- package/dist/rename/providers/LiquidVariableRenameProvider.d.ts +3 -3
- package/dist/rename/providers/LiquidVariableRenameProvider.js +4 -4
- package/dist/rename/providers/LiquidVariableRenameProvider.js.map +1 -1
- package/dist/renamed/RenameHandler.d.ts +2 -3
- package/dist/renamed/RenameHandler.js +3 -8
- package/dist/renamed/RenameHandler.js.map +1 -1
- package/dist/renamed/handlers/AssetRenameHandler.d.ts +3 -3
- package/dist/renamed/handlers/AssetRenameHandler.js +5 -5
- package/dist/renamed/handlers/AssetRenameHandler.js.map +1 -1
- package/dist/renamed/handlers/PartialRenameHandler.d.ts +3 -3
- package/dist/renamed/handlers/PartialRenameHandler.js +5 -5
- package/dist/renamed/handlers/PartialRenameHandler.js.map +1 -1
- package/dist/renamed/handlers/utils.d.ts +1 -1
- package/dist/server/AppGraphManager.d.ts +32 -0
- package/dist/server/AppGraphManager.js +155 -0
- package/dist/server/AppGraphManager.js.map +1 -0
- package/dist/server/startServer.d.ts +2 -2
- package/dist/server/startServer.js +62 -164
- package/dist/server/startServer.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +33 -54
- package/dist/types.js +21 -26
- package/dist/types.js.map +1 -1
- package/dist/utils/liquidDoc.js +1 -1
- package/dist/utils/liquidDoc.js.map +1 -1
- package/dist/utils/uri.d.ts +2 -9
- package/dist/utils/uri.js +5 -21
- package/dist/utils/uri.js.map +1 -1
- package/package.json +4 -4
- package/src/ClientCapabilities.ts +1 -1
- package/src/PropertyShapeInference.ts +81 -1
- package/src/TypeSystem.spec.ts +206 -449
- package/src/TypeSystem.ts +267 -460
- package/src/codeActions/providers/FixAllProvider.spec.ts +1 -1
- package/src/codeActions/providers/FixProvider.spec.ts +11 -11
- package/src/codeActions/providers/SuggestionProvider.spec.ts +2 -2
- package/src/commands/providers/ApplyFixesProvider.ts +2 -2
- package/src/commands/providers/ApplySuggestionProvider.ts +2 -2
- package/src/commands/providers/RunChecksProvider.ts +2 -2
- package/src/completions/CompletionsProvider.ts +14 -35
- package/src/completions/params/LiquidCompletionParams.spec.ts +0 -9
- package/src/completions/params/LiquidCompletionParams.ts +8 -17
- package/src/completions/params/fix.spec.ts +0 -3
- package/src/completions/providers/FilterCompletionProvider.spec.ts +2 -8
- package/src/completions/providers/FilterNamedParameterCompletionProvider.spec.ts +1 -5
- package/src/completions/providers/FilterNamedParameterCompletionProvider.ts +6 -6
- package/src/completions/providers/HtmlAttributeCompletionProvider.spec.ts +1 -4
- package/src/completions/providers/HtmlAttributeValueCompletionProvider.spec.ts +1 -4
- package/src/completions/providers/HtmlTagCompletionProvider.spec.ts +1 -4
- package/src/completions/providers/LiquidDocParamTypeCompletionProvider.spec.ts +1 -28
- package/src/completions/providers/LiquidDocParamTypeCompletionProvider.ts +3 -3
- package/src/completions/providers/LiquidDocTagCompletionProvider.spec.ts +1 -26
- package/src/completions/providers/LiquidTagsCompletionProvider.spec.ts +4 -18
- package/src/completions/providers/LiquidTagsCompletionProvider.ts +3 -3
- package/src/completions/providers/ObjectAttributeCompletionProvider.spec.ts +2 -31
- package/src/completions/providers/ObjectCompletionProvider.spec.ts +34 -123
- package/src/completions/providers/PartialCompletionProvider.spec.ts +6 -15
- package/src/completions/providers/RenderPartialParameterCompletionProvider.spec.ts +13 -15
- package/src/completions/providers/RenderPartialParameterCompletionProvider.ts +2 -3
- package/src/completions/providers/TranslationCompletionProvider.spec.ts +1 -4
- package/src/completions/providers/TranslationCompletionProvider.ts +3 -3
- package/src/completions/providers/index.ts +0 -3
- package/src/css/CSSLanguageService.ts +97 -81
- package/src/definitions/DefinitionProvider.ts +0 -6
- package/src/definitions/providers/TranslationStringDefinitionProvider.spec.ts +1 -5
- package/src/diagnostics/offenseToDiagnostic.ts +1 -1
- package/src/diagnostics/runChecks.spec.ts +22 -30
- package/src/diagnostics/runChecks.ts +17 -91
- package/src/docset/MarkdownRenderer.ts +1 -1
- package/src/documentLinks/DocumentLinksProvider.ts +10 -10
- package/src/documents/DocumentManager.spec.ts +46 -119
- package/src/documents/DocumentManager.ts +19 -15
- package/src/documents/types.ts +18 -9
- package/src/hover/HoverProvider.ts +9 -21
- package/src/hover/providers/HtmlAttributeHoverProvider.spec.ts +1 -3
- package/src/hover/providers/HtmlAttributeValueHoverProvider.spec.ts +1 -3
- package/src/hover/providers/HtmlTagHoverProvider.spec.ts +1 -3
- package/src/hover/providers/LiquidDocTagHoverProvider.spec.ts +1 -4
- package/src/hover/providers/LiquidFilterArgumentHoverProvider.spec.ts +0 -3
- package/src/hover/providers/LiquidFilterArgumentHoverProvider.ts +3 -3
- package/src/hover/providers/LiquidFilterHoverProvider.spec.ts +0 -3
- package/src/hover/providers/LiquidFilterHoverProvider.ts +3 -3
- package/src/hover/providers/LiquidObjectAttributeHoverProvider.spec.ts +1 -3
- package/src/hover/providers/LiquidObjectHoverProvider.spec.ts +46 -129
- package/src/hover/providers/LiquidTagHoverProvider.spec.ts +0 -3
- package/src/hover/providers/LiquidTagHoverProvider.ts +3 -3
- package/src/hover/providers/RenderPartialHoverProvider.spec.ts +11 -14
- package/src/hover/providers/RenderPartialHoverProvider.ts +1 -5
- package/src/hover/providers/RenderPartialParameterHoverProvider.spec.ts +10 -13
- package/src/hover/providers/RenderPartialParameterHoverProvider.ts +2 -3
- package/src/hover/providers/TranslationHoverProvider.spec.ts +1 -4
- package/src/hover/providers/TranslationHoverProvider.ts +3 -3
- package/src/index.ts +4 -7
- package/src/internal-types.ts +1 -1
- package/src/json/JSONContributions.ts +4 -61
- package/src/json/JSONLanguageService.ts +19 -117
- package/src/json/test/test-helpers.ts +4 -35
- package/src/json/utils.ts +0 -27
- package/src/rename/RenameProvider.ts +4 -4
- package/src/rename/providers/LiquidVariableRenameProvider.spec.ts +5 -5
- package/src/rename/providers/LiquidVariableRenameProvider.ts +6 -6
- package/src/renamed/RenameHandler.ts +4 -9
- package/src/renamed/handlers/AssetRenameHandler.spec.ts +28 -28
- package/src/renamed/handlers/AssetRenameHandler.ts +6 -6
- package/src/renamed/handlers/PartialRenameHandler.spec.ts +9 -9
- package/src/renamed/handlers/PartialRenameHandler.ts +10 -10
- package/src/server/{ThemeGraphManager.ts → AppGraphManager.ts} +21 -90
- package/src/server/safe.ts +1 -1
- package/src/server/startServer.spec.ts +10 -12
- package/src/server/startServer.ts +69 -222
- package/src/test/CompletionItemsAssertion.spec.ts +1 -4
- package/src/types.ts +33 -63
- package/src/utils/debounce.ts +1 -1
- package/src/utils/liquidDoc.ts +6 -6
- package/src/utils/uri.ts +5 -17
- package/src/completions/providers/ContentForBlockTypeCompletionProvider.spec.ts +0 -41
- package/src/completions/providers/ContentForBlockTypeCompletionProvider.ts +0 -42
- package/src/completions/providers/ContentForCompletionProvider.spec.ts +0 -96
- package/src/completions/providers/ContentForCompletionProvider.ts +0 -113
- package/src/completions/providers/ContentForParameterCompletionProvider.spec.ts +0 -362
- package/src/completions/providers/ContentForParameterCompletionProvider.ts +0 -187
- package/src/completions/providers/data/contentForParameterCompletionOptions.ts +0 -9
- package/src/css/CSSLanguageService.spec.ts +0 -159
- package/src/css/test/test-helpers.ts +0 -30
- package/src/definitions/providers/SchemaTranslationStringDefinitionProvider.spec.ts +0 -96
- package/src/definitions/providers/SchemaTranslationStringDefinitionProvider.ts +0 -82
- package/src/hover/providers/ContentForArgumentHoverProvider.spec.ts +0 -76
- package/src/hover/providers/ContentForArgumentHoverProvider.ts +0 -56
- package/src/hover/providers/ContentForTypeHoverProvider.spec.ts +0 -91
- package/src/hover/providers/ContentForTypeHoverProvider.ts +0 -42
- package/src/json/JSONLanguageService.spec.ts +0 -424
- package/src/json/completions/providers/BlockSettingsPropertyCompletionProvider.spec.ts +0 -163
- package/src/json/completions/providers/BlockSettingsPropertyCompletionProvider.ts +0 -121
- package/src/json/completions/providers/BlockTypeCompletionProvider.spec.ts +0 -137
- package/src/json/completions/providers/BlockTypeCompletionProvider.ts +0 -108
- package/src/json/completions/providers/ReferencedBlockTypeCompletionProvider.spec.ts +0 -132
- package/src/json/completions/providers/ReferencedBlockTypeCompletionProvider.ts +0 -120
- package/src/json/completions/providers/SchemaTranslationCompletionProvider.ts +0 -51
- package/src/json/completions/providers/SettingsPropertyCompletionProvider.spec.ts +0 -211
- package/src/json/completions/providers/SettingsPropertyCompletionProvider.ts +0 -75
- package/src/json/documentLinks/DocumentLinksProvider.spec.ts +0 -223
- package/src/json/documentLinks/DocumentLinksProvider.ts +0 -61
- package/src/json/hover/providers/BlockSettingsHoverProvider.spec.ts +0 -292
- package/src/json/hover/providers/BlockSettingsHoverProvider.ts +0 -99
- package/src/json/hover/providers/SchemaTranslationHoverProvider.ts +0 -35
- package/src/json/hover/providers/SettingsHoverProvider.spec.ts +0 -139
- package/src/json/hover/providers/SettingsHoverProvider.ts +0 -79
- package/src/json/schemaSettings.spec.ts +0 -103
- package/src/json/schemaSettings.ts +0 -53
- package/src/plugins/css.ts +0 -12
- package/src/renamed/handlers/BlockRenameHandler.spec.ts +0 -399
- package/src/renamed/handlers/BlockRenameHandler.ts +0 -402
- package/src/renamed/handlers/SectionRenameHandler.spec.ts +0 -321
- package/src/renamed/handlers/SectionRenameHandler.ts +0 -224
- package/src/renamed/handlers/utils.ts +0 -22
- package/src/settings/index.ts +0 -50
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AppBlockSchema,
|
|
3
|
-
parseJSON,
|
|
4
|
-
SectionSchema,
|
|
5
|
-
SourceCodeType,
|
|
6
|
-
ThemeBlockSchema,
|
|
7
|
-
} from '@platformos/platformos-check-common';
|
|
8
1
|
import {
|
|
9
2
|
CompletionsCollector,
|
|
10
3
|
JSONPath,
|
|
@@ -12,30 +5,14 @@ import {
|
|
|
12
5
|
MarkedString,
|
|
13
6
|
} from 'vscode-json-languageservice';
|
|
14
7
|
import { AugmentedSourceCode, DocumentManager } from '../documents';
|
|
15
|
-
import { GetTranslationsForURI } from '../translations';
|
|
16
8
|
import { JSONCompletionProvider } from './completions/JSONCompletionProvider';
|
|
17
|
-
import { BlockTypeCompletionProvider } from './completions/providers/BlockTypeCompletionProvider';
|
|
18
|
-
import { ReferencedBlockTypeCompletionProvider } from './completions/providers/ReferencedBlockTypeCompletionProvider';
|
|
19
|
-
import { SchemaTranslationsCompletionProvider } from './completions/providers/SchemaTranslationCompletionProvider';
|
|
20
9
|
import { JSONHoverProvider } from './hover/JSONHoverProvider';
|
|
21
|
-
import { SchemaTranslationHoverProvider } from './hover/providers/SchemaTranslationHoverProvider';
|
|
22
10
|
import { TranslationPathHoverProvider } from './hover/providers/TranslationPathHoverProvider';
|
|
23
11
|
import { RequestContext } from './RequestContext';
|
|
24
|
-
import { findSchemaNode } from './utils';
|
|
25
|
-
import { SettingsPropertyCompletionProvider } from './completions/providers/SettingsPropertyCompletionProvider';
|
|
26
|
-
import { SettingsHoverProvider } from './hover/providers/SettingsHoverProvider';
|
|
27
|
-
import { BlockSettingsPropertyCompletionProvider } from './completions/providers/BlockSettingsPropertyCompletionProvider';
|
|
28
|
-
import { BlockSettingsHoverProvider } from './hover/providers/BlockSettingsHoverProvider';
|
|
29
12
|
|
|
30
13
|
/** The getInfoContribution API will only fallback if we return undefined synchronously */
|
|
31
14
|
const SKIP_CONTRIBUTION = undefined as any;
|
|
32
15
|
|
|
33
|
-
export type GetThemeBlockSchema = (
|
|
34
|
-
uri: string,
|
|
35
|
-
name: string,
|
|
36
|
-
) => Promise<SectionSchema | ThemeBlockSchema | AppBlockSchema | undefined>;
|
|
37
|
-
export type GetThemeBlockNames = (uri: string, includePrivate: boolean) => Promise<string[]>;
|
|
38
|
-
|
|
39
16
|
/**
|
|
40
17
|
* I'm not a fan of how json-languageservice does its feature contributions. It's too different
|
|
41
18
|
* from everything else we do in here.
|
|
@@ -47,28 +24,9 @@ export class JSONContributions implements JSONWorkerContribution {
|
|
|
47
24
|
private hoverProviders: JSONHoverProvider[];
|
|
48
25
|
private completionProviders: JSONCompletionProvider[];
|
|
49
26
|
|
|
50
|
-
constructor(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
getThemeBlockNames: GetThemeBlockNames,
|
|
54
|
-
getThemeBlockSchema: GetThemeBlockSchema,
|
|
55
|
-
) {
|
|
56
|
-
this.hoverProviders = [
|
|
57
|
-
new TranslationPathHoverProvider(),
|
|
58
|
-
new SchemaTranslationHoverProvider(getDefaultSchemaTranslations),
|
|
59
|
-
new SettingsHoverProvider(getDefaultSchemaTranslations),
|
|
60
|
-
new BlockSettingsHoverProvider(getDefaultSchemaTranslations, getThemeBlockSchema),
|
|
61
|
-
];
|
|
62
|
-
this.completionProviders = [
|
|
63
|
-
new SchemaTranslationsCompletionProvider(getDefaultSchemaTranslations),
|
|
64
|
-
new BlockTypeCompletionProvider(getThemeBlockNames),
|
|
65
|
-
new ReferencedBlockTypeCompletionProvider(getThemeBlockNames, getThemeBlockSchema),
|
|
66
|
-
new BlockSettingsPropertyCompletionProvider(
|
|
67
|
-
getDefaultSchemaTranslations,
|
|
68
|
-
getThemeBlockSchema,
|
|
69
|
-
),
|
|
70
|
-
new SettingsPropertyCompletionProvider(getDefaultSchemaTranslations),
|
|
71
|
-
];
|
|
27
|
+
constructor(private documentManager: DocumentManager) {
|
|
28
|
+
this.hoverProviders = [new TranslationPathHoverProvider()];
|
|
29
|
+
this.completionProviders = [];
|
|
72
30
|
}
|
|
73
31
|
|
|
74
32
|
async getInfoContribution(uri: string, location: JSONPath): Promise<MarkedString[]> {
|
|
@@ -130,21 +88,6 @@ export class JSONContributions implements JSONWorkerContribution {
|
|
|
130
88
|
async collectDefaultCompletions(_uri: string, _result: CompletionsCollector): Promise<void> {}
|
|
131
89
|
|
|
132
90
|
private async getContext(doc: AugmentedSourceCode): Promise<RequestContext> {
|
|
133
|
-
|
|
134
|
-
doc,
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
if (doc.type === SourceCodeType.LiquidHtml && !(doc.ast instanceof Error)) {
|
|
138
|
-
const schema = await findSchemaNode(doc.ast);
|
|
139
|
-
if (!schema) return SKIP_CONTRIBUTION;
|
|
140
|
-
const jsonString = schema?.source.slice(
|
|
141
|
-
schema.blockStartPosition.end,
|
|
142
|
-
schema.blockEndPosition.start,
|
|
143
|
-
);
|
|
144
|
-
context.schema = schema;
|
|
145
|
-
context.parsed = parseJSON(jsonString);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return context;
|
|
91
|
+
return { doc };
|
|
149
92
|
}
|
|
150
93
|
}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import { LiquidRawTag, NodeTypes } from '@platformos/liquid-html-parser';
|
|
2
1
|
import {
|
|
3
2
|
IsValidSchema,
|
|
4
3
|
JsonValidationSet,
|
|
5
|
-
Mode,
|
|
6
|
-
Modes,
|
|
7
4
|
SchemaDefinition,
|
|
8
5
|
SourceCodeType,
|
|
9
|
-
findCurrentNode,
|
|
10
6
|
isValid,
|
|
11
|
-
toJSONAST,
|
|
12
|
-
visit,
|
|
13
7
|
} from '@platformos/platformos-check-common';
|
|
14
8
|
import { JSONDocument, LanguageService, getLanguageService } from 'vscode-json-languageservice';
|
|
15
9
|
import {
|
|
@@ -24,21 +18,12 @@ import {
|
|
|
24
18
|
} from 'vscode-languageserver';
|
|
25
19
|
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
26
20
|
import { DocumentManager } from '../documents';
|
|
27
|
-
import {
|
|
28
|
-
import { JSONContributions, GetThemeBlockNames, GetThemeBlockSchema } from './JSONContributions';
|
|
29
|
-
import { createJSONDocumentLinksVisitor } from './documentLinks/DocumentLinksProvider';
|
|
30
|
-
import { URI } from 'vscode-uri';
|
|
31
|
-
import { FindThemeRootURI } from '../internal-types';
|
|
21
|
+
import { JSONContributions } from './JSONContributions';
|
|
32
22
|
|
|
33
23
|
export class JSONLanguageService {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
// we need to do this switch on mode here to figure out which language service we will use to power
|
|
38
|
-
// completions/hover. The mode comes from the theme check config.
|
|
39
|
-
private services: Record<Mode, LanguageService | null>;
|
|
40
|
-
|
|
41
|
-
// One record for all modes since collisions on URIs should point to the same schema
|
|
24
|
+
private service: LanguageService | null = null;
|
|
25
|
+
|
|
26
|
+
// One record for all schemas since collisions on URIs should point to the same schema
|
|
42
27
|
private schemas: Record<string, SchemaDefinition>;
|
|
43
28
|
|
|
44
29
|
// Setup state
|
|
@@ -48,13 +33,7 @@ export class JSONLanguageService {
|
|
|
48
33
|
constructor(
|
|
49
34
|
private documentManager: DocumentManager,
|
|
50
35
|
private jsonValidationSet: JsonValidationSet,
|
|
51
|
-
private getDefaultSchemaTranslations: GetTranslationsForURI,
|
|
52
|
-
private getModeForURI: (uri: string) => Promise<Mode>,
|
|
53
|
-
private getThemeBlockNames: GetThemeBlockNames,
|
|
54
|
-
private getThemeBlockSchema: GetThemeBlockSchema,
|
|
55
|
-
private findThemeRootURI: FindThemeRootURI,
|
|
56
36
|
) {
|
|
57
|
-
this.services = Object.fromEntries(Modes.map((mode) => [mode, null])) as typeof this.services;
|
|
58
37
|
this.schemas = {};
|
|
59
38
|
this.initialized = new Promise((resolve) => {
|
|
60
39
|
this.initialize = resolve;
|
|
@@ -62,14 +41,12 @@ export class JSONLanguageService {
|
|
|
62
41
|
}
|
|
63
42
|
|
|
64
43
|
async setup(clientCapabilities: LSPClientCapabilities) {
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (!schemas.length) return;
|
|
44
|
+
const schemas = await this.jsonValidationSet.schemas();
|
|
45
|
+
for (const schema of schemas) {
|
|
46
|
+
this.schemas[schema.uri] = schema;
|
|
47
|
+
}
|
|
72
48
|
|
|
49
|
+
if (schemas.length) {
|
|
73
50
|
const service = getLanguageService({
|
|
74
51
|
clientCapabilities,
|
|
75
52
|
|
|
@@ -86,14 +63,7 @@ export class JSONLanguageService {
|
|
|
86
63
|
},
|
|
87
64
|
},
|
|
88
65
|
|
|
89
|
-
contributions: [
|
|
90
|
-
new JSONContributions(
|
|
91
|
-
this.documentManager,
|
|
92
|
-
this.getDefaultSchemaTranslations,
|
|
93
|
-
this.getThemeBlockNames,
|
|
94
|
-
this.getThemeBlockSchema,
|
|
95
|
-
),
|
|
96
|
-
],
|
|
66
|
+
contributions: [new JSONContributions(this.documentManager)],
|
|
97
67
|
});
|
|
98
68
|
|
|
99
69
|
service.configure({
|
|
@@ -106,17 +76,15 @@ export class JSONLanguageService {
|
|
|
106
76
|
})),
|
|
107
77
|
});
|
|
108
78
|
|
|
109
|
-
this.
|
|
110
|
-
}
|
|
79
|
+
this.service = service;
|
|
80
|
+
}
|
|
111
81
|
|
|
112
|
-
await Promise.all(promises);
|
|
113
82
|
this.initialize();
|
|
114
83
|
}
|
|
115
84
|
|
|
116
85
|
async completions(params: CompletionParams): Promise<null | CompletionList | CompletionItem[]> {
|
|
117
86
|
await this.initialized;
|
|
118
|
-
const
|
|
119
|
-
const service = this.services[mode];
|
|
87
|
+
const service = this.service;
|
|
120
88
|
if (!service) return null;
|
|
121
89
|
const documents = this.getDocuments(params, service);
|
|
122
90
|
if (!documents) return null;
|
|
@@ -126,8 +94,7 @@ export class JSONLanguageService {
|
|
|
126
94
|
|
|
127
95
|
async hover(params: HoverParams): Promise<Hover | null> {
|
|
128
96
|
await this.initialized;
|
|
129
|
-
const
|
|
130
|
-
const service = this.services[mode];
|
|
97
|
+
const service = this.service;
|
|
131
98
|
if (!service) return null;
|
|
132
99
|
const documents = this.getDocuments(params, service);
|
|
133
100
|
if (!documents) return null;
|
|
@@ -135,52 +102,13 @@ export class JSONLanguageService {
|
|
|
135
102
|
return service.doHover(jsonTextDocument, params.position, jsonDocument);
|
|
136
103
|
}
|
|
137
104
|
|
|
138
|
-
async documentLinks(
|
|
139
|
-
|
|
140
|
-
const rootUri = await this.findThemeRootURI(params.textDocument.uri);
|
|
141
|
-
if (!rootUri) return [];
|
|
142
|
-
|
|
143
|
-
const document = this.documentManager.get(params.textDocument.uri);
|
|
144
|
-
if (!document) return [];
|
|
145
|
-
|
|
146
|
-
switch (document.type) {
|
|
147
|
-
case SourceCodeType.JSON: {
|
|
148
|
-
if (document.ast instanceof Error) return [];
|
|
149
|
-
const visitor = await createJSONDocumentLinksVisitor(
|
|
150
|
-
document.textDocument,
|
|
151
|
-
URI.parse(rootUri),
|
|
152
|
-
);
|
|
153
|
-
return visit(document.ast, visitor);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
case SourceCodeType.LiquidHtml: {
|
|
157
|
-
if (document.ast instanceof Error) return [];
|
|
158
|
-
const textDocument = document.textDocument;
|
|
159
|
-
const links: DocumentLink[] = [];
|
|
160
|
-
|
|
161
|
-
const schema = await document.getSchema();
|
|
162
|
-
if (schema && !(schema.ast instanceof Error)) {
|
|
163
|
-
const visitor = await createJSONDocumentLinksVisitor(
|
|
164
|
-
textDocument,
|
|
165
|
-
URI.parse(rootUri),
|
|
166
|
-
schema.offset,
|
|
167
|
-
);
|
|
168
|
-
const schemaLinks = await visit(schema.ast, visitor);
|
|
169
|
-
links.push(...schemaLinks);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return links;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
default:
|
|
176
|
-
return [];
|
|
177
|
-
}
|
|
105
|
+
async documentLinks(_params: DocumentLinkParams): Promise<DocumentLink[]> {
|
|
106
|
+
return [];
|
|
178
107
|
}
|
|
179
108
|
|
|
180
109
|
public isValidSchema = async (uri: string, jsonString: string) => {
|
|
181
110
|
await this.initialized;
|
|
182
|
-
const
|
|
183
|
-
const service = this.services[mode];
|
|
111
|
+
const service = this.service;
|
|
184
112
|
if (!service) return false;
|
|
185
113
|
return isValid(service, uri, jsonString);
|
|
186
114
|
};
|
|
@@ -194,40 +122,14 @@ export class JSONLanguageService {
|
|
|
194
122
|
|
|
195
123
|
switch (document.type) {
|
|
196
124
|
case SourceCodeType.GraphQL:
|
|
125
|
+
case SourceCodeType.LiquidHtml:
|
|
126
|
+
case SourceCodeType.YAML:
|
|
197
127
|
return null;
|
|
198
128
|
case SourceCodeType.JSON: {
|
|
199
129
|
const jsonTextDocument = document.textDocument;
|
|
200
130
|
const jsonDocument = service.parseJSONDocument(jsonTextDocument);
|
|
201
131
|
return [jsonTextDocument, jsonDocument];
|
|
202
132
|
}
|
|
203
|
-
|
|
204
|
-
case SourceCodeType.LiquidHtml: {
|
|
205
|
-
if (document.ast instanceof Error) return null;
|
|
206
|
-
const textDocument = document.textDocument;
|
|
207
|
-
const offset = textDocument.offsetAt(params.position);
|
|
208
|
-
const [_, ancestors] = findCurrentNode(document.ast, offset);
|
|
209
|
-
const schema = ancestors.find(
|
|
210
|
-
(node): node is LiquidRawTag =>
|
|
211
|
-
node.type === NodeTypes.LiquidRawTag && node.name === 'schema',
|
|
212
|
-
);
|
|
213
|
-
if (!schema) return null;
|
|
214
|
-
|
|
215
|
-
const schemaLineNumber = textDocument.positionAt(schema.blockStartPosition.end).line;
|
|
216
|
-
// Hacking away "same line numbers" here by prefixing the file with newlines
|
|
217
|
-
// This way params.position will be at the same line number in this fake jsonTextDocument
|
|
218
|
-
// Which means that the completions will be at the same line number in the Liquid document
|
|
219
|
-
const jsonString =
|
|
220
|
-
Array(schemaLineNumber).fill('\n').join('') +
|
|
221
|
-
schema.source.slice(schema.blockStartPosition.end, schema.blockEndPosition.start);
|
|
222
|
-
const jsonTextDocument = TextDocument.create(
|
|
223
|
-
textDocument.uri,
|
|
224
|
-
'json',
|
|
225
|
-
textDocument.version,
|
|
226
|
-
jsonString,
|
|
227
|
-
);
|
|
228
|
-
const jsonDocument = service.parseJSONDocument(jsonTextDocument);
|
|
229
|
-
return [jsonTextDocument, jsonDocument];
|
|
230
|
-
}
|
|
231
133
|
}
|
|
232
134
|
}
|
|
233
135
|
|
|
@@ -5,10 +5,7 @@ import {
|
|
|
5
5
|
HoverParams,
|
|
6
6
|
} from 'vscode-languageserver-protocol';
|
|
7
7
|
import { DocumentManager } from '../../documents';
|
|
8
|
-
import { GetThemeBlockNames } from '../JSONContributions';
|
|
9
8
|
import { JSONLanguageService } from '../JSONLanguageService';
|
|
10
|
-
import { SourceCodeType } from '@platformos/platformos-check-common';
|
|
11
|
-
import { GetTranslationsForURI } from '../../translations';
|
|
12
9
|
|
|
13
10
|
export function getRequestParams(
|
|
14
11
|
documentManager: DocumentManager,
|
|
@@ -33,36 +30,8 @@ export function isCompletionList(
|
|
|
33
30
|
return completions !== null && !Array.isArray(completions);
|
|
34
31
|
}
|
|
35
32
|
|
|
36
|
-
export function mockJSONLanguageService(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
getThemeBlockNames: GetThemeBlockNames = async () => [],
|
|
41
|
-
) {
|
|
42
|
-
return new JSONLanguageService(
|
|
43
|
-
documentManager,
|
|
44
|
-
{
|
|
45
|
-
schemas: async () => [
|
|
46
|
-
{
|
|
47
|
-
uri: 'https://shopify.dev/block-schema.json',
|
|
48
|
-
schema: JSON.stringify({
|
|
49
|
-
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
50
|
-
}),
|
|
51
|
-
fileMatch: ['**/{blocks,sections}/*.liquid'],
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
getDefaultSchemaTranslations,
|
|
56
|
-
async () => 'theme',
|
|
57
|
-
getThemeBlockNames,
|
|
58
|
-
async (_uri: string, name: string) => {
|
|
59
|
-
const blockUri = `${rootUri}/blocks/${name}.liquid`;
|
|
60
|
-
const doc = documentManager.get(blockUri);
|
|
61
|
-
if (!doc || doc.type !== SourceCodeType.LiquidHtml) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
return doc.getSchema();
|
|
65
|
-
},
|
|
66
|
-
async () => rootUri,
|
|
67
|
-
);
|
|
33
|
+
export function mockJSONLanguageService(_rootUri: string, documentManager: DocumentManager) {
|
|
34
|
+
return new JSONLanguageService(documentManager, {
|
|
35
|
+
schemas: async () => [],
|
|
36
|
+
});
|
|
68
37
|
}
|
package/src/json/utils.ts
CHANGED
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
import { LiquidHtmlNode, LiquidRawTag } from '@platformos/liquid-html-parser';
|
|
2
|
-
import { SourceCodeType, visit, Visitor } from '@platformos/platformos-check-common';
|
|
3
|
-
|
|
4
1
|
export function fileMatch(uri: string, patterns: RegExp[]): boolean {
|
|
5
2
|
return patterns.some((pattern) => pattern.test(uri));
|
|
6
3
|
}
|
|
7
|
-
|
|
8
|
-
export function isSectionFile(uri: string): boolean {
|
|
9
|
-
return /\/sections\/[^/]*\.liquid$/.test(uri);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function isBlockFile(uri: string): boolean {
|
|
13
|
-
return /\/blocks\/[^/]*\.liquid$/.test(uri);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function isSectionOrBlockFile(uri: string): boolean {
|
|
17
|
-
return isSectionFile(uri) || isBlockFile(uri);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export async function findSchemaNode(ast: LiquidHtmlNode): Promise<LiquidRawTag | undefined> {
|
|
21
|
-
const nodes = await visit(ast, {
|
|
22
|
-
async LiquidRawTag(node) {
|
|
23
|
-
if (node.name === 'schema') {
|
|
24
|
-
return node;
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
} as Visitor<SourceCodeType.LiquidHtml, LiquidRawTag>);
|
|
28
|
-
|
|
29
|
-
return nodes[0];
|
|
30
|
-
}
|
|
@@ -14,10 +14,10 @@ import { HtmlTagNameRenameProvider } from './providers/HtmlTagNameRenameProvider
|
|
|
14
14
|
import { LiquidVariableRenameProvider } from './providers/LiquidVariableRenameProvider';
|
|
15
15
|
import { Connection } from 'vscode-languageserver';
|
|
16
16
|
import { ClientCapabilities } from '../ClientCapabilities';
|
|
17
|
-
import {
|
|
17
|
+
import { FindAppRootURI } from '../internal-types';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* RenameProvider is responsible for providing rename support for the
|
|
20
|
+
* RenameProvider is responsible for providing rename support for the platformOS language server.
|
|
21
21
|
*
|
|
22
22
|
* Rename is a pretty abstract concept, it can be renaming a tag name, a variable, a class name, etc.
|
|
23
23
|
*/
|
|
@@ -28,7 +28,7 @@ export class RenameProvider {
|
|
|
28
28
|
connection: Connection,
|
|
29
29
|
clientCapabilities: ClientCapabilities,
|
|
30
30
|
private documentManager: DocumentManager,
|
|
31
|
-
|
|
31
|
+
findAppRootURI: FindAppRootURI,
|
|
32
32
|
) {
|
|
33
33
|
this.providers = [
|
|
34
34
|
new HtmlTagNameRenameProvider(documentManager),
|
|
@@ -36,7 +36,7 @@ export class RenameProvider {
|
|
|
36
36
|
connection,
|
|
37
37
|
clientCapabilities,
|
|
38
38
|
documentManager,
|
|
39
|
-
|
|
39
|
+
findAppRootURI,
|
|
40
40
|
),
|
|
41
41
|
];
|
|
42
42
|
}
|
|
@@ -10,7 +10,7 @@ const mockRoot = 'file:';
|
|
|
10
10
|
|
|
11
11
|
describe('LiquidVariableRenameProvider', () => {
|
|
12
12
|
const textDocumentUri = `${mockRoot}///app/views/partials/example-partial.liquid`;
|
|
13
|
-
const
|
|
13
|
+
const findAppRootURI = async () => mockRoot;
|
|
14
14
|
|
|
15
15
|
let capabilities: ClientCapabilities;
|
|
16
16
|
let connection: MockConnection;
|
|
@@ -39,7 +39,7 @@ describe('LiquidVariableRenameProvider', () => {
|
|
|
39
39
|
|
|
40
40
|
beforeEach(() => {
|
|
41
41
|
documentManager = new DocumentManager();
|
|
42
|
-
provider = new RenameProvider(connection, capabilities, documentManager,
|
|
42
|
+
provider = new RenameProvider(connection, capabilities, documentManager, findAppRootURI);
|
|
43
43
|
|
|
44
44
|
textDocument = TextDocument.create(textDocumentUri, 'liquid', 1, documentSource);
|
|
45
45
|
documentManager.open(textDocument.uri, documentSource, 1);
|
|
@@ -198,7 +198,7 @@ describe('LiquidVariableRenameProvider', () => {
|
|
|
198
198
|
|
|
199
199
|
beforeEach(() => {
|
|
200
200
|
documentManager = new DocumentManager();
|
|
201
|
-
provider = new RenameProvider(connection, capabilities, documentManager,
|
|
201
|
+
provider = new RenameProvider(connection, capabilities, documentManager, findAppRootURI);
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
['for', 'tablerow'].forEach((tag) => {
|
|
@@ -371,7 +371,7 @@ describe('LiquidVariableRenameProvider', () => {
|
|
|
371
371
|
);
|
|
372
372
|
|
|
373
373
|
documentManager = new DocumentManager();
|
|
374
|
-
provider = new RenameProvider(connection, capabilities, documentManager,
|
|
374
|
+
provider = new RenameProvider(connection, capabilities, documentManager, findAppRootURI);
|
|
375
375
|
|
|
376
376
|
documentManager.open(textDocumentUri, textDocument.getText(), 1);
|
|
377
377
|
});
|
|
@@ -507,5 +507,5 @@ function createSectionWithSource(
|
|
|
507
507
|
}
|
|
508
508
|
|
|
509
509
|
function getSectionUri(sectionName: string) {
|
|
510
|
-
return `${mockRoot}///
|
|
510
|
+
return `${mockRoot}///app/views/partials/${sectionName}.liquid`;
|
|
511
511
|
}
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
31
31
|
import { ClientCapabilities } from '../../ClientCapabilities';
|
|
32
32
|
import { AugmentedLiquidSourceCode, DocumentManager, isLiquidSourceCode } from '../../documents';
|
|
33
|
-
import {
|
|
33
|
+
import { FindAppRootURI } from '../../internal-types';
|
|
34
34
|
import { partialName } from '../../utils/uri';
|
|
35
35
|
import { BaseRenameProvider } from '../BaseRenameProvider';
|
|
36
36
|
|
|
@@ -39,7 +39,7 @@ export class LiquidVariableRenameProvider implements BaseRenameProvider {
|
|
|
39
39
|
private connection: Connection,
|
|
40
40
|
private clientCapabilities: ClientCapabilities,
|
|
41
41
|
private documentManager: DocumentManager,
|
|
42
|
-
private
|
|
42
|
+
private findAppRootURI: FindAppRootURI,
|
|
43
43
|
) {}
|
|
44
44
|
|
|
45
45
|
async prepare(
|
|
@@ -74,7 +74,7 @@ export class LiquidVariableRenameProvider implements BaseRenameProvider {
|
|
|
74
74
|
params: RenameParams,
|
|
75
75
|
): Promise<null | WorkspaceEdit> {
|
|
76
76
|
const document = this.documentManager.get(params.textDocument.uri);
|
|
77
|
-
const rootUri = await this.
|
|
77
|
+
const rootUri = await this.findAppRootURI(params.textDocument.uri);
|
|
78
78
|
const textDocument = document?.textDocument;
|
|
79
79
|
|
|
80
80
|
if (!rootUri || !textDocument || !node || !ancestors) return null;
|
|
@@ -104,8 +104,8 @@ export class LiquidVariableRenameProvider implements BaseRenameProvider {
|
|
|
104
104
|
});
|
|
105
105
|
|
|
106
106
|
if (this.clientCapabilities.hasApplyEditSupport && liquidDocParamUpdated) {
|
|
107
|
-
const
|
|
108
|
-
const liquidSourceCodes =
|
|
107
|
+
const appFiles = this.documentManager.app(rootUri, true);
|
|
108
|
+
const liquidSourceCodes = appFiles.filter(isLiquidSourceCode);
|
|
109
109
|
const name = partialName(params.textDocument.uri);
|
|
110
110
|
|
|
111
111
|
await updateRenderTags(this.connection, liquidSourceCodes, name, oldName, params.newName);
|
|
@@ -242,7 +242,7 @@ async function updateRenderTags(
|
|
|
242
242
|
const textDocument = sourceCode.textDocument;
|
|
243
243
|
const edits: TextEdit[] = await visit<SourceCodeType.LiquidHtml, TextEdit>(sourceCode.ast, {
|
|
244
244
|
async RenderMarkup(node: RenderMarkup) {
|
|
245
|
-
if (node.
|
|
245
|
+
if (node.partial.type !== NodeTypes.String || node.partial.value !== partialName) {
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
248
|
|
|
@@ -2,11 +2,9 @@ import { Connection } from 'vscode-languageserver';
|
|
|
2
2
|
import { RenameFilesParams } from 'vscode-languageserver-protocol';
|
|
3
3
|
import { ClientCapabilities } from '../ClientCapabilities';
|
|
4
4
|
import { DocumentManager } from '../documents';
|
|
5
|
-
import {
|
|
5
|
+
import { FindAppRootURI } from '../internal-types';
|
|
6
6
|
import { BaseRenameHandler } from './BaseRenameHandler';
|
|
7
7
|
import { AssetRenameHandler } from './handlers/AssetRenameHandler';
|
|
8
|
-
import { BlockRenameHandler } from './handlers/BlockRenameHandler';
|
|
9
|
-
import { SectionRenameHandler } from './handlers/SectionRenameHandler';
|
|
10
8
|
import { PartialRenameHandler } from './handlers/PartialRenameHandler';
|
|
11
9
|
|
|
12
10
|
/**
|
|
@@ -15,7 +13,6 @@ import { PartialRenameHandler } from './handlers/PartialRenameHandler';
|
|
|
15
13
|
* Stuff we'll handle:
|
|
16
14
|
* - When a partial is renamed, then we'll change all the render calls
|
|
17
15
|
* - When an asset is renamed, then we'll change the asset_url calls
|
|
18
|
-
* - etc.
|
|
19
16
|
*/
|
|
20
17
|
export class RenameHandler {
|
|
21
18
|
private handlers: BaseRenameHandler[];
|
|
@@ -23,13 +20,11 @@ export class RenameHandler {
|
|
|
23
20
|
connection: Connection,
|
|
24
21
|
capabilities: ClientCapabilities,
|
|
25
22
|
documentManager: DocumentManager,
|
|
26
|
-
|
|
23
|
+
findAppRootURI: FindAppRootURI,
|
|
27
24
|
) {
|
|
28
25
|
this.handlers = [
|
|
29
|
-
new PartialRenameHandler(documentManager, connection, capabilities,
|
|
30
|
-
new AssetRenameHandler(documentManager, connection, capabilities,
|
|
31
|
-
new BlockRenameHandler(documentManager, connection, capabilities, findThemeRootURI),
|
|
32
|
-
new SectionRenameHandler(documentManager, connection, capabilities, findThemeRootURI),
|
|
26
|
+
new PartialRenameHandler(documentManager, connection, capabilities, findAppRootURI),
|
|
27
|
+
new AssetRenameHandler(documentManager, connection, capabilities, findAppRootURI),
|
|
33
28
|
];
|
|
34
29
|
}
|
|
35
30
|
|