@finos/legend-application 14.0.4 → 15.0.0
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/lib/__lib__/LegendApplicationDocumentation.d.ts.map +1 -0
- package/lib/__lib__/LegendApplicationDocumentation.js.map +1 -0
- package/lib/{application → __lib__}/LegendApplicationEvent.d.ts +0 -1
- package/lib/__lib__/LegendApplicationEvent.d.ts.map +1 -0
- package/lib/{application → __lib__}/LegendApplicationEvent.js +0 -1
- package/lib/__lib__/LegendApplicationEvent.js.map +1 -0
- package/lib/__lib__/LegendApplicationNavigation.d.ts +19 -0
- package/lib/__lib__/LegendApplicationNavigation.d.ts.map +1 -0
- package/lib/__lib__/LegendApplicationNavigation.js +20 -0
- package/lib/__lib__/LegendApplicationNavigation.js.map +1 -0
- package/lib/__lib__/LegendApplicationSetting.d.ts.map +1 -0
- package/lib/__lib__/LegendApplicationSetting.js.map +1 -0
- package/lib/{application → __lib__}/LegendApplicationTelemetry.d.ts +0 -11
- package/lib/__lib__/LegendApplicationTelemetry.d.ts.map +1 -0
- package/lib/{application → __lib__}/LegendApplicationTelemetry.js +0 -4
- package/lib/__lib__/LegendApplicationTelemetry.js.map +1 -0
- package/lib/__lib__/LegendApplicationTheme.d.ts.map +1 -0
- package/lib/__lib__/LegendApplicationTheme.js.map +1 -0
- package/lib/__test__.d.ts +18 -0
- package/lib/__test__.d.ts.map +1 -0
- package/lib/__test__.js +18 -0
- package/lib/__test__.js.map +1 -0
- package/lib/application/LegendApplication.d.ts +7 -4
- package/lib/application/LegendApplication.d.ts.map +1 -1
- package/lib/application/LegendApplication.js +28 -11
- package/lib/application/LegendApplication.js.map +1 -1
- package/lib/application/LegendApplicationConfig.d.ts +8 -1
- package/lib/application/LegendApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendApplicationConfig.js +6 -2
- package/lib/application/LegendApplicationConfig.js.map +1 -1
- package/lib/browser.d.ts +19 -0
- package/lib/browser.d.ts.map +1 -0
- package/lib/browser.js +19 -0
- package/lib/browser.js.map +1 -0
- package/lib/components/{LegendApplicationComponentFrameworkProvider.d.ts → ApplicationComponentFrameworkProvider.d.ts} +2 -2
- package/lib/components/ApplicationComponentFrameworkProvider.d.ts.map +1 -0
- package/lib/components/{LegendApplicationComponentFrameworkProvider.js → ApplicationComponentFrameworkProvider.js} +3 -3
- package/lib/components/ApplicationComponentFrameworkProvider.js.map +1 -0
- package/lib/components/ApplicationFrameworkProvider.d.ts +21 -0
- package/lib/components/ApplicationFrameworkProvider.d.ts.map +1 -0
- package/lib/components/ApplicationFrameworkProvider.js +39 -0
- package/lib/components/ApplicationFrameworkProvider.js.map +1 -0
- package/lib/components/{shared/DocumentationLink.d.ts → ApplicationPlatformProvider.d.ts} +4 -10
- package/lib/components/ApplicationPlatformProvider.d.ts.map +1 -0
- package/lib/components/{WebApplicationNavigatorProviderTestUtils.d.ts → ApplicationPlatformProvider.js} +5 -7
- package/lib/components/ApplicationPlatformProvider.js.map +1 -0
- package/lib/components/ApplicationStoreProvider.d.ts +3 -4
- package/lib/components/ApplicationStoreProvider.d.ts.map +1 -1
- package/lib/components/ApplicationStoreProvider.js +6 -23
- package/lib/components/ApplicationStoreProvider.js.map +1 -1
- package/lib/components/{WebApplicationNavigatorProvider.d.ts → BrowserEnvironmentProvider.d.ts} +3 -4
- package/lib/components/BrowserEnvironmentProvider.d.ts.map +1 -0
- package/lib/components/BrowserEnvironmentProvider.js +31 -0
- package/lib/components/BrowserEnvironmentProvider.js.map +1 -0
- package/lib/components/VirtualAssistant.d.ts.map +1 -1
- package/lib/components/VirtualAssistant.js +17 -9
- package/lib/components/VirtualAssistant.js.map +1 -1
- package/lib/components/{shared/FuzzySearchAdvancedConfigMenu.d.ts → __test-utils__/BrowserEnvironmentTestUtils.d.ts} +13 -7
- package/lib/components/__test-utils__/BrowserEnvironmentTestUtils.d.ts.map +1 -0
- package/lib/components/__test-utils__/BrowserEnvironmentTestUtils.js +42 -0
- package/lib/components/__test-utils__/BrowserEnvironmentTestUtils.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +8 -16
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -18
- package/lib/index.js.map +1 -1
- package/lib/package.json +4 -6
- package/lib/stores/{shared/PackageableElementOption.d.ts → ApplicationConfig.d.ts} +6 -7
- package/lib/stores/ApplicationConfig.d.ts.map +1 -0
- package/lib/stores/ApplicationConfig.js +21 -0
- package/lib/stores/ApplicationConfig.js.map +1 -0
- package/lib/stores/ApplicationNavigationContextService.js +1 -1
- package/lib/stores/ApplicationNavigationContextService.js.map +1 -1
- package/lib/stores/ApplicationStore.d.ts +4 -8
- package/lib/stores/ApplicationStore.d.ts.map +1 -1
- package/lib/stores/ApplicationStore.js +14 -14
- package/lib/stores/ApplicationStore.js.map +1 -1
- package/lib/stores/AssistantService.d.ts +3 -3
- package/lib/stores/AssistantService.d.ts.map +1 -1
- package/lib/stores/AssistantService.js +18 -10
- package/lib/stores/AssistantService.js.map +1 -1
- package/lib/stores/CommandService.js +1 -1
- package/lib/stores/CommandService.js.map +1 -1
- package/lib/stores/Core_LegendApplicationPlugin.d.ts.map +1 -1
- package/lib/stores/Core_LegendApplicationPlugin.js +2 -52
- package/lib/stores/Core_LegendApplicationPlugin.js.map +1 -1
- package/lib/stores/DocumentationService.d.ts +1 -1
- package/lib/stores/DocumentationService.d.ts.map +1 -1
- package/lib/stores/DocumentationService.js +4 -5
- package/lib/stores/DocumentationService.js.map +1 -1
- package/lib/stores/LayoutService.js +3 -3
- package/lib/stores/LayoutService.js.map +1 -1
- package/lib/stores/LegendApplicationPlugin.d.ts +1 -15
- package/lib/stores/LegendApplicationPlugin.d.ts.map +1 -1
- package/lib/stores/LegendApplicationPlugin.js +0 -5
- package/lib/stores/LegendApplicationPlugin.js.map +1 -1
- package/lib/stores/SettingService.d.ts +1 -0
- package/lib/stores/SettingService.d.ts.map +1 -1
- package/lib/stores/SettingService.js +1 -1
- package/lib/stores/SettingService.js.map +1 -1
- package/lib/stores/__test-utils__/ApplicationStoreTestUtils.d.ts +18 -0
- package/lib/stores/__test-utils__/ApplicationStoreTestUtils.d.ts.map +1 -0
- package/lib/stores/__test-utils__/ApplicationStoreTestUtils.js +21 -0
- package/lib/stores/__test-utils__/ApplicationStoreTestUtils.js.map +1 -0
- package/lib/stores/navigation/BrowserNavigator.d.ts +64 -0
- package/lib/stores/navigation/BrowserNavigator.d.ts.map +1 -0
- package/lib/stores/navigation/{WebApplicationNavigator.js → BrowserNavigator.js} +22 -3
- package/lib/stores/navigation/BrowserNavigator.js.map +1 -0
- package/lib/stores/navigation/{WebApplicationNavigator.d.ts → DefaultNavigator.d.ts} +3 -12
- package/lib/stores/navigation/DefaultNavigator.d.ts.map +1 -0
- package/lib/stores/navigation/DefaultNavigator.js +74 -0
- package/lib/stores/navigation/DefaultNavigator.js.map +1 -0
- package/lib/stores/navigation/NavigationService.d.ts +7 -0
- package/lib/stores/navigation/NavigationService.d.ts.map +1 -1
- package/lib/stores/navigation/NavigationService.js.map +1 -1
- package/lib/stores/platform/ApplicationPlatform.d.ts +24 -0
- package/lib/stores/platform/ApplicationPlatform.d.ts.map +1 -0
- package/lib/stores/platform/ApplicationPlatform.js +25 -0
- package/lib/stores/platform/ApplicationPlatform.js.map +1 -0
- package/lib/stores/platform/BrowserPlatform.d.ts +29 -0
- package/lib/stores/platform/BrowserPlatform.d.ts.map +1 -0
- package/lib/stores/platform/BrowserPlatform.js +39 -0
- package/lib/stores/platform/BrowserPlatform.js.map +1 -0
- package/lib/stores/storage/StorageService.d.ts +5 -2
- package/lib/stores/storage/StorageService.d.ts.map +1 -1
- package/lib/stores/storage/StorageService.js +20 -10
- package/lib/stores/storage/StorageService.js.map +1 -1
- package/lib/stores/terminal/XTerm.d.ts.map +1 -1
- package/lib/stores/terminal/XTerm.js +5 -5
- package/lib/stores/terminal/XTerm.js.map +1 -1
- package/package.json +7 -9
- package/src/{application → __lib__}/LegendApplicationEvent.ts +1 -1
- package/{lib/stores/shared/PackageableElementOption.js → src/__lib__/LegendApplicationNavigation.ts} +4 -5
- package/src/{application → __lib__}/LegendApplicationTelemetry.ts +0 -24
- package/src/{components.ts → __test__.ts} +2 -7
- package/src/application/LegendApplication.ts +45 -16
- package/src/application/LegendApplicationConfig.ts +13 -2
- package/src/browser.ts +19 -0
- package/src/components/{LegendApplicationComponentFrameworkProvider.tsx → ApplicationComponentFrameworkProvider.tsx} +2 -2
- package/src/components/ApplicationFrameworkProvider.tsx +47 -0
- package/src/components/ApplicationPlatformProvider.tsx +29 -0
- package/src/components/ApplicationStoreProvider.tsx +8 -33
- package/src/components/BrowserEnvironmentProvider.tsx +48 -0
- package/src/components/VirtualAssistant.tsx +53 -11
- package/src/components/__test-utils__/BrowserEnvironmentTestUtils.tsx +63 -0
- package/src/index.ts +12 -24
- package/src/stores/ApplicationConfig.ts +22 -0
- package/src/stores/ApplicationNavigationContextService.ts +1 -1
- package/src/stores/ApplicationStore.ts +18 -19
- package/src/stores/AssistantService.ts +20 -9
- package/src/stores/CommandService.ts +1 -1
- package/src/stores/Core_LegendApplicationPlugin.ts +2 -78
- package/src/stores/DocumentationService.ts +4 -5
- package/src/stores/LayoutService.ts +3 -3
- package/src/stores/LegendApplicationPlugin.ts +1 -21
- package/src/stores/SettingService.ts +2 -1
- package/src/stores/__test-utils__/ApplicationStoreTestUtils.ts +24 -0
- package/src/stores/navigation/{WebApplicationNavigator.ts → BrowserNavigator.ts} +41 -2
- package/src/stores/navigation/DefaultNavigator.ts +150 -0
- package/src/stores/navigation/NavigationService.ts +8 -0
- package/src/stores/{shared/PackageableElementOption.ts → platform/ApplicationPlatform.ts} +14 -11
- package/src/stores/platform/BrowserPlatform.ts +54 -0
- package/src/stores/storage/StorageService.ts +32 -14
- package/src/stores/terminal/XTerm.ts +8 -5
- package/tsconfig.json +19 -23
- package/lib/application/LegendApplicationDocumentation.d.ts.map +0 -1
- package/lib/application/LegendApplicationDocumentation.js.map +0 -1
- package/lib/application/LegendApplicationEvent.d.ts.map +0 -1
- package/lib/application/LegendApplicationEvent.js.map +0 -1
- package/lib/application/LegendApplicationSetting.d.ts.map +0 -1
- package/lib/application/LegendApplicationSetting.js.map +0 -1
- package/lib/application/LegendApplicationTelemetry.d.ts.map +0 -1
- package/lib/application/LegendApplicationTelemetry.js.map +0 -1
- package/lib/application/LegendApplicationTheme.d.ts.map +0 -1
- package/lib/application/LegendApplicationTheme.js.map +0 -1
- package/lib/components/ApplicationStoreProviderTestUtils.d.ts +0 -31
- package/lib/components/ApplicationStoreProviderTestUtils.d.ts.map +0 -1
- package/lib/components/ApplicationStoreProviderTestUtils.js +0 -32
- package/lib/components/ApplicationStoreProviderTestUtils.js.map +0 -1
- package/lib/components/LegendApplicationComponentFrameworkProvider.d.ts.map +0 -1
- package/lib/components/LegendApplicationComponentFrameworkProvider.js.map +0 -1
- package/lib/components/WebApplicationNavigatorProvider.d.ts.map +0 -1
- package/lib/components/WebApplicationNavigatorProvider.js +0 -29
- package/lib/components/WebApplicationNavigatorProvider.js.map +0 -1
- package/lib/components/WebApplicationNavigatorProviderTestUtils.d.ts.map +0 -1
- package/lib/components/WebApplicationNavigatorProviderTestUtils.js +0 -28
- package/lib/components/WebApplicationNavigatorProviderTestUtils.js.map +0 -1
- package/lib/components/shared/DocumentationLink.d.ts.map +0 -1
- package/lib/components/shared/DocumentationLink.js +0 -53
- package/lib/components/shared/DocumentationLink.js.map +0 -1
- package/lib/components/shared/FuzzySearchAdvancedConfigMenu.d.ts.map +0 -1
- package/lib/components/shared/FuzzySearchAdvancedConfigMenu.js +0 -37
- package/lib/components/shared/FuzzySearchAdvancedConfigMenu.js.map +0 -1
- package/lib/components/shared/PackageableElementOptionLabel.d.ts +0 -22
- package/lib/components/shared/PackageableElementOptionLabel.d.ts.map +0 -1
- package/lib/components/shared/PackageableElementOptionLabel.js +0 -46
- package/lib/components/shared/PackageableElementOptionLabel.js.map +0 -1
- package/lib/components/shared/TabManager.d.ts +0 -24
- package/lib/components/shared/TabManager.d.ts.map +0 -1
- package/lib/components/shared/TabManager.js +0 -117
- package/lib/components/shared/TabManager.js.map +0 -1
- package/lib/components.d.ts +0 -21
- package/lib/components.d.ts.map +0 -1
- package/lib/components.js +0 -21
- package/lib/components.js.map +0 -1
- package/lib/const.d.ts +0 -35
- package/lib/const.d.ts.map +0 -1
- package/lib/const.js +0 -39
- package/lib/const.js.map +0 -1
- package/lib/stores/ApplicationStoreTestUtils.d.ts +0 -41
- package/lib/stores/ApplicationStoreTestUtils.d.ts.map +0 -1
- package/lib/stores/ApplicationStoreTestUtils.js +0 -70
- package/lib/stores/ApplicationStoreTestUtils.js.map +0 -1
- package/lib/stores/navigation/WebApplicationNavigator.d.ts.map +0 -1
- package/lib/stores/navigation/WebApplicationNavigator.js.map +0 -1
- package/lib/stores/navigation/WebApplicationRouter.d.ts +0 -22
- package/lib/stores/navigation/WebApplicationRouter.d.ts.map +0 -1
- package/lib/stores/navigation/WebApplicationRouter.js +0 -25
- package/lib/stores/navigation/WebApplicationRouter.js.map +0 -1
- package/lib/stores/pure-language/PureLanguageCodeEditorSupport.d.ts +0 -70
- package/lib/stores/pure-language/PureLanguageCodeEditorSupport.d.ts.map +0 -1
- package/lib/stores/pure-language/PureLanguageCodeEditorSupport.js +0 -237
- package/lib/stores/pure-language/PureLanguageCodeEditorSupport.js.map +0 -1
- package/lib/stores/pure-language/PureLanguageSupport.d.ts +0 -39
- package/lib/stores/pure-language/PureLanguageSupport.d.ts.map +0 -1
- package/lib/stores/pure-language/PureLanguageSupport.js +0 -437
- package/lib/stores/pure-language/PureLanguageSupport.js.map +0 -1
- package/lib/stores/shared/FuzzySearchAdvancedConfigState.d.ts +0 -30
- package/lib/stores/shared/FuzzySearchAdvancedConfigState.d.ts.map +0 -1
- package/lib/stores/shared/FuzzySearchAdvancedConfigState.js +0 -59
- package/lib/stores/shared/FuzzySearchAdvancedConfigState.js.map +0 -1
- package/lib/stores/shared/PackageableElementOption.d.ts.map +0 -1
- package/lib/stores/shared/PackageableElementOption.js.map +0 -1
- package/lib/stores/shared/TabManagerState.d.ts +0 -40
- package/lib/stores/shared/TabManagerState.d.ts.map +0 -1
- package/lib/stores/shared/TabManagerState.js +0 -93
- package/lib/stores/shared/TabManagerState.js.map +0 -1
- package/src/components/ApplicationStoreProviderTestUtils.tsx +0 -59
- package/src/components/WebApplicationNavigatorProvider.tsx +0 -46
- package/src/components/WebApplicationNavigatorProviderTestUtils.tsx +0 -37
- package/src/components/shared/DocumentationLink.tsx +0 -87
- package/src/components/shared/FuzzySearchAdvancedConfigMenu.tsx +0 -73
- package/src/components/shared/PackageableElementOptionLabel.tsx +0 -85
- package/src/components/shared/TabManager.tsx +0 -288
- package/src/const.ts +0 -40
- package/src/stores/ApplicationStoreTestUtils.ts +0 -107
- package/src/stores/navigation/WebApplicationRouter.ts +0 -49
- package/src/stores/pure-language/PureLanguageCodeEditorSupport.ts +0 -338
- package/src/stores/pure-language/PureLanguageSupport.ts +0 -498
- package/src/stores/shared/FuzzySearchAdvancedConfigState.ts +0 -65
- package/src/stores/shared/TabManagerState.ts +0 -124
- /package/lib/{application → __lib__}/LegendApplicationDocumentation.d.ts +0 -0
- /package/lib/{application → __lib__}/LegendApplicationDocumentation.js +0 -0
- /package/lib/{application → __lib__}/LegendApplicationSetting.d.ts +0 -0
- /package/lib/{application → __lib__}/LegendApplicationSetting.js +0 -0
- /package/lib/{application → __lib__}/LegendApplicationTheme.d.ts +0 -0
- /package/lib/{application → __lib__}/LegendApplicationTheme.js +0 -0
- /package/src/{application → __lib__}/LegendApplicationDocumentation.ts +0 -0
- /package/src/{application → __lib__}/LegendApplicationSetting.ts +0 -0
- /package/src/{application → __lib__}/LegendApplicationTheme.ts +0 -0
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { PARSER_SECTION_MARKER, PURE_PARSER } from '@finos/legend-graph';
|
|
17
|
-
import { getNullableFirstElement, guaranteeNonNullable, hasWhiteSpace, } from '@finos/legend-shared';
|
|
18
|
-
import { languages as monacoLanguagesAPI, } from 'monaco-editor';
|
|
19
|
-
export const getParserKeywordSuggestions = (position, model, suggestions) => {
|
|
20
|
-
const results = [];
|
|
21
|
-
const currentWord = model.getWordUntilPosition(position);
|
|
22
|
-
// suggestions for parser keyword
|
|
23
|
-
const lineTextIncludingWordRange = {
|
|
24
|
-
startLineNumber: position.lineNumber,
|
|
25
|
-
startColumn: 1,
|
|
26
|
-
endLineNumber: position.lineNumber,
|
|
27
|
-
endColumn: currentWord.endColumn,
|
|
28
|
-
};
|
|
29
|
-
const lineTextIncludingWord = model.getValueInRange(lineTextIncludingWordRange);
|
|
30
|
-
// NOTE: make sure parser keyword suggestions only show up when the current word is the
|
|
31
|
-
// the first word of the line since parser section header must not be preceded by anything
|
|
32
|
-
if (!hasWhiteSpace(lineTextIncludingWord.trim())) {
|
|
33
|
-
suggestions.forEach((suggestion) => {
|
|
34
|
-
results.push({
|
|
35
|
-
label: {
|
|
36
|
-
label: `${PARSER_SECTION_MARKER}${suggestion.text}`,
|
|
37
|
-
description: suggestion.description,
|
|
38
|
-
},
|
|
39
|
-
kind: monacoLanguagesAPI.CompletionItemKind.Keyword,
|
|
40
|
-
insertText: `${PARSER_SECTION_MARKER}${suggestion.insertText}\n`,
|
|
41
|
-
range: lineTextIncludingWordRange,
|
|
42
|
-
documentation: suggestion.documentation
|
|
43
|
-
? suggestion.documentation.markdownText
|
|
44
|
-
? {
|
|
45
|
-
value: suggestion.documentation.markdownText.value,
|
|
46
|
-
}
|
|
47
|
-
: suggestion.documentation.text
|
|
48
|
-
: undefined,
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return results;
|
|
53
|
-
};
|
|
54
|
-
export const getSectionParserNameFromLineText = (lineText) => {
|
|
55
|
-
if (lineText.startsWith(PARSER_SECTION_MARKER)) {
|
|
56
|
-
return lineText.substring(PARSER_SECTION_MARKER.length).split(' ')[0];
|
|
57
|
-
}
|
|
58
|
-
// NOTE: since leading whitespace to parser name is considered invalid, we will return `undefined`
|
|
59
|
-
return undefined;
|
|
60
|
-
};
|
|
61
|
-
export const getParserElementSnippetSuggestions = (position, model, suggestionsGetter) => {
|
|
62
|
-
const results = [];
|
|
63
|
-
const currentWord = model.getWordUntilPosition(position);
|
|
64
|
-
// suggestions for parser element snippets
|
|
65
|
-
const textUntilPosition = model.getValueInRange({
|
|
66
|
-
startLineNumber: 1,
|
|
67
|
-
startColumn: 1,
|
|
68
|
-
endLineNumber: position.lineNumber,
|
|
69
|
-
endColumn: position.column,
|
|
70
|
-
});
|
|
71
|
-
const allParserSectionHeaders =
|
|
72
|
-
// NOTE: since `###Pure` is implicitly considered as the first section, we prepend it to the text
|
|
73
|
-
`${PARSER_SECTION_MARKER}${PURE_PARSER.PURE}\n${textUntilPosition}`
|
|
74
|
-
.split('\n')
|
|
75
|
-
.filter((line) => line.startsWith(PARSER_SECTION_MARKER));
|
|
76
|
-
const currentParserName = getSectionParserNameFromLineText(allParserSectionHeaders[allParserSectionHeaders.length - 1] ?? '');
|
|
77
|
-
if (currentParserName) {
|
|
78
|
-
suggestionsGetter(currentParserName).forEach((snippetSuggestion) => {
|
|
79
|
-
results.push({
|
|
80
|
-
label: {
|
|
81
|
-
label: snippetSuggestion.text,
|
|
82
|
-
description: snippetSuggestion.description,
|
|
83
|
-
},
|
|
84
|
-
kind: monacoLanguagesAPI.CompletionItemKind.Snippet,
|
|
85
|
-
insertTextRules: monacoLanguagesAPI.CompletionItemInsertTextRule.InsertAsSnippet,
|
|
86
|
-
insertText: `${snippetSuggestion.insertText}\n`,
|
|
87
|
-
range: {
|
|
88
|
-
startLineNumber: position.lineNumber,
|
|
89
|
-
startColumn: currentWord.startColumn,
|
|
90
|
-
endLineNumber: position.lineNumber,
|
|
91
|
-
endColumn: currentWord.endColumn,
|
|
92
|
-
},
|
|
93
|
-
documentation: snippetSuggestion.documentation
|
|
94
|
-
? snippetSuggestion.documentation.markdownText
|
|
95
|
-
? {
|
|
96
|
-
value: snippetSuggestion.documentation.markdownText.value,
|
|
97
|
-
}
|
|
98
|
-
: snippetSuggestion.documentation.text
|
|
99
|
-
: undefined,
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
return results;
|
|
104
|
-
};
|
|
105
|
-
export const getInlineSnippetSuggestions = (position, model, extraSnippetSuggestions = []) => {
|
|
106
|
-
const currentWord = model.getWordUntilPosition(position);
|
|
107
|
-
return [
|
|
108
|
-
{
|
|
109
|
-
text: 'let',
|
|
110
|
-
description: 'new variable',
|
|
111
|
-
insertText: `let \${1:} = \${2:};`,
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
text: 'let',
|
|
115
|
-
description: 'new collection',
|
|
116
|
-
insertText: `let \${1:} = [\${2:}];`,
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
text: 'cast',
|
|
120
|
-
description: 'type casting',
|
|
121
|
-
insertText: `cast(@\${1:model::SomeClass})`,
|
|
122
|
-
},
|
|
123
|
-
// conditionals
|
|
124
|
-
{
|
|
125
|
-
text: 'if',
|
|
126
|
-
description: '(conditional)',
|
|
127
|
-
insertText: `if(\${1:'true'}, | \${2:/* if true do this */}, | \${3:/* if false do this */})`,
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
text: 'case',
|
|
131
|
-
description: '(conditional)',
|
|
132
|
-
insertText: `case(\${1:}, \${2:'true'}, \${3:'false'})`,
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
text: 'match',
|
|
136
|
-
description: '(conditional)',
|
|
137
|
-
insertText: `match([x:\${1:String[1]}, \${2:''}])`,
|
|
138
|
-
},
|
|
139
|
-
// collection
|
|
140
|
-
{
|
|
141
|
-
text: 'map',
|
|
142
|
-
description: '(collection)',
|
|
143
|
-
insertText: `map(x|\${1:})`,
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
text: 'filter',
|
|
147
|
-
description: '(collection)',
|
|
148
|
-
insertText: `filter(x|\${1:})`,
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
text: 'fold',
|
|
152
|
-
description: '(collection)',
|
|
153
|
-
insertText: `fold({a, b| \${1:$a + $b}}, \${2:0})`,
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
text: 'filter',
|
|
157
|
-
description: '(collection)',
|
|
158
|
-
insertText: `filter(x|\${1:})`,
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
text: 'sort',
|
|
162
|
-
description: '(collection)',
|
|
163
|
-
insertText: `sort()`,
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
text: 'in',
|
|
167
|
-
description: '(collection)',
|
|
168
|
-
insertText: `in()`,
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
text: 'slice',
|
|
172
|
-
description: '(collection)',
|
|
173
|
-
insertText: `slice(\${1:1},$\{2:2})`,
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
text: 'removeDuplicates',
|
|
177
|
-
description: '(collection)',
|
|
178
|
-
insertText: `removeDuplicates()`,
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
text: 'toOne',
|
|
182
|
-
description: '(collection)',
|
|
183
|
-
insertText: `toOne(\${1:})`,
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
text: 'toOneMany',
|
|
187
|
-
description: '(collection)',
|
|
188
|
-
insertText: `toOneMany(\${1:})`,
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
text: 'isEmpty',
|
|
192
|
-
description: '(collection)',
|
|
193
|
-
insertText: `isEmpty()`,
|
|
194
|
-
},
|
|
195
|
-
// string
|
|
196
|
-
{
|
|
197
|
-
text: 'endsWith',
|
|
198
|
-
description: '(string)',
|
|
199
|
-
insertText: `endsWith()`,
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
text: 'startsWith',
|
|
203
|
-
description: '(string)',
|
|
204
|
-
insertText: `startsWith()`,
|
|
205
|
-
},
|
|
206
|
-
...extraSnippetSuggestions,
|
|
207
|
-
].map((snippetSuggestion) => ({
|
|
208
|
-
label: {
|
|
209
|
-
label: snippetSuggestion.text,
|
|
210
|
-
description: snippetSuggestion.description,
|
|
211
|
-
},
|
|
212
|
-
kind: monacoLanguagesAPI.CompletionItemKind.Snippet,
|
|
213
|
-
insertTextRules: monacoLanguagesAPI.CompletionItemInsertTextRule.InsertAsSnippet,
|
|
214
|
-
insertText: snippetSuggestion.insertText,
|
|
215
|
-
range: {
|
|
216
|
-
startLineNumber: position.lineNumber,
|
|
217
|
-
startColumn: currentWord.startColumn,
|
|
218
|
-
endLineNumber: position.lineNumber,
|
|
219
|
-
endColumn: currentWord.endColumn,
|
|
220
|
-
},
|
|
221
|
-
documentation: snippetSuggestion.documentation
|
|
222
|
-
? snippetSuggestion.documentation.markdownText
|
|
223
|
-
? {
|
|
224
|
-
value: snippetSuggestion.documentation.markdownText.value,
|
|
225
|
-
}
|
|
226
|
-
: snippetSuggestion.documentation.text
|
|
227
|
-
: undefined,
|
|
228
|
-
}));
|
|
229
|
-
};
|
|
230
|
-
export const isTokenOneOf = (token, baseTokens, exact = false) => {
|
|
231
|
-
if (exact) {
|
|
232
|
-
return baseTokens.map((baseToken) => `${baseToken}.pure`).includes(token);
|
|
233
|
-
}
|
|
234
|
-
const baseToken = guaranteeNonNullable(getNullableFirstElement(token.split('.')));
|
|
235
|
-
return baseTokens.includes(baseToken);
|
|
236
|
-
};
|
|
237
|
-
//# sourceMappingURL=PureLanguageCodeEditorSupport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PureLanguageCodeEditorSupport.js","sourceRoot":"","sources":["../../../src/stores/pure-language/PureLanguageCodeEditorSupport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,SAAS,IAAI,kBAAkB,GAEhC,MAAM,eAAe,CAAC;AAoDvB,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,QAAmB,EACnB,KAAiC,EACjC,WAAwC,EACH,EAAE;IACvC,MAAM,OAAO,GAAwC,EAAE,CAAC;IACxD,MAAM,WAAW,GAAG,KAAK,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAEzD,iCAAiC;IACjC,MAAM,0BAA0B,GAAG;QACjC,eAAe,EAAE,QAAQ,CAAC,UAAU;QACpC,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,QAAQ,CAAC,UAAU;QAClC,SAAS,EAAE,WAAW,CAAC,SAAS;KACjC,CAAC;IACF,MAAM,qBAAqB,GAAG,KAAK,CAAC,eAAe,CACjD,0BAA0B,CAC3B,CAAC;IAEF,uFAAuF;IACvF,0FAA0F;IAC1F,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC,EAAE;QAChD,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YACjC,OAAO,CAAC,IAAI,CAAC;gBACX,KAAK,EAAE;oBACL,KAAK,EAAE,GAAG,qBAAqB,GAAG,UAAU,CAAC,IAAI,E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C,CAAC;oBACE,KAAK,EAAE,iBAAiB,CAAC,aAAa,CAAC,YAAY,CAAC,KAAK;iBAC1D;gBACH,CAAC,CAAC,iBAAiB,CAAC,aAAa,CAAC,IAAI;YACxC,CAAC,CAAC,SAAS;KACwB,CAAA,CAC1C,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,KAAa,EACb,UAAoB,EACpB,KAAK,GAAG,KAAK,EACJ,EAAE;IACX,IAAI,KAAK,EAAE;QACT,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,SAAS,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;KAC3E;IACD,MAAM,SAAS,GAAG,oBAAoB,CACpC,uBAAuB,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAC1C,CAAC;IACF,OAAO,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export declare enum PURE_GRAMMAR_TOKEN {
|
|
17
|
-
WHITESPACE = "",
|
|
18
|
-
KEYWORD = "keyword",
|
|
19
|
-
IDENTIFIER = "identifier",
|
|
20
|
-
OPERATOR = "operator",
|
|
21
|
-
DELIMITER = "delimiter",
|
|
22
|
-
PARSER = "parser",
|
|
23
|
-
NUMBER = "number",
|
|
24
|
-
DATE = "date",
|
|
25
|
-
COLOR = "color",
|
|
26
|
-
PACKAGE = "package",
|
|
27
|
-
STRING = "string",
|
|
28
|
-
COMMENT = "comment",
|
|
29
|
-
LANGUAGE_STRUCT = "language-struct",
|
|
30
|
-
MULTIPLICITY = "multiplicity",
|
|
31
|
-
GENERICS = "generics",
|
|
32
|
-
PROPERTY = "property",
|
|
33
|
-
PARAMETER = "property",
|
|
34
|
-
VARIABLE = "variable",
|
|
35
|
-
TYPE = "type",
|
|
36
|
-
INVALID = "invalid"
|
|
37
|
-
}
|
|
38
|
-
export declare const setupPureLanguageService: (extraKeywords: string[], extraParserKeywords: string[]) => void;
|
|
39
|
-
//# sourceMappingURL=PureLanguageSupport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PureLanguageSupport.d.ts","sourceRoot":"","sources":["../../../src/stores/pure-language/PureLanguageSupport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoBH,oBAAY,kBAAkB;IAC5B,UAAU,KAAK;IAEf,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,SAAS,cAAc;IAEvB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;IAEnB,eAAe,oBAAoB;IACnC,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,SAAS,aAAa;IACtB,QAAQ,aAAa;IACrB,IAAI,SAAS;IAEb,OAAO,YAAY;CACpB;AAwaD,eAAO,MAAM,wBAAwB,kBACpB,MAAM,EAAE,uBACF,MAAM,EAAE,KAC5B,IAWF,CAAC"}
|