@loopstack/loopstack-studio 0.28.0 → 0.29.1
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/dist/_virtual/rolldown_runtime.js +13 -15
- package/dist/api/config.js +2 -2
- package/dist/components/dynamic-form/Form.js +49 -52
- package/dist/config.js +6 -0
- package/dist/features/debug/components/WorkflowFlowViewer.js +94 -81
- package/dist/features/debug/components/workflow-flow/StateNode.js +154 -79
- package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +43 -31
- package/dist/features/debug/components/workflow-flow/WorkflowTransitionEdge.js +52 -51
- package/dist/features/debug/lib/edge-paths.js +45 -30
- package/dist/features/debug/lib/flow-types.js +2 -0
- package/dist/features/debug/lib/flow-utils.js +66 -64
- package/dist/features/documents/components/DocumentList.js +19 -18
- package/dist/features/workbench/WorkflowItem.js +4 -3
- package/dist/features/workbench/components/EmbedLogsContent.js +5 -0
- package/dist/features/workbench/components/NewRunDialog.js +2 -2
- package/dist/features/workbench/components/PreviewEmptyState.js +10 -0
- package/dist/features/workbench/components/PreviewWorkbench.js +14 -0
- package/dist/features/workbench/components/RecentRunItem.js +48 -0
- package/dist/features/workbench/components/WorkflowForms.js +4 -3
- package/dist/features/workbench/hooks/useEmbedBridge.js +3 -0
- package/dist/features/workbench/hooks/useWorkflowData.js +9 -9
- package/dist/features/workbench/index.js +4 -0
- package/dist/features/workspaces/Workspaces.js +2 -2
- package/dist/features/workspaces/components/ExecutionTimeline.js +9 -8
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/query-keys.js +3 -3
- package/dist/hooks/useConfig.js +15 -15
- package/dist/index.d.ts +12 -12
- package/dist/index.js +3 -3
- package/dist/loopstack-studio.css +1 -1
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{architecture-YZFGNWBL.js → architecture-7EHR7CIX.js} +2 -2
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-7N4EOEYR.js → chunk-4EGX6M5U.js} +9 -13
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-KGLVRYIC.js → chunk-5DO6E6H7.js} +3 -7
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-BR22UD5L.js +56 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-2KRD3SAO.js → chunk-FHYWG6QK.js} +3 -7
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-FOC6F5B3.js → chunk-MPE355IW.js} +3 -7
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-MZUSXYTE.js +24 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-N66VUXT2.js +48 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-NNHCCRGN.js +20219 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-PUPMXCY4.js +19 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-67CJDMHE.js → chunk-UIBZB4QT.js} +3 -7
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-WCWK7LTN.js +25 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/eventmodeling-FCH6USID.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{gitGraph-7Q5UKJZL.js → gitGraph-WXDBUCRP.js} +2 -2
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-J43DQDTF.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-YPE3B663.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-LRSECV5Y.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-GUYGQ44K.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{treeView-SZITEDCU.js → treeView-BLDUP644.js} +2 -2
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-LRROVOQU.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-L42UT6IY.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js +24 -19
- package/dist/node_modules/@ungap/structured-clone/esm/deserialize.js +36 -26
- package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
- package/dist/node_modules/cytoscape/dist/cytoscape.esm.js +257 -254
- package/dist/node_modules/dagre-d3-es/src/dagre/greedy-fas.js +19 -19
- package/dist/node_modules/dagre-d3-es/src/dagre/layout.js +48 -48
- package/dist/node_modules/dagre-d3-es/src/dagre/nesting-graph.js +9 -9
- package/dist/node_modules/dagre-d3-es/src/dagre/order/cross-count.js +3 -3
- package/dist/node_modules/dagre-d3-es/src/dagre/order/index.js +11 -11
- package/dist/node_modules/dagre-d3-es/src/dagre/order/init-order.js +4 -4
- package/dist/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js +4 -4
- package/dist/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js +8 -8
- package/dist/node_modules/dagre-d3-es/src/dagre/order/sort.js +5 -5
- package/dist/node_modules/dagre-d3-es/src/dagre/position/bk.js +72 -72
- package/dist/node_modules/dagre-d3-es/src/dagre/position/index.js +1 -1
- package/dist/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js +25 -25
- package/dist/node_modules/dagre-d3-es/src/dagre/rank/util.js +8 -8
- package/dist/node_modules/dagre-d3-es/src/dagre/util.js +48 -48
- package/dist/node_modules/dagre-d3-es/src/graphlib/graph.js +109 -109
- package/dist/node_modules/dagre-d3-es/src/graphlib/json.js +17 -17
- package/dist/node_modules/dompurify/dist/purify.es.js +293 -205
- package/dist/node_modules/es-toolkit/dist/_internal/globalThis.js +4 -0
- package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js +4 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js +4 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/getTag.js +4 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js +5 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/tags.js +2 -0
- package/dist/node_modules/es-toolkit/dist/compat/function/memoize.js +12 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/clone.js +97 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +5 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js +29 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/merge.js +6 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/mergeWith.js +49 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArguments.js +5 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArray.js +4 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js +5 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js +6 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js +16 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js +4 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js +12 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js +5 -0
- package/dist/node_modules/es-toolkit/dist/function/noop.js +2 -0
- package/dist/node_modules/es-toolkit/dist/object/clone.js +29 -0
- package/dist/node_modules/es-toolkit/dist/object/cloneDeepWith.js +114 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isBuffer.js +5 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isLength.js +4 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isPrimitive.js +4 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isTypedArray.js +4 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.js +2 -2
- package/dist/node_modules/internmap/src/index.js +1 -1
- package/dist/node_modules/katex/dist/katex.js +379 -417
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +3 -3
- package/dist/node_modules/lodash-es/_assignMergeValue.js +1 -1
- package/dist/node_modules/lodash-es/_assignValue.js +1 -1
- package/dist/node_modules/lodash-es/_baseClone.js +9 -9
- package/dist/node_modules/lodash-es/_baseForOwn.js +1 -1
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +1 -1
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +6 -6
- package/dist/node_modules/lodash-es/_baseMerge.js +2 -2
- package/dist/node_modules/lodash-es/_baseMergeDeep.js +7 -7
- package/dist/node_modules/lodash-es/_baseOrderBy.js +12 -12
- package/dist/node_modules/lodash-es/_baseRest.js +1 -1
- package/dist/node_modules/lodash-es/_baseSet.js +1 -1
- package/dist/node_modules/lodash-es/_baseSetToString.js +3 -3
- package/dist/node_modules/lodash-es/_baseToString.js +2 -2
- package/dist/node_modules/lodash-es/_baseUniq.js +1 -1
- package/dist/node_modules/lodash-es/_createRange.js +1 -1
- package/dist/node_modules/lodash-es/_createSet.js +3 -3
- package/dist/node_modules/lodash-es/_flatRest.js +1 -1
- package/dist/node_modules/lodash-es/_getAllKeys.js +2 -2
- package/dist/node_modules/lodash-es/_getAllKeysIn.js +1 -1
- package/dist/node_modules/lodash-es/_getSymbolsIn.js +1 -1
- package/dist/node_modules/lodash-es/_getTag.js +1 -1
- package/dist/node_modules/lodash-es/_hasPath.js +2 -2
- package/dist/node_modules/lodash-es/_initCloneByTag.js +1 -1
- package/dist/node_modules/lodash-es/_initCloneObject.js +1 -1
- package/dist/node_modules/lodash-es/_isFlattenable.js +1 -1
- package/dist/node_modules/lodash-es/_isIterateeCall.js +1 -1
- package/dist/node_modules/lodash-es/_isKey.js +1 -1
- package/dist/node_modules/lodash-es/_setToString.js +1 -1
- package/dist/node_modules/lodash-es/defaults.js +1 -1
- package/dist/node_modules/lodash-es/findIndex.js +2 -2
- package/dist/node_modules/lodash-es/forEach.js +1 -1
- package/dist/node_modules/lodash-es/forIn.js +1 -1
- package/dist/node_modules/lodash-es/isEmpty.js +2 -2
- package/dist/node_modules/lodash-es/isPlainObject.js +1 -1
- package/dist/node_modules/lodash-es/map.js +1 -1
- package/dist/node_modules/lodash-es/max.js +1 -1
- package/dist/node_modules/lodash-es/merge.js +3 -3
- package/dist/node_modules/lodash-es/min.js +1 -1
- package/dist/node_modules/lodash-es/minBy.js +1 -1
- package/dist/node_modules/lodash-es/reduce.js +1 -1
- package/dist/node_modules/lodash-es/toNumber.js +1 -1
- package/dist/node_modules/lodash-es/union.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{architectureDiagram-Q4EWVU46.js → architectureDiagram-3BPJPVTR.js} +310 -308
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{blockDiagram-DXYQGD6D.js → blockDiagram-GPEHLZMM.js} +215 -190
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{c4Diagram-AHTNJAMY.js → c4Diagram-AAUBKEIU.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-EDXVE4YY.js → chunk-2J33WTMH.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-5FUZZQ4R.js → chunk-3OPIFGDE.js} +48 -20
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-5PVQY5BW.js → chunk-5ZQYHXKU.js} +8 -8
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-4TB4RGXK.js → chunk-727SXJPM.js} +555 -459
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-OYMX7WX6.js → chunk-AQP2D5EJ.js} +155 -145
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ICPOFSXX.js → chunk-CSCIHK7Q.js} +106 -12
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ENJZ2VHE.js → chunk-KSCS5N6A.js} +12 -12
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ZZ45TVLE.js → chunk-L5ZTLDWV.js} +2 -2
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-336JU56O.js → chunk-LZXEDZCA.js} +5 -5
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-YZCP3GAM.js → chunk-ND2GUHAM.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-X2U36JSP.js → chunk-NZK2D7GU.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-U2HBQHQK.js → chunk-O5CBEL6O.js} +2 -2
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-426QAEUC.js → chunk-WU5MYG2G.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-6PBFFD2Q.js → classDiagram-4FO5ZUOK.js} +11 -11
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-v2-HSJHXN6E.js → classDiagram-v2-Q7XG4LA2.js} +11 -11
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{dagre-KV5264BT.js → dagre-BM42HDAG.js} +8 -8
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-MMDJMWI5.js → diagram-2AECGRRQ.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-5BDNPKRD.js → diagram-5GNKFQAL.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +433 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-TYMM5635.js → diagram-LMA3HP47.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-G4DWMVQ6.js → diagram-OG6HWLK6.js} +5 -5
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{erDiagram-SMLLAGMA.js → erDiagram-TEJ5UH35.js} +9 -9
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{flowDiagram-DWJPFMVM.js → flowDiagram-I6XJVG4X.js} +10 -10
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{ganttDiagram-T4ZO3ILL.js → ganttDiagram-6RSMTGT7.js} +7 -4
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{gitGraphDiagram-UUTBAWPF.js → gitGraphDiagram-PVQCEYII.js} +2 -2
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{infoDiagram-42DDH7IO.js → infoDiagram-5YYISTIA.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{ishikawaDiagram-UXIWVN3A.js → ishikawaDiagram-YF4QCWOH.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{journeyDiagram-VCZTEJTY.js → journeyDiagram-JHISSGLW.js} +2 -2
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{kanban-definition-6JOO6SKY.js → kanban-definition-UN3LZRKU.js} +7 -7
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{mindmap-definition-QFDTVHPH.js → mindmap-definition-RKZ34NQL.js} +9 -9
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{pieDiagram-DEJITSTG.js → pieDiagram-4H26LBE5.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{quadrantDiagram-34T5L4WZ.js → quadrantDiagram-W4KKPZXB.js} +364 -337
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{requirementDiagram-MS252O5E.js → requirementDiagram-4Y6WPE33.js} +9 -9
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{sankeyDiagram-XADWPNL6.js → sankeyDiagram-5OEKKPKP.js} +187 -138
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{sequenceDiagram-FGHM5R23.js → sequenceDiagram-3UESZ5HK.js} +15 -8
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-FHFEXIEX.js → stateDiagram-AJRCARHV.js} +10 -10
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-v2-QKLJ7IA2.js → stateDiagram-v2-BHNVJYJU.js} +10 -10
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{timeline-definition-GMOUNBTQ.js → timeline-definition-PNZ67QCA.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{vennDiagram-DHZGUBPP.js → vennDiagram-CIIHVFJN.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-YWT4CUSO.js +640 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{xychartDiagram-5P7HB3ND.js → xychartDiagram-2RQKCTM6.js} +4 -4
- package/dist/node_modules/mermaid/dist/mermaid.core.js +96 -70
- package/dist/node_modules/stylis/src/Enum.js +2 -2
- package/dist/node_modules/stylis/src/Middleware.js +9 -0
- package/dist/node_modules/stylis/src/Parser.js +55 -44
- package/dist/node_modules/stylis/src/Utility.js +9 -12
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/packages/contracts/dist/enums/index.js +4 -24
- package/dist/packages/contracts/dist/enums/registry.enum.js +9 -20
- package/dist/packages/contracts/dist/enums/sort-order.enum.js +5 -10
- package/dist/packages/contracts/dist/enums/user-type.enum.js +5 -10
- package/dist/packages/contracts/dist/enums/workflow-state.enum.js +5 -10
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
- package/dist/pages/DebugWorkflowsPage.js +12 -12
- package/dist/pages/EmbedWorkbenchPage.js +4 -3
- package/dist/pages/PreviewWorkbenchPage.js +126 -124
- package/dist/pages/StudioLandingPage.js +28 -72
- package/dist/pages/WorkspacePage.js +2 -2
- package/package.json +2 -2
- package/dist/node_modules/@chevrotain/gast/lib/src/helpers.js +0 -23
- package/dist/node_modules/@chevrotain/gast/lib/src/model.js +0 -151
- package/dist/node_modules/@chevrotain/gast/lib/src/visitor.js +0 -40
- package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/api.js +0 -2
- package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/base-regexp-visitor.js +0 -85
- package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/character-classes.js +0 -35
- package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/regexp-parser.js +0 -570
- package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/utils.js +0 -25
- package/dist/node_modules/@chevrotain/utils/lib/src/print.js +0 -9
- package/dist/node_modules/@chevrotain/utils/lib/src/timer.js +0 -8
- package/dist/node_modules/@chevrotain/utils/lib/src/to-fast-properties.js +0 -10
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-AA7GKIK3.js +0 -28
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-CIAEETIT.js +0 -23
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-K5T4RW27.js +0 -1197
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-LIHQZDEY.js +0 -60
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ORNJ4GCN.js +0 -29
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-OMHHGYJF.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-4T2RLAQJ.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-ZZUOXDRM.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-PYXPWWZC.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-W4RFUUIX.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-RL74JXVD.js +0 -3
- package/dist/node_modules/chevrotain/lib/src/api.js +0 -10
- package/dist/node_modules/chevrotain/lib/src/lang/lang_extensions.js +0 -10
- package/dist/node_modules/chevrotain/lib/src/parse/constants.js +0 -2
- package/dist/node_modules/chevrotain/lib/src/parse/cst/cst.js +0 -13
- package/dist/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js +0 -49
- package/dist/node_modules/chevrotain/lib/src/parse/errors_public.js +0 -77
- package/dist/node_modules/chevrotain/lib/src/parse/exceptions_public.js +0 -33
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/checks.js +0 -275
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/first.js +0 -23
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/follow.js +0 -28
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js +0 -14
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js +0 -262
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/keys.js +0 -5
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js +0 -41
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js +0 -241
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/resolver.js +0 -30
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/rest.js +0 -56
- package/dist/node_modules/chevrotain/lib/src/parse/parser/parser.js +0 -114
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js +0 -46
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js +0 -166
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js +0 -43
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js +0 -107
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js +0 -21
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js +0 -312
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js +0 -285
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js +0 -144
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js +0 -92
- package/dist/node_modules/chevrotain/lib/src/parse/parser/utils/apply_mixins.js +0 -11
- package/dist/node_modules/chevrotain/lib/src/scan/lexer.js +0 -437
- package/dist/node_modules/chevrotain/lib/src/scan/lexer_errors_public.js +0 -9
- package/dist/node_modules/chevrotain/lib/src/scan/lexer_public.js +0 -253
- package/dist/node_modules/chevrotain/lib/src/scan/reg_exp.js +0 -152
- package/dist/node_modules/chevrotain/lib/src/scan/reg_exp_parser.js +0 -15
- package/dist/node_modules/chevrotain/lib/src/scan/tokens.js +0 -65
- package/dist/node_modules/chevrotain/lib/src/scan/tokens_public.js +0 -39
- package/dist/node_modules/chevrotain-allstar/lib/all-star-lookahead.js +0 -346
- package/dist/node_modules/chevrotain-allstar/lib/atn.js +0 -194
- package/dist/node_modules/chevrotain-allstar/lib/dfa.js +0 -32
- package/dist/node_modules/chevrotain-allstar/lib/index.js +0 -1
- package/dist/node_modules/langium/lib/default-module.js +0 -85
- package/dist/node_modules/langium/lib/dependency-injection.js +0 -62
- package/dist/node_modules/langium/lib/documentation/comment-provider.js +0 -11
- package/dist/node_modules/langium/lib/documentation/documentation-provider.js +0 -36
- package/dist/node_modules/langium/lib/documentation/jsdoc.js +0 -303
- package/dist/node_modules/langium/lib/index.js +0 -182
- package/dist/node_modules/langium/lib/languages/generated/ast.js +0 -1089
- package/dist/node_modules/langium/lib/languages/grammar-config.js +0 -13
- package/dist/node_modules/langium/lib/parser/async-parser.js +0 -83
- package/dist/node_modules/langium/lib/parser/completion-parser-builder.js +0 -7
- package/dist/node_modules/langium/lib/parser/cst-node-builder.js +0 -160
- package/dist/node_modules/langium/lib/parser/indentation-aware.js +0 -141
- package/dist/node_modules/langium/lib/parser/langium-parser-builder.js +0 -11
- package/dist/node_modules/langium/lib/parser/langium-parser.js +0 -388
- package/dist/node_modules/langium/lib/parser/lexer.js +0 -50
- package/dist/node_modules/langium/lib/parser/parser-builder-base.js +0 -275
- package/dist/node_modules/langium/lib/parser/token-builder.js +0 -61
- package/dist/node_modules/langium/lib/parser/value-converter.js +0 -78
- package/dist/node_modules/langium/lib/references/linker.js +0 -190
- package/dist/node_modules/langium/lib/references/name-provider.js +0 -13
- package/dist/node_modules/langium/lib/references/references.js +0 -76
- package/dist/node_modules/langium/lib/references/scope-computation.js +0 -35
- package/dist/node_modules/langium/lib/references/scope-provider.js +0 -34
- package/dist/node_modules/langium/lib/references/scope.js +0 -73
- package/dist/node_modules/langium/lib/serializer/hydrator.js +0 -125
- package/dist/node_modules/langium/lib/serializer/json-serializer.js +0 -145
- package/dist/node_modules/langium/lib/service-registry.js +0 -37
- package/dist/node_modules/langium/lib/syntax-tree.js +0 -70
- package/dist/node_modules/langium/lib/utils/ast-utils.js +0 -157
- package/dist/node_modules/langium/lib/utils/caching.js +0 -91
- package/dist/node_modules/langium/lib/utils/cancellation.js +0 -5
- package/dist/node_modules/langium/lib/utils/collections.js +0 -85
- package/dist/node_modules/langium/lib/utils/cst-utils.js +0 -190
- package/dist/node_modules/langium/lib/utils/disposable.js +0 -8
- package/dist/node_modules/langium/lib/utils/errors.js +0 -12
- package/dist/node_modules/langium/lib/utils/event.js +0 -5
- package/dist/node_modules/langium/lib/utils/grammar-loader.js +0 -22
- package/dist/node_modules/langium/lib/utils/grammar-utils.js +0 -296
- package/dist/node_modules/langium/lib/utils/index.js +0 -53
- package/dist/node_modules/langium/lib/utils/promise-utils.js +0 -30
- package/dist/node_modules/langium/lib/utils/regexp-utils.js +0 -167
- package/dist/node_modules/langium/lib/utils/stream.js +0 -327
- package/dist/node_modules/langium/lib/utils/uri-utils.js +0 -107
- package/dist/node_modules/langium/lib/validation/document-validator.js +0 -210
- package/dist/node_modules/langium/lib/validation/validation-registry.js +0 -87
- package/dist/node_modules/langium/lib/workspace/ast-descriptions.js +0 -57
- package/dist/node_modules/langium/lib/workspace/ast-node-locator.js +0 -28
- package/dist/node_modules/langium/lib/workspace/configuration.js +0 -51
- package/dist/node_modules/langium/lib/workspace/document-builder.js +0 -201
- package/dist/node_modules/langium/lib/workspace/documents.js +0 -142
- package/dist/node_modules/langium/lib/workspace/file-system-provider.js +0 -34
- package/dist/node_modules/langium/lib/workspace/index-manager.js +0 -49
- package/dist/node_modules/langium/lib/workspace/profiler.js +0 -89
- package/dist/node_modules/langium/lib/workspace/workspace-lock.js +0 -42
- package/dist/node_modules/langium/lib/workspace/workspace-manager.js +0 -66
- package/dist/node_modules/lodash-es/flatMap.js +0 -7
- package/dist/node_modules/lodash-es/uniqBy.js +0 -7
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-NUSXRM2D.js +0 -574
- package/dist/node_modules/vscode-jsonrpc/browser.js +0 -7
- package/dist/node_modules/vscode-jsonrpc/lib/browser/main.js +0 -52
- package/dist/node_modules/vscode-jsonrpc/lib/browser/ril.js +0 -120
- package/dist/node_modules/vscode-jsonrpc/lib/common/api.js +0 -337
- package/dist/node_modules/vscode-jsonrpc/lib/common/cancellation.js +0 -57
- package/dist/node_modules/vscode-jsonrpc/lib/common/connection.js +0 -647
- package/dist/node_modules/vscode-jsonrpc/lib/common/disposable.js +0 -13
- package/dist/node_modules/vscode-jsonrpc/lib/common/events.js +0 -64
- package/dist/node_modules/vscode-jsonrpc/lib/common/is.js +0 -34
- package/dist/node_modules/vscode-jsonrpc/lib/common/linkedMap.js +0 -235
- package/dist/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js +0 -93
- package/dist/node_modules/vscode-jsonrpc/lib/common/messageReader.js +0 -129
- package/dist/node_modules/vscode-jsonrpc/lib/common/messageWriter.js +0 -85
- package/dist/node_modules/vscode-jsonrpc/lib/common/messages.js +0 -161
- package/dist/node_modules/vscode-jsonrpc/lib/common/ral.js +0 -18
- package/dist/node_modules/vscode-jsonrpc/lib/common/semaphore.js +0 -44
- package/dist/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +0 -58
- package/dist/node_modules/vscode-languageserver-protocol/lib/browser/main.js +0 -28
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/api.js +0 -36
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/connection.js +0 -12
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/messages.js +0 -31
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js +0 -19
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js +0 -15
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js +0 -33
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js +0 -35
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js +0 -15
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js +0 -19
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js +0 -15
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.js +0 -674
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js +0 -19
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js +0 -126
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js +0 -24
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js +0 -31
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js +0 -19
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js +0 -15
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js +0 -42
- package/dist/node_modules/vscode-languageserver-textdocument/lib/esm/main.js +0 -138
- package/dist/node_modules/vscode-languageserver-types/lib/esm/main.js +0 -1084
- package/dist/node_modules/vscode-uri/lib/esm/index.js +0 -373
- /package/dist/node_modules/{entities → hast-util-raw/node_modules/entities}/dist/esm/decode-codepoint.js +0 -0
- /package/dist/node_modules/{entities → hast-util-raw/node_modules/entities}/dist/esm/decode.js +0 -0
- /package/dist/node_modules/{entities → hast-util-raw/node_modules/entities}/dist/esm/generated/decode-data-html.js +0 -0
- /package/dist/node_modules/{unified/node_modules/is-plain-obj → is-plain-obj}/index.js +0 -0
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { stream } from "../utils/stream.js";
|
|
2
|
-
import { assertUnreachable } from "../utils/errors.js";
|
|
3
|
-
import { isOperationCancelled } from "../utils/promise-utils.js";
|
|
4
|
-
import { MultiMap } from "../utils/collections.js";
|
|
5
|
-
import "../index.js";
|
|
6
|
-
function diagnosticData(e) {
|
|
7
|
-
return { code: e };
|
|
8
|
-
}
|
|
9
|
-
var ValidationCategory;
|
|
10
|
-
(function(e) {
|
|
11
|
-
e.defaults = [
|
|
12
|
-
"fast",
|
|
13
|
-
"slow",
|
|
14
|
-
"built-in"
|
|
15
|
-
], e.all = e.defaults;
|
|
16
|
-
})(ValidationCategory ||= {});
|
|
17
|
-
var ValidationRegistry = class {
|
|
18
|
-
constructor(e) {
|
|
19
|
-
this.entries = new MultiMap(), this.knownCategories = new Set(ValidationCategory.defaults), this.entriesBefore = [], this.entriesAfter = [], this.reflection = e.shared.AstReflection;
|
|
20
|
-
}
|
|
21
|
-
register(e, n = this, r = "fast") {
|
|
22
|
-
if (r === "built-in") throw Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");
|
|
23
|
-
this.knownCategories.add(r);
|
|
24
|
-
for (let [i, a] of Object.entries(e)) {
|
|
25
|
-
let e = a;
|
|
26
|
-
if (Array.isArray(e)) for (let t of e) {
|
|
27
|
-
let e = {
|
|
28
|
-
check: this.wrapValidationException(t, n),
|
|
29
|
-
category: r
|
|
30
|
-
};
|
|
31
|
-
this.addEntry(i, e);
|
|
32
|
-
}
|
|
33
|
-
else if (typeof e == "function") {
|
|
34
|
-
let t = {
|
|
35
|
-
check: this.wrapValidationException(e, n),
|
|
36
|
-
category: r
|
|
37
|
-
};
|
|
38
|
-
this.addEntry(i, t);
|
|
39
|
-
} else assertUnreachable(e);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
wrapValidationException(e, t) {
|
|
43
|
-
return async (n, r, i) => {
|
|
44
|
-
await this.handleException(() => e.call(t, n, r, i), "An error occurred during validation", r, n);
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
async handleException(e, t, r, i) {
|
|
48
|
-
try {
|
|
49
|
-
await e();
|
|
50
|
-
} catch (e) {
|
|
51
|
-
if (isOperationCancelled(e)) throw e;
|
|
52
|
-
console.error(`${t}:`, e), e instanceof Error && e.stack && console.error(e.stack), r("error", `${t}: ${e instanceof Error ? e.message : String(e)}`, { node: i });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
addEntry(e, t) {
|
|
56
|
-
if (e === "AstNode") {
|
|
57
|
-
this.entries.add("AstNode", t);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
for (let n of this.reflection.getAllSubTypes(e)) this.entries.add(n, t);
|
|
61
|
-
}
|
|
62
|
-
getChecks(t, n) {
|
|
63
|
-
let r = stream(this.entries.get(t)).concat(this.entries.get("AstNode"));
|
|
64
|
-
return n && (r = r.filter((e) => n.includes(e.category))), r.map((e) => e.check);
|
|
65
|
-
}
|
|
66
|
-
registerBeforeDocument(e, t = this) {
|
|
67
|
-
this.entriesBefore.push(this.wrapPreparationException(e, "An error occurred during set-up of the validation", t));
|
|
68
|
-
}
|
|
69
|
-
registerAfterDocument(e, t = this) {
|
|
70
|
-
this.entriesAfter.push(this.wrapPreparationException(e, "An error occurred during tear-down of the validation", t));
|
|
71
|
-
}
|
|
72
|
-
wrapPreparationException(e, t, n) {
|
|
73
|
-
return async (r, i, a, o) => {
|
|
74
|
-
await this.handleException(() => e.call(n, r, i, a, o), t, i, r);
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
get checksBefore() {
|
|
78
|
-
return this.entriesBefore;
|
|
79
|
-
}
|
|
80
|
-
get checksAfter() {
|
|
81
|
-
return this.entriesAfter;
|
|
82
|
-
}
|
|
83
|
-
getAllValidationCategories(e) {
|
|
84
|
-
return this.knownCategories;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
export { ValidationCategory, ValidationRegistry, diagnosticData };
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { isMultiReference, isReference } from "../syntax-tree.js";
|
|
2
|
-
import { getDocument, streamAst, streamReferences } from "../utils/ast-utils.js";
|
|
3
|
-
import { toDocumentSegment } from "../utils/cst-utils.js";
|
|
4
|
-
import { cancellation_exports } from "../utils/cancellation.js";
|
|
5
|
-
import { interruptAndCheck } from "../utils/promise-utils.js";
|
|
6
|
-
import { UriUtils } from "../utils/uri-utils.js";
|
|
7
|
-
var DefaultAstNodeDescriptionProvider = class {
|
|
8
|
-
constructor(e) {
|
|
9
|
-
this.astNodeLocator = e.workspace.AstNodeLocator, this.nameProvider = e.references.NameProvider;
|
|
10
|
-
}
|
|
11
|
-
createDescription(e, t, r) {
|
|
12
|
-
let i = r ?? getDocument(e);
|
|
13
|
-
t ??= this.nameProvider.getName(e);
|
|
14
|
-
let o = this.astNodeLocator.getAstNodePath(e);
|
|
15
|
-
if (!t) throw Error(`Node at path ${o} has no name.`);
|
|
16
|
-
let s, c = () => s ??= toDocumentSegment(this.nameProvider.getNameNode(e) ?? e.$cstNode);
|
|
17
|
-
return {
|
|
18
|
-
node: e,
|
|
19
|
-
name: t,
|
|
20
|
-
get nameSegment() {
|
|
21
|
-
return c();
|
|
22
|
-
},
|
|
23
|
-
selectionSegment: toDocumentSegment(e.$cstNode),
|
|
24
|
-
type: e.$type,
|
|
25
|
-
documentUri: i.uri,
|
|
26
|
-
path: o
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}, DefaultReferenceDescriptionProvider = class {
|
|
30
|
-
constructor(e) {
|
|
31
|
-
this.nodeLocator = e.workspace.AstNodeLocator;
|
|
32
|
-
}
|
|
33
|
-
async createDescriptions(e, t = cancellation_exports.CancellationToken.None) {
|
|
34
|
-
let n = [], a = e.parseResult.value;
|
|
35
|
-
for (let e of streamAst(a)) await interruptAndCheck(t), streamReferences(e).forEach((e) => {
|
|
36
|
-
e.reference.error || n.push(...this.createInfoDescriptions(e));
|
|
37
|
-
});
|
|
38
|
-
return n;
|
|
39
|
-
}
|
|
40
|
-
createInfoDescriptions(r) {
|
|
41
|
-
let i = r.reference;
|
|
42
|
-
if (i.error || !i.$refNode) return [];
|
|
43
|
-
let o = [];
|
|
44
|
-
isReference(i) && i.$nodeDescription ? o = [i.$nodeDescription] : isMultiReference(i) && (o = i.items.map((e) => e.$nodeDescription).filter((e) => e !== void 0));
|
|
45
|
-
let s = getDocument(r.container).uri, l = this.nodeLocator.getAstNodePath(r.container), u = [], d = toDocumentSegment(i.$refNode);
|
|
46
|
-
for (let e of o) u.push({
|
|
47
|
-
sourceUri: s,
|
|
48
|
-
sourcePath: l,
|
|
49
|
-
targetUri: e.documentUri,
|
|
50
|
-
targetPath: e.path,
|
|
51
|
-
segment: d,
|
|
52
|
-
local: UriUtils.equals(e.documentUri, s)
|
|
53
|
-
});
|
|
54
|
-
return u;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
export { DefaultAstNodeDescriptionProvider, DefaultReferenceDescriptionProvider };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var DefaultAstNodeLocator = class {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.segmentSeparator = "/", this.indexSeparator = "@";
|
|
4
|
-
}
|
|
5
|
-
getAstNodePath(e) {
|
|
6
|
-
if (e.$container) {
|
|
7
|
-
let t = this.getAstNodePath(e.$container), n = this.getPathSegment(e);
|
|
8
|
-
return t + this.segmentSeparator + n;
|
|
9
|
-
}
|
|
10
|
-
return "";
|
|
11
|
-
}
|
|
12
|
-
getPathSegment({ $containerProperty: e, $containerIndex: t }) {
|
|
13
|
-
if (!e) throw Error("Missing '$containerProperty' in AST node.");
|
|
14
|
-
return t === void 0 ? e : e + this.indexSeparator + t;
|
|
15
|
-
}
|
|
16
|
-
getAstNode(e, t) {
|
|
17
|
-
return t.split(this.segmentSeparator).reduce((e, t) => {
|
|
18
|
-
if (!e || t.length === 0) return e;
|
|
19
|
-
let n = t.indexOf(this.indexSeparator);
|
|
20
|
-
if (n > 0) {
|
|
21
|
-
let r = t.substring(0, n), i = parseInt(t.substring(n + 1));
|
|
22
|
-
return e[r]?.[i];
|
|
23
|
-
}
|
|
24
|
-
return e[t];
|
|
25
|
-
}, e);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
export { DefaultAstNodeLocator };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Deferred } from "../utils/promise-utils.js";
|
|
2
|
-
import { event_exports } from "../utils/event.js";
|
|
3
|
-
var DefaultConfigurationProvider = class {
|
|
4
|
-
constructor(n) {
|
|
5
|
-
this._ready = new Deferred(), this.onConfigurationSectionUpdateEmitter = new event_exports.Emitter(), this.settings = {}, this.workspaceConfig = !1, this.serviceRegistry = n.ServiceRegistry;
|
|
6
|
-
}
|
|
7
|
-
get ready() {
|
|
8
|
-
return this._ready.promise;
|
|
9
|
-
}
|
|
10
|
-
initialize(e) {
|
|
11
|
-
this.workspaceConfig = e.capabilities.workspace?.configuration ?? !1;
|
|
12
|
-
}
|
|
13
|
-
async initialized(e) {
|
|
14
|
-
if (this.workspaceConfig) {
|
|
15
|
-
if (e.register) {
|
|
16
|
-
let t = this.serviceRegistry.all;
|
|
17
|
-
e.register({ section: t.map((e) => this.toSectionName(e.LanguageMetaData.languageId)) });
|
|
18
|
-
}
|
|
19
|
-
if (e.fetchConfiguration) {
|
|
20
|
-
let t = this.serviceRegistry.all.map((e) => ({ section: this.toSectionName(e.LanguageMetaData.languageId) })), n = await e.fetchConfiguration(t);
|
|
21
|
-
t.forEach((e, t) => {
|
|
22
|
-
this.updateSectionConfiguration(e.section, n[t]);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
this._ready.resolve();
|
|
27
|
-
}
|
|
28
|
-
updateConfiguration(e) {
|
|
29
|
-
typeof e.settings != "object" || e.settings === null || Object.entries(e.settings).forEach(([e, t]) => {
|
|
30
|
-
this.updateSectionConfiguration(e, t), this.onConfigurationSectionUpdateEmitter.fire({
|
|
31
|
-
section: e,
|
|
32
|
-
configuration: t
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
updateSectionConfiguration(e, t) {
|
|
37
|
-
this.settings[e] = t;
|
|
38
|
-
}
|
|
39
|
-
async getConfiguration(e, t) {
|
|
40
|
-
await this.ready;
|
|
41
|
-
let n = this.toSectionName(e);
|
|
42
|
-
if (this.settings[n]) return this.settings[n][t];
|
|
43
|
-
}
|
|
44
|
-
toSectionName(e) {
|
|
45
|
-
return `${e}`;
|
|
46
|
-
}
|
|
47
|
-
get onConfigurationSectionUpdate() {
|
|
48
|
-
return this.onConfigurationSectionUpdateEmitter.event;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
export { DefaultConfigurationProvider };
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { stream } from "../utils/stream.js";
|
|
2
|
-
import { cancellation_exports } from "../utils/cancellation.js";
|
|
3
|
-
import { OperationCancelled, interruptAndCheck, isOperationCancelled } from "../utils/promise-utils.js";
|
|
4
|
-
import { UriUtils } from "../utils/uri-utils.js";
|
|
5
|
-
import { DocumentState } from "./documents.js";
|
|
6
|
-
import { MultiMap } from "../utils/collections.js";
|
|
7
|
-
import { require_main } from "../../../vscode-languageserver-protocol/lib/browser/main.js";
|
|
8
|
-
import { Disposable } from "../utils/disposable.js";
|
|
9
|
-
var import_main = require_main(), DefaultDocumentBuilder = class {
|
|
10
|
-
constructor(e) {
|
|
11
|
-
this.updateBuildOptions = { validation: { categories: ["built-in", "fast"] } }, this.updateListeners = [], this.buildPhaseListeners = new MultiMap(), this.documentPhaseListeners = new MultiMap(), this.buildState = /* @__PURE__ */ new Map(), this.documentBuildWaiters = /* @__PURE__ */ new Map(), this.currentState = DocumentState.Changed, this.langiumDocuments = e.workspace.LangiumDocuments, this.langiumDocumentFactory = e.workspace.LangiumDocumentFactory, this.textDocuments = e.workspace.TextDocuments, this.indexManager = e.workspace.IndexManager, this.fileSystemProvider = e.workspace.FileSystemProvider, this.workspaceManager = () => e.workspace.WorkspaceManager, this.serviceRegistry = e.ServiceRegistry;
|
|
12
|
-
}
|
|
13
|
-
async build(e, r = {}, i = cancellation_exports.CancellationToken.None) {
|
|
14
|
-
for (let n of e) {
|
|
15
|
-
let e = n.uri.toString();
|
|
16
|
-
if (n.state === DocumentState.Validated) {
|
|
17
|
-
if (typeof r.validation == "boolean" && r.validation) this.resetToState(n, DocumentState.IndexedReferences);
|
|
18
|
-
else if (typeof r.validation == "object") {
|
|
19
|
-
let i = this.findMissingValidationCategories(n, r);
|
|
20
|
-
i.length > 0 && (this.buildState.set(e, {
|
|
21
|
-
completed: !1,
|
|
22
|
-
options: { validation: { categories: i } },
|
|
23
|
-
result: this.buildState.get(e)?.result
|
|
24
|
-
}), n.state = DocumentState.IndexedReferences);
|
|
25
|
-
}
|
|
26
|
-
} else this.buildState.delete(e);
|
|
27
|
-
}
|
|
28
|
-
this.currentState = DocumentState.Changed, await this.emitUpdate(e.map((e) => e.uri), []), await this.buildDocuments(e, r, i);
|
|
29
|
-
}
|
|
30
|
-
async update(r, a, o = cancellation_exports.CancellationToken.None) {
|
|
31
|
-
this.currentState = DocumentState.Changed;
|
|
32
|
-
let c = [];
|
|
33
|
-
for (let e of a) {
|
|
34
|
-
let n = this.langiumDocuments.deleteDocuments(e);
|
|
35
|
-
for (let e of n) c.push(e.uri), this.cleanUpDeleted(e);
|
|
36
|
-
}
|
|
37
|
-
let l = (await Promise.all(r.map((e) => this.findChangedUris(e)))).flat();
|
|
38
|
-
for (let e of l) {
|
|
39
|
-
let n = this.langiumDocuments.getDocument(e);
|
|
40
|
-
n === void 0 && (n = this.langiumDocumentFactory.fromModel({ $type: "INVALID" }, e), n.state = DocumentState.Changed, this.langiumDocuments.addDocument(n)), this.resetToState(n, DocumentState.Changed);
|
|
41
|
-
}
|
|
42
|
-
let u = stream(l).concat(c).map((e) => e.toString()).toSet();
|
|
43
|
-
this.langiumDocuments.all.filter((e) => !u.has(e.uri.toString()) && this.shouldRelink(e, u)).forEach((e) => this.resetToState(e, DocumentState.ComputedScopes)), await this.emitUpdate(l, c), await interruptAndCheck(o);
|
|
44
|
-
let d = this.sortDocuments(this.langiumDocuments.all.filter((e) => e.state < DocumentState.Validated || !this.buildState.get(e.uri.toString())?.completed || this.resultsAreIncomplete(e, this.updateBuildOptions)).toArray());
|
|
45
|
-
await this.buildDocuments(d, this.updateBuildOptions, o);
|
|
46
|
-
}
|
|
47
|
-
resultsAreIncomplete(e, n) {
|
|
48
|
-
return this.findMissingValidationCategories(e, n).length >= 1;
|
|
49
|
-
}
|
|
50
|
-
findMissingValidationCategories(n, r) {
|
|
51
|
-
let i = this.buildState.get(n.uri.toString()), a = this.serviceRegistry.getServices(n.uri).validation.ValidationRegistry.getAllValidationCategories(n), o = i?.result?.validationChecks ? new Set(i?.result?.validationChecks) : i?.completed ? a : /* @__PURE__ */ new Set();
|
|
52
|
-
return stream(r === void 0 || r.validation === !0 ? a : typeof r.validation == "object" ? r.validation.categories ?? a : []).filter((e) => !o.has(e)).toArray();
|
|
53
|
-
}
|
|
54
|
-
async findChangedUris(e) {
|
|
55
|
-
if (this.langiumDocuments.getDocument(e) ?? this.textDocuments?.get(e)) return [e];
|
|
56
|
-
try {
|
|
57
|
-
let n = await this.fileSystemProvider.stat(e);
|
|
58
|
-
if (n.isDirectory) return await this.workspaceManager().searchFolder(e);
|
|
59
|
-
if (this.workspaceManager().shouldIncludeEntry(n)) return [e];
|
|
60
|
-
} catch {}
|
|
61
|
-
return [];
|
|
62
|
-
}
|
|
63
|
-
async emitUpdate(e, n) {
|
|
64
|
-
await Promise.all(this.updateListeners.map((r) => r(e, n)));
|
|
65
|
-
}
|
|
66
|
-
sortDocuments(e) {
|
|
67
|
-
let n = 0, r = e.length - 1;
|
|
68
|
-
for (; n < r;) {
|
|
69
|
-
for (; n < e.length && this.hasTextDocument(e[n]);) n++;
|
|
70
|
-
for (; r >= 0 && !this.hasTextDocument(e[r]);) r--;
|
|
71
|
-
n < r && ([e[n], e[r]] = [e[r], e[n]]);
|
|
72
|
-
}
|
|
73
|
-
return e;
|
|
74
|
-
}
|
|
75
|
-
hasTextDocument(e) {
|
|
76
|
-
return !!this.textDocuments?.get(e.uri);
|
|
77
|
-
}
|
|
78
|
-
shouldRelink(e, n) {
|
|
79
|
-
return e.references.some((e) => e.error !== void 0) ? !0 : this.indexManager.isAffected(e, n);
|
|
80
|
-
}
|
|
81
|
-
onUpdate(e) {
|
|
82
|
-
return this.updateListeners.push(e), Disposable.create(() => {
|
|
83
|
-
let n = this.updateListeners.indexOf(e);
|
|
84
|
-
n >= 0 && this.updateListeners.splice(n, 1);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
resetToState(e, n) {
|
|
88
|
-
switch (n) {
|
|
89
|
-
case DocumentState.Changed:
|
|
90
|
-
case DocumentState.Parsed: this.indexManager.removeContent(e.uri);
|
|
91
|
-
case DocumentState.IndexedContent: e.localSymbols = void 0;
|
|
92
|
-
case DocumentState.ComputedScopes: this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);
|
|
93
|
-
case DocumentState.Linked: this.indexManager.removeReferences(e.uri);
|
|
94
|
-
case DocumentState.IndexedReferences: e.diagnostics = void 0, this.buildState.delete(e.uri.toString());
|
|
95
|
-
case DocumentState.Validated:
|
|
96
|
-
}
|
|
97
|
-
e.state > n && (e.state = n);
|
|
98
|
-
}
|
|
99
|
-
cleanUpDeleted(e) {
|
|
100
|
-
this.buildState.delete(e.uri.toString()), this.indexManager.remove(e.uri), e.state = DocumentState.Changed;
|
|
101
|
-
}
|
|
102
|
-
async buildDocuments(e, n, r) {
|
|
103
|
-
this.prepareBuild(e, n), await this.runCancelable(e, DocumentState.Parsed, r, (e) => this.langiumDocumentFactory.update(e, r)), await this.runCancelable(e, DocumentState.IndexedContent, r, (e) => this.indexManager.updateContent(e, r)), await this.runCancelable(e, DocumentState.ComputedScopes, r, async (e) => {
|
|
104
|
-
e.localSymbols = await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectLocalSymbols(e, r);
|
|
105
|
-
});
|
|
106
|
-
let i = e.filter((e) => this.shouldLink(e));
|
|
107
|
-
await this.runCancelable(i, DocumentState.Linked, r, (e) => this.serviceRegistry.getServices(e.uri).references.Linker.link(e, r)), await this.runCancelable(i, DocumentState.IndexedReferences, r, (e) => this.indexManager.updateReferences(e, r));
|
|
108
|
-
let a = e.filter((e) => this.shouldValidate(e) ? !0 : (this.markAsCompleted(e), !1));
|
|
109
|
-
await this.runCancelable(a, DocumentState.Validated, r, async (e) => {
|
|
110
|
-
await this.validate(e, r), this.markAsCompleted(e);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
markAsCompleted(e) {
|
|
114
|
-
let n = this.buildState.get(e.uri.toString());
|
|
115
|
-
n && (n.completed = !0);
|
|
116
|
-
}
|
|
117
|
-
prepareBuild(e, n) {
|
|
118
|
-
for (let r of e) {
|
|
119
|
-
let e = r.uri.toString(), i = this.buildState.get(e);
|
|
120
|
-
(!i || i.completed) && this.buildState.set(e, {
|
|
121
|
-
completed: !1,
|
|
122
|
-
options: n,
|
|
123
|
-
result: i?.result
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
async runCancelable(e, n, r, a) {
|
|
128
|
-
for (let o of e) o.state < n && (await interruptAndCheck(r), await a(o), o.state = n, await this.notifyDocumentPhase(o, n, r));
|
|
129
|
-
let o = e.filter((e) => e.state === n);
|
|
130
|
-
await this.notifyBuildPhase(o, n, r), this.currentState = n;
|
|
131
|
-
}
|
|
132
|
-
onBuildPhase(e, n) {
|
|
133
|
-
return this.buildPhaseListeners.add(e, n), Disposable.create(() => {
|
|
134
|
-
this.buildPhaseListeners.delete(e, n);
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
onDocumentPhase(e, n) {
|
|
138
|
-
return this.documentPhaseListeners.add(e, n), Disposable.create(() => {
|
|
139
|
-
this.documentPhaseListeners.delete(e, n);
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
waitUntil(e, r, i) {
|
|
143
|
-
let a;
|
|
144
|
-
return r && "path" in r ? a = r : i = r, i ??= cancellation_exports.CancellationToken.None, a ? this.awaitDocumentState(e, a, i) : this.awaitBuilderState(e, i);
|
|
145
|
-
}
|
|
146
|
-
awaitDocumentState(e, n, i) {
|
|
147
|
-
let a = this.langiumDocuments.getDocument(n);
|
|
148
|
-
if (a) {
|
|
149
|
-
if (a.state >= e) return Promise.resolve(n);
|
|
150
|
-
if (i.isCancellationRequested) return Promise.reject(OperationCancelled);
|
|
151
|
-
if (this.currentState >= e && e > a.state) return Promise.reject(new import_main.ResponseError(import_main.LSPErrorCodes.RequestFailed, `Document state of ${n.toString()} is ${DocumentState[a.state]}, requiring ${DocumentState[e]}, but workspace state is already ${DocumentState[this.currentState]}. Returning undefined.`));
|
|
152
|
-
} else return Promise.reject(new import_main.ResponseError(import_main.LSPErrorCodes.ServerCancelled, `No document found for URI: ${n.toString()}`));
|
|
153
|
-
return new Promise((a, s) => {
|
|
154
|
-
let c = this.onDocumentPhase(e, (e) => {
|
|
155
|
-
UriUtils.equals(e.uri, n) && (c.dispose(), l.dispose(), a(e.uri));
|
|
156
|
-
}), l = i.onCancellationRequested(() => {
|
|
157
|
-
c.dispose(), l.dispose(), s(OperationCancelled);
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
awaitBuilderState(e, n) {
|
|
162
|
-
return this.currentState >= e ? Promise.resolve() : n.isCancellationRequested ? Promise.reject(OperationCancelled) : new Promise((i, a) => {
|
|
163
|
-
let o = this.onBuildPhase(e, () => {
|
|
164
|
-
o.dispose(), s.dispose(), i();
|
|
165
|
-
}), s = n.onCancellationRequested(() => {
|
|
166
|
-
o.dispose(), s.dispose(), a(OperationCancelled);
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
async notifyDocumentPhase(e, n, r) {
|
|
171
|
-
let o = this.documentPhaseListeners.get(n).slice();
|
|
172
|
-
for (let n of o) try {
|
|
173
|
-
await interruptAndCheck(r), await n(e, r);
|
|
174
|
-
} catch (e) {
|
|
175
|
-
if (!isOperationCancelled(e)) throw e;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
async notifyBuildPhase(e, n, r) {
|
|
179
|
-
if (e.length === 0) return;
|
|
180
|
-
let a = this.buildPhaseListeners.get(n).slice();
|
|
181
|
-
for (let n of a) await interruptAndCheck(r), await n(e, r);
|
|
182
|
-
}
|
|
183
|
-
shouldLink(e) {
|
|
184
|
-
return this.getBuildOptions(e).eagerLinking ?? !0;
|
|
185
|
-
}
|
|
186
|
-
shouldValidate(e) {
|
|
187
|
-
return !!this.getBuildOptions(e).validation;
|
|
188
|
-
}
|
|
189
|
-
async validate(n, r) {
|
|
190
|
-
let i = this.serviceRegistry.getServices(n.uri).validation.DocumentValidator, a = this.getBuildOptions(n), o = typeof a.validation == "object" ? { ...a.validation } : {};
|
|
191
|
-
o.categories = this.findMissingValidationCategories(n, a);
|
|
192
|
-
let s = await i.validateDocument(n, o, r);
|
|
193
|
-
n.diagnostics ? n.diagnostics.push(...s) : n.diagnostics = s;
|
|
194
|
-
let c = this.buildState.get(n.uri.toString());
|
|
195
|
-
c && (c.result ??= {}, c.result.validationChecks ? c.result.validationChecks = stream(c.result.validationChecks).concat(o.categories).distinct().toArray() : c.result.validationChecks = [...o.categories]);
|
|
196
|
-
}
|
|
197
|
-
getBuildOptions(e) {
|
|
198
|
-
return this.buildState.get(e.uri.toString())?.options ?? {};
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
export { DefaultDocumentBuilder };
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { stream } from "../utils/stream.js";
|
|
2
|
-
import { cancellation_exports } from "../utils/cancellation.js";
|
|
3
|
-
import { TextDocument } from "../../../vscode-languageserver-textdocument/lib/esm/main.js";
|
|
4
|
-
import { URI } from "../../../vscode-uri/lib/esm/index.js";
|
|
5
|
-
import { UriTrie } from "../utils/uri-utils.js";
|
|
6
|
-
var DocumentState;
|
|
7
|
-
(function(e) {
|
|
8
|
-
e[e.Changed = 0] = "Changed", e[e.Parsed = 1] = "Parsed", e[e.IndexedContent = 2] = "IndexedContent", e[e.ComputedScopes = 3] = "ComputedScopes", e[e.Linked = 4] = "Linked", e[e.IndexedReferences = 5] = "IndexedReferences", e[e.Validated = 6] = "Validated";
|
|
9
|
-
})(DocumentState ||= {});
|
|
10
|
-
var DefaultLangiumDocumentFactory = class {
|
|
11
|
-
constructor(e) {
|
|
12
|
-
this.serviceRegistry = e.ServiceRegistry, this.textDocuments = e.workspace.TextDocuments, this.fileSystemProvider = e.workspace.FileSystemProvider;
|
|
13
|
-
}
|
|
14
|
-
async fromUri(e, a = cancellation_exports.CancellationToken.None) {
|
|
15
|
-
let o = await this.fileSystemProvider.readFile(e);
|
|
16
|
-
return this.createAsync(e, o, a);
|
|
17
|
-
}
|
|
18
|
-
fromTextDocument(e, a, s) {
|
|
19
|
-
return a ??= URI.parse(e.uri), cancellation_exports.CancellationToken.is(s) ? this.createAsync(a, e, s) : this.create(a, e, s);
|
|
20
|
-
}
|
|
21
|
-
fromString(e, a, o) {
|
|
22
|
-
return cancellation_exports.CancellationToken.is(o) ? this.createAsync(a, e, o) : this.create(a, e, o);
|
|
23
|
-
}
|
|
24
|
-
fromModel(e, i) {
|
|
25
|
-
return this.create(i, { $model: e });
|
|
26
|
-
}
|
|
27
|
-
create(e, i, a) {
|
|
28
|
-
if (typeof i == "string") {
|
|
29
|
-
let o = this.parse(e, i, a);
|
|
30
|
-
return this.createLangiumDocument(o, e, void 0, i);
|
|
31
|
-
} else if ("$model" in i) {
|
|
32
|
-
let a = {
|
|
33
|
-
value: i.$model,
|
|
34
|
-
parserErrors: [],
|
|
35
|
-
lexerErrors: []
|
|
36
|
-
};
|
|
37
|
-
return this.createLangiumDocument(a, e);
|
|
38
|
-
} else {
|
|
39
|
-
let o = this.parse(e, i.getText(), a);
|
|
40
|
-
return this.createLangiumDocument(o, e, i);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
async createAsync(e, i, a) {
|
|
44
|
-
if (typeof i == "string") {
|
|
45
|
-
let o = await this.parseAsync(e, i, a);
|
|
46
|
-
return this.createLangiumDocument(o, e, void 0, i);
|
|
47
|
-
} else {
|
|
48
|
-
let o = await this.parseAsync(e, i.getText(), a);
|
|
49
|
-
return this.createLangiumDocument(o, e, i);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
createLangiumDocument(e, i, a, o) {
|
|
53
|
-
let s;
|
|
54
|
-
if (a) s = {
|
|
55
|
-
parseResult: e,
|
|
56
|
-
uri: i,
|
|
57
|
-
state: DocumentState.Parsed,
|
|
58
|
-
references: [],
|
|
59
|
-
textDocument: a
|
|
60
|
-
};
|
|
61
|
-
else {
|
|
62
|
-
let a = this.createTextDocumentGetter(i, o);
|
|
63
|
-
s = {
|
|
64
|
-
parseResult: e,
|
|
65
|
-
uri: i,
|
|
66
|
-
state: DocumentState.Parsed,
|
|
67
|
-
references: [],
|
|
68
|
-
get textDocument() {
|
|
69
|
-
return a();
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
return e.value.$document = s, s;
|
|
74
|
-
}
|
|
75
|
-
async update(e, i) {
|
|
76
|
-
let a = e.parseResult.value.$cstNode?.root.fullText, o = this.textDocuments?.get(e.uri.toString()), s = o ? o.getText() : await this.fileSystemProvider.readFile(e.uri);
|
|
77
|
-
if (o) Object.defineProperty(e, "textDocument", { value: o });
|
|
78
|
-
else {
|
|
79
|
-
let i = this.createTextDocumentGetter(e.uri, s);
|
|
80
|
-
Object.defineProperty(e, "textDocument", { get: i });
|
|
81
|
-
}
|
|
82
|
-
return a !== s && (e.parseResult = await this.parseAsync(e.uri, s, i), e.parseResult.value.$document = e), e.state = DocumentState.Parsed, e;
|
|
83
|
-
}
|
|
84
|
-
parse(e, i, a) {
|
|
85
|
-
return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(i, a);
|
|
86
|
-
}
|
|
87
|
-
parseAsync(e, i, a) {
|
|
88
|
-
return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(i, a);
|
|
89
|
-
}
|
|
90
|
-
createTextDocumentGetter(e, i) {
|
|
91
|
-
let o = this.serviceRegistry, s;
|
|
92
|
-
return () => s ??= TextDocument.create(e.toString(), o.getServices(e).LanguageMetaData.languageId, 0, i ?? "");
|
|
93
|
-
}
|
|
94
|
-
}, DefaultLangiumDocuments = class {
|
|
95
|
-
constructor(e) {
|
|
96
|
-
this.documentTrie = new UriTrie(), this.services = e, this.langiumDocumentFactory = e.workspace.LangiumDocumentFactory, this.documentBuilder = () => e.workspace.DocumentBuilder;
|
|
97
|
-
}
|
|
98
|
-
get all() {
|
|
99
|
-
return stream(this.documentTrie.all());
|
|
100
|
-
}
|
|
101
|
-
addDocument(e) {
|
|
102
|
-
let i = e.uri.toString();
|
|
103
|
-
if (this.documentTrie.has(i)) throw Error(`A document with the URI '${i}' is already present.`);
|
|
104
|
-
this.documentTrie.insert(i, e);
|
|
105
|
-
}
|
|
106
|
-
getDocument(e) {
|
|
107
|
-
let i = e.toString();
|
|
108
|
-
return this.documentTrie.find(i);
|
|
109
|
-
}
|
|
110
|
-
getDocuments(e) {
|
|
111
|
-
let i = e.toString();
|
|
112
|
-
return this.documentTrie.findAll(i);
|
|
113
|
-
}
|
|
114
|
-
async getOrCreateDocument(e, i) {
|
|
115
|
-
let a = this.getDocument(e);
|
|
116
|
-
return a || (a = await this.langiumDocumentFactory.fromUri(e, i), this.addDocument(a), a);
|
|
117
|
-
}
|
|
118
|
-
createDocument(e, i, a) {
|
|
119
|
-
if (a) return this.langiumDocumentFactory.fromString(i, e, a).then((e) => (this.addDocument(e), e));
|
|
120
|
-
{
|
|
121
|
-
let a = this.langiumDocumentFactory.fromString(i, e);
|
|
122
|
-
return this.addDocument(a), a;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
hasDocument(e) {
|
|
126
|
-
return this.documentTrie.has(e.toString());
|
|
127
|
-
}
|
|
128
|
-
invalidateDocument(e) {
|
|
129
|
-
let i = e.toString(), a = this.documentTrie.find(i);
|
|
130
|
-
return a && this.documentBuilder().resetToState(a, DocumentState.Changed), a;
|
|
131
|
-
}
|
|
132
|
-
deleteDocument(e) {
|
|
133
|
-
let i = e.toString(), a = this.documentTrie.find(i);
|
|
134
|
-
return a && (a.state = DocumentState.Changed, this.documentTrie.delete(i)), a;
|
|
135
|
-
}
|
|
136
|
-
deleteDocuments(e) {
|
|
137
|
-
let i = e.toString(), a = this.documentTrie.findAll(i);
|
|
138
|
-
for (let e of a) e.state = DocumentState.Changed;
|
|
139
|
-
return this.documentTrie.delete(i), a;
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
export { DefaultLangiumDocumentFactory, DefaultLangiumDocuments, DocumentState };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
var EmptyFileSystemProvider = class {
|
|
2
|
-
stat(e) {
|
|
3
|
-
throw Error("No file system is available.");
|
|
4
|
-
}
|
|
5
|
-
statSync(e) {
|
|
6
|
-
throw Error("No file system is available.");
|
|
7
|
-
}
|
|
8
|
-
async exists() {
|
|
9
|
-
return !1;
|
|
10
|
-
}
|
|
11
|
-
existsSync() {
|
|
12
|
-
return !1;
|
|
13
|
-
}
|
|
14
|
-
readBinary() {
|
|
15
|
-
throw Error("No file system is available.");
|
|
16
|
-
}
|
|
17
|
-
readBinarySync() {
|
|
18
|
-
throw Error("No file system is available.");
|
|
19
|
-
}
|
|
20
|
-
readFile() {
|
|
21
|
-
throw Error("No file system is available.");
|
|
22
|
-
}
|
|
23
|
-
readFileSync() {
|
|
24
|
-
throw Error("No file system is available.");
|
|
25
|
-
}
|
|
26
|
-
async readDirectory() {
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
29
|
-
readDirectorySync() {
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const EmptyFileSystem = { fileSystemProvider: () => new EmptyFileSystemProvider() };
|
|
34
|
-
export { EmptyFileSystem, EmptyFileSystemProvider };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { stream } from "../utils/stream.js";
|
|
2
|
-
import { getDocument } from "../utils/ast-utils.js";
|
|
3
|
-
import { cancellation_exports } from "../utils/cancellation.js";
|
|
4
|
-
import { UriUtils } from "../utils/uri-utils.js";
|
|
5
|
-
import { ContextCache } from "../utils/caching.js";
|
|
6
|
-
var DefaultIndexManager = class {
|
|
7
|
-
constructor(e) {
|
|
8
|
-
this.symbolIndex = /* @__PURE__ */ new Map(), this.symbolByTypeIndex = new ContextCache(), this.referenceIndex = /* @__PURE__ */ new Map(), this.documents = e.workspace.LangiumDocuments, this.serviceRegistry = e.ServiceRegistry, this.astReflection = e.AstReflection;
|
|
9
|
-
}
|
|
10
|
-
findAllReferences(n, i) {
|
|
11
|
-
let a = getDocument(n).uri, o = [];
|
|
12
|
-
return this.referenceIndex.forEach((e) => {
|
|
13
|
-
e.forEach((e) => {
|
|
14
|
-
UriUtils.equals(e.targetUri, a) && e.targetPath === i && o.push(e);
|
|
15
|
-
});
|
|
16
|
-
}), stream(o);
|
|
17
|
-
}
|
|
18
|
-
allElements(t, n) {
|
|
19
|
-
let r = stream(this.symbolIndex.keys());
|
|
20
|
-
return n && (r = r.filter((e) => !n || n.has(e))), r.map((e) => this.getFileDescriptions(e, t)).flat();
|
|
21
|
-
}
|
|
22
|
-
getFileDescriptions(e, t) {
|
|
23
|
-
return t ? this.symbolByTypeIndex.get(e, t, () => (this.symbolIndex.get(e) ?? []).filter((e) => this.astReflection.isSubtype(e.type, t))) : this.symbolIndex.get(e) ?? [];
|
|
24
|
-
}
|
|
25
|
-
remove(e) {
|
|
26
|
-
this.removeContent(e), this.removeReferences(e);
|
|
27
|
-
}
|
|
28
|
-
removeContent(e) {
|
|
29
|
-
let t = e.toString();
|
|
30
|
-
this.symbolIndex.delete(t), this.symbolByTypeIndex.clear(t);
|
|
31
|
-
}
|
|
32
|
-
removeReferences(e) {
|
|
33
|
-
let t = e.toString();
|
|
34
|
-
this.referenceIndex.delete(t);
|
|
35
|
-
}
|
|
36
|
-
async updateContent(e, t = cancellation_exports.CancellationToken.None) {
|
|
37
|
-
let r = await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e, t), i = e.uri.toString();
|
|
38
|
-
this.symbolIndex.set(i, r), this.symbolByTypeIndex.clear(i);
|
|
39
|
-
}
|
|
40
|
-
async updateReferences(e, t = cancellation_exports.CancellationToken.None) {
|
|
41
|
-
let r = await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e, t);
|
|
42
|
-
this.referenceIndex.set(e.uri.toString(), r);
|
|
43
|
-
}
|
|
44
|
-
isAffected(e, t) {
|
|
45
|
-
let n = this.referenceIndex.get(e.uri.toString());
|
|
46
|
-
return n ? n.some((e) => !e.local && t.has(e.targetUri.toString())) : !1;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
export { DefaultIndexManager };
|