@finos/legend-application-studio 26.1.0 → 26.1.2
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__/LegendStudioApplicationNavigationContext.d.ts +2 -1
- package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioApplicationNavigationContext.js +1 -0
- package/lib/__lib__/LegendStudioApplicationNavigationContext.js.map +1 -1
- package/lib/__lib__/STO_Relational_LegendStudioCommand.d.ts +21 -0
- package/lib/__lib__/STO_Relational_LegendStudioCommand.d.ts.map +1 -0
- package/lib/__lib__/STO_Relational_LegendStudioCommand.js +28 -0
- package/lib/__lib__/STO_Relational_LegendStudioCommand.js.map +1 -0
- package/lib/application/LegendStudioApplicationConfig.d.ts +5 -5
- package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendStudioApplicationConfig.js +6 -6
- package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
- package/lib/components/ElementIconUtils.d.ts +13 -2
- package/lib/components/ElementIconUtils.d.ts.map +1 -1
- package/lib/components/ElementIconUtils.js +15 -6
- package/lib/components/ElementIconUtils.js.map +1 -1
- package/lib/components/editor/Editor.d.ts.map +1 -1
- package/lib/components/editor/Editor.js +2 -1
- package/lib/components/editor/Editor.js.map +1 -1
- package/lib/components/editor/QuickInput.d.ts +19 -0
- package/lib/components/editor/QuickInput.d.ts.map +1 -0
- package/lib/components/editor/QuickInput.js +51 -0
- package/lib/components/editor/QuickInput.js.map +1 -0
- package/lib/components/editor/__test-utils__/EditorComponentTestUtils.d.ts.map +1 -1
- package/lib/components/editor/__test-utils__/EditorComponentTestUtils.js +5 -1
- package/lib/components/editor/__test-utils__/EditorComponentTestUtils.js.map +1 -1
- package/lib/components/editor/command-center/ProjectSearchCommand.js +3 -3
- package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
- package/lib/components/editor/editor-group/EditorGroup.d.ts.map +1 -1
- package/lib/components/editor/editor-group/EditorGroup.js +11 -4
- package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
- package/lib/components/editor/editor-group/FunctionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/FunctionEditor.js +30 -8
- package/lib/components/editor/editor-group/FunctionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/GenerationSpecificationEditor.js +1 -1
- package/lib/components/editor/editor-group/GenerationSpecificationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/GrammarTextEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/GrammarTextEditor.js +99 -100
- package/lib/components/editor/editor-group/GrammarTextEditor.js.map +1 -1
- package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.d.ts.map +1 -1
- package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.js +5 -5
- package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.js.map +1 -1
- package/lib/components/editor/editor-group/RuntimeEditor.js +1 -1
- package/lib/components/editor/editor-group/RuntimeEditor.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js +27 -19
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +2 -2
- package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.js +5 -5
- package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.js.map +1 -1
- package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.js +2 -2
- package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.js +1 -1
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/ClassMappingEditor.js +1 -1
- package/lib/components/editor/editor-group/mapping-editor/ClassMappingEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingExplorer.js +2 -2
- package/lib/components/editor/editor-group/mapping-editor/MappingExplorer.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/PropertyMappingsEditor.js +1 -1
- package/lib/components/editor/editor-group/mapping-editor/PropertyMappingsEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js +4 -6
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js +2 -2
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js +2 -2
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/AssociationEditor.js +2 -2
- package/lib/components/editor/editor-group/uml-editor/AssociationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/ClassEditor.js +4 -4
- package/lib/components/editor/editor-group/uml-editor/ClassEditor.js.map +1 -1
- package/lib/components/editor/panel-group/PanelGroup.d.ts +2 -0
- package/lib/components/editor/panel-group/PanelGroup.d.ts.map +1 -1
- package/lib/components/editor/panel-group/PanelGroup.js +18 -3
- package/lib/components/editor/panel-group/PanelGroup.js.map +1 -1
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts +26 -0
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts.map +1 -0
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.js +339 -0
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.js.map +1 -0
- package/lib/components/editor/side-bar/Explorer.js +5 -6
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.js +1 -1
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.js.map +1 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js +5 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +2 -2
- package/lib/stores/editor/EditorConfig.d.ts +2 -1
- package/lib/stores/editor/EditorConfig.d.ts.map +1 -1
- package/lib/stores/editor/EditorConfig.js +1 -0
- package/lib/stores/editor/EditorConfig.js.map +1 -1
- package/lib/stores/editor/EditorStore.d.ts +8 -2
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +19 -4
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/GraphEditFormModeState.d.ts.map +1 -1
- package/lib/stores/editor/GraphEditFormModeState.js +1 -0
- package/lib/stores/editor/GraphEditFormModeState.js.map +1 -1
- package/lib/stores/editor/QuickInputState.d.ts +28 -0
- package/lib/stores/editor/QuickInputState.d.ts.map +1 -0
- package/lib/stores/editor/QuickInputState.js +17 -0
- package/lib/stores/editor/QuickInputState.js.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +22 -2
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +181 -4
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.js +6 -2
- package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +19 -18
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js +167 -157
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.d.ts +3 -3
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.js +2 -2
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +8 -9
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js +9 -14
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts +4 -4
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +16 -51
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js +3 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js.map +1 -1
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts +82 -0
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts.map +1 -0
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js +328 -0
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js.map +1 -0
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.d.ts +1 -1
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.js +8 -2
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.js.map +1 -1
- package/package.json +12 -12
- package/src/__lib__/LegendStudioApplicationNavigationContext.ts +2 -0
- package/src/__lib__/STO_Relational_LegendStudioCommand.ts +30 -0
- package/src/application/LegendStudioApplicationConfig.ts +7 -7
- package/src/components/ElementIconUtils.tsx +23 -8
- package/src/components/editor/Editor.tsx +2 -0
- package/src/components/editor/QuickInput.tsx +91 -0
- package/src/components/editor/__test-utils__/EditorComponentTestUtils.tsx +5 -1
- package/src/components/editor/command-center/ProjectSearchCommand.tsx +4 -4
- package/src/components/editor/editor-group/EditorGroup.tsx +41 -1
- package/src/components/editor/editor-group/FunctionEditor.tsx +145 -5
- package/src/components/editor/editor-group/GenerationSpecificationEditor.tsx +1 -1
- package/src/components/editor/editor-group/GrammarTextEditor.tsx +134 -131
- package/src/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.tsx +26 -13
- package/src/components/editor/editor-group/RuntimeEditor.tsx +1 -1
- package/src/components/editor/editor-group/connection-editor/DatabaseBuilder.tsx +193 -150
- package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +2 -2
- package/src/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.tsx +6 -5
- package/src/components/editor/editor-group/element-generation-editor/FileGenerationEditor.tsx +1 -1
- package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.tsx +1 -1
- package/src/components/editor/editor-group/mapping-editor/ClassMappingEditor.tsx +1 -1
- package/src/components/editor/editor-group/mapping-editor/MappingExplorer.tsx +2 -2
- package/src/components/editor/editor-group/mapping-editor/PropertyMappingsEditor.tsx +1 -1
- package/src/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.tsx +8 -10
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx +2 -2
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.tsx +9 -3
- package/src/components/editor/editor-group/uml-editor/AssociationEditor.tsx +2 -2
- package/src/components/editor/editor-group/uml-editor/ClassEditor.tsx +4 -4
- package/src/components/editor/panel-group/PanelGroup.tsx +35 -3
- package/src/components/editor/panel-group/SQLPlaygroundPanel.tsx +730 -0
- package/src/components/editor/side-bar/Explorer.tsx +5 -5
- package/src/components/editor/side-bar/testable/GlobalTestRunner.tsx +1 -1
- package/src/components/extensions/Core_LegendStudioApplicationPlugin.tsx +9 -3
- package/src/stores/editor/EditorConfig.ts +1 -0
- package/src/stores/editor/EditorStore.ts +23 -4
- package/src/stores/editor/GraphEditFormModeState.ts +1 -0
- package/src/stores/editor/QuickInputState.ts +24 -0
- package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +317 -3
- package/src/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.ts +11 -2
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +262 -249
- package/src/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.ts +5 -5
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +19 -23
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +30 -87
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.ts +4 -2
- package/src/stores/editor/panel-group/SQLPlaygroundPanelState.ts +485 -0
- package/src/stores/graph-modifier/DSL_Service_GraphModifierHelper.ts +13 -1
- package/tsconfig.json +5 -0
@@ -826,150 +826,153 @@ export const GrammarTextEditor = observer(() => {
|
|
826
826
|
}
|
827
827
|
// Disable editing if user is in viewer mode
|
828
828
|
editor.updateOptions({ readOnly: editorStore.isInViewerMode });
|
829
|
-
}
|
830
829
|
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
830
|
+
// hover
|
831
|
+
hoverProviderDisposer.current?.dispose();
|
832
|
+
hoverProviderDisposer.current = monacoLanguagesAPI.registerHoverProvider(
|
833
|
+
CODE_EDITOR_LANGUAGE.PURE,
|
834
|
+
{
|
835
|
+
provideHover: (model, position) => {
|
836
|
+
const currentWord = model.getWordAtPosition(position);
|
837
|
+
if (!currentWord) {
|
838
|
+
return { contents: [] };
|
839
|
+
}
|
841
840
|
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
);
|
852
|
-
// NOTE: we don't need to trim here since the leading whitespace in front of
|
853
|
-
// the section header is considered invalid syntax in the grammar
|
854
|
-
if (
|
855
|
-
!hasWhiteSpace(lineTextIncludingWord) &&
|
856
|
-
lineTextIncludingWord.startsWith(PARSER_SECTION_MARKER)
|
857
|
-
) {
|
858
|
-
const parserKeyword = lineTextIncludingWord.substring(
|
859
|
-
PARSER_SECTION_MARKER.length,
|
841
|
+
// show documention for parser section
|
842
|
+
const lineTextIncludingWordRange = {
|
843
|
+
startLineNumber: position.lineNumber,
|
844
|
+
startColumn: 1,
|
845
|
+
endLineNumber: position.lineNumber,
|
846
|
+
endColumn: currentWord.endColumn,
|
847
|
+
};
|
848
|
+
const lineTextIncludingWord = model.getValueInRange(
|
849
|
+
lineTextIncludingWordRange,
|
860
850
|
);
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
851
|
+
// NOTE: we don't need to trim here since the leading whitespace in front of
|
852
|
+
// the section header is considered invalid syntax in the grammar
|
853
|
+
if (
|
854
|
+
!hasWhiteSpace(lineTextIncludingWord) &&
|
855
|
+
lineTextIncludingWord.startsWith(PARSER_SECTION_MARKER)
|
856
|
+
) {
|
857
|
+
const parserKeyword = lineTextIncludingWord.substring(
|
858
|
+
PARSER_SECTION_MARKER.length,
|
859
|
+
);
|
860
|
+
const doc = getParserDocumetation(editorStore, parserKeyword);
|
861
|
+
if (doc) {
|
862
|
+
return {
|
863
|
+
range: lineTextIncludingWordRange,
|
864
|
+
contents: [
|
865
|
+
doc.markdownText
|
866
|
+
? {
|
867
|
+
value: doc.markdownText.value,
|
868
|
+
}
|
869
|
+
: undefined,
|
870
|
+
doc.url
|
871
|
+
? {
|
872
|
+
value: `[See documentation](${doc.url})`,
|
873
|
+
}
|
874
|
+
: undefined,
|
875
|
+
].filter(isNonNullable),
|
876
|
+
};
|
877
|
+
}
|
878
878
|
}
|
879
|
-
}
|
880
879
|
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
);
|
896
|
-
if (currentSectionParserKeyword) {
|
897
|
-
const doc = getParserElementDocumentation(
|
898
|
-
editorStore,
|
899
|
-
currentSectionParserKeyword,
|
900
|
-
currentWord.word,
|
880
|
+
// show documentation for parser element
|
881
|
+
const textUntilPosition = model.getValueInRange({
|
882
|
+
startLineNumber: 1,
|
883
|
+
startColumn: 1,
|
884
|
+
endLineNumber: position.lineNumber,
|
885
|
+
endColumn: position.column,
|
886
|
+
});
|
887
|
+
const allParserSectionHeaders =
|
888
|
+
// NOTE: since `###Pure` is implicitly considered as the first section, we prepend it to the text
|
889
|
+
`${PARSER_SECTION_MARKER}${PURE_PARSER.PURE}\n${textUntilPosition}`
|
890
|
+
.split('\n')
|
891
|
+
.filter((line) => line.startsWith(PARSER_SECTION_MARKER));
|
892
|
+
const currentSectionParserKeyword = getSectionParserNameFromLineText(
|
893
|
+
allParserSectionHeaders[allParserSectionHeaders.length - 1] ?? '',
|
901
894
|
);
|
902
|
-
if (
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
895
|
+
if (currentSectionParserKeyword) {
|
896
|
+
const doc = getParserElementDocumentation(
|
897
|
+
editorStore,
|
898
|
+
currentSectionParserKeyword,
|
899
|
+
currentWord.word,
|
900
|
+
);
|
901
|
+
if (doc) {
|
902
|
+
return {
|
903
|
+
range: {
|
904
|
+
startLineNumber: position.lineNumber,
|
905
|
+
startColumn: currentWord.startColumn,
|
906
|
+
endLineNumber: position.lineNumber,
|
907
|
+
endColumn: currentWord.endColumn,
|
908
|
+
},
|
909
|
+
contents: [
|
910
|
+
doc.markdownText
|
911
|
+
? {
|
912
|
+
value: doc.markdownText.value,
|
913
|
+
}
|
914
|
+
: undefined,
|
915
|
+
doc.url
|
916
|
+
? {
|
917
|
+
value: `[See documentation](${doc.url})`,
|
918
|
+
}
|
919
|
+
: undefined,
|
920
|
+
].filter(isNonNullable),
|
921
|
+
};
|
922
|
+
}
|
923
923
|
}
|
924
|
-
}
|
925
924
|
|
926
|
-
|
925
|
+
return { contents: [] };
|
926
|
+
},
|
927
927
|
},
|
928
|
-
|
929
|
-
);
|
928
|
+
);
|
930
929
|
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
930
|
+
// suggestion
|
931
|
+
suggestionProviderDisposer.current?.dispose();
|
932
|
+
suggestionProviderDisposer.current =
|
933
|
+
monacoLanguagesAPI.registerCompletionItemProvider(
|
934
|
+
CODE_EDITOR_LANGUAGE.PURE,
|
935
|
+
{
|
936
|
+
// NOTE: we need to specify this to show suggestions for section
|
937
|
+
// because by default, only alphanumeric characters trigger completion item provider
|
938
|
+
// See https://microsoft.github.io/monaco-editor/api/interfaces/monaco.languages.CompletionContext.html#triggerCharacter
|
939
|
+
// See https://github.com/microsoft/monaco-editor/issues/2530#issuecomment-861757198
|
940
|
+
triggerCharacters: ['#'],
|
941
|
+
provideCompletionItems: (model, position) => {
|
942
|
+
let suggestions: monacoLanguagesAPI.CompletionItem[] = [];
|
944
943
|
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
944
|
+
// suggestions for parser keyword
|
945
|
+
suggestions = suggestions.concat(
|
946
|
+
getParserKeywordSuggestions(
|
947
|
+
position,
|
948
|
+
model,
|
949
|
+
collectParserKeywordSuggestions(editorStore),
|
950
|
+
),
|
951
|
+
);
|
953
952
|
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
953
|
+
// suggestions for parser element snippets
|
954
|
+
suggestions = suggestions.concat(
|
955
|
+
getParserElementSnippetSuggestions(
|
956
|
+
position,
|
957
|
+
model,
|
958
|
+
(parserName: string) =>
|
959
|
+
collectParserElementSnippetSuggestions(
|
960
|
+
editorStore,
|
961
|
+
parserName,
|
962
|
+
),
|
963
|
+
),
|
964
|
+
);
|
963
965
|
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
966
|
+
// inline code snippet suggestions
|
967
|
+
suggestions = suggestions.concat(
|
968
|
+
getInlineSnippetSuggestions(position, model),
|
969
|
+
);
|
968
970
|
|
969
|
-
|
971
|
+
return { suggestions };
|
972
|
+
},
|
970
973
|
},
|
971
|
-
|
972
|
-
|
974
|
+
);
|
975
|
+
}
|
973
976
|
|
974
977
|
useEffect(() => {
|
975
978
|
if (editor && forcedCursorPosition) {
|
@@ -983,8 +986,8 @@ export const GrammarTextEditor = observer(() => {
|
|
983
986
|
if (editor) {
|
984
987
|
disposeCodeEditor(editor);
|
985
988
|
}
|
986
|
-
|
987
|
-
//
|
989
|
+
|
990
|
+
// Dispose the providers properly to avoid ending up with duplicated suggestions
|
988
991
|
hoverProviderDisposer.current?.dispose();
|
989
992
|
suggestionProviderDisposer.current?.dispose();
|
990
993
|
},
|
@@ -17,7 +17,7 @@
|
|
17
17
|
import { observer } from 'mobx-react-lite';
|
18
18
|
import { useEditorStore } from '../EditorStoreProvider.js';
|
19
19
|
import { INTERNAL__UnknownFunctionActivatorEdtiorState } from '../../../stores/editor/editor-state/element-editor-state/INTERNAL__UnknownFunctionActivatorEditorState.js';
|
20
|
-
import { BlankPanelContent, Panel } from '@finos/legend-art';
|
20
|
+
import { ArrowRightIcon, BlankPanelContent, Panel } from '@finos/legend-art';
|
21
21
|
import { useApplicationStore } from '@finos/legend-application';
|
22
22
|
import { flowResult } from 'mobx';
|
23
23
|
import { ProtocolValueBuilder } from './ProtocolValueBuilder.js';
|
@@ -80,18 +80,31 @@ export const INTERNAL__UnknownFunctionActivatorEdtior = observer(() => {
|
|
80
80
|
{functionFieldDocumentation}
|
81
81
|
</div>
|
82
82
|
)}
|
83
|
-
<
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
83
|
+
<div className="function-activator-editor__function-pointer">
|
84
|
+
<input
|
85
|
+
className="panel__content__form__section__input"
|
86
|
+
spellCheck={false}
|
87
|
+
disabled={true}
|
88
|
+
value={generateFunctionPrettyName(
|
89
|
+
editorState.activator.function.value,
|
90
|
+
{
|
91
|
+
fullPath: true,
|
92
|
+
spacing: false,
|
93
|
+
},
|
94
|
+
)}
|
95
|
+
/>
|
96
|
+
<button
|
97
|
+
className="function-activator-editor__function-pointer__visit-btn btn--dark"
|
98
|
+
title="Go to Function"
|
99
|
+
onClick={() =>
|
100
|
+
editorStore.graphEditorMode.openElement(
|
101
|
+
editorState.activator.function.value,
|
102
|
+
)
|
103
|
+
}
|
104
|
+
>
|
105
|
+
<ArrowRightIcon />
|
106
|
+
</button>
|
107
|
+
</div>
|
95
108
|
</div>
|
96
109
|
<div className="panel__content__form__section">
|
97
110
|
<div className="panel__content__form__section__divider"></div>
|
@@ -261,7 +261,7 @@ const getRuntimeExplorerTreeNodeIcon = (
|
|
261
261
|
} else if (node.data instanceof Connection) {
|
262
262
|
return <PURE_ConnectionIcon />;
|
263
263
|
}
|
264
|
-
return getElementIcon(
|
264
|
+
return getElementIcon(node.data, editorStore);
|
265
265
|
};
|
266
266
|
|
267
267
|
const getRuntimeExplorerTreeNodeTooltipText = (
|