@marimo-team/islands 0.25.1-dev4 → 0.25.1-dev40
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/{ConnectedDataExplorerComponent-KVhjDMSe.js → ConnectedDataExplorerComponent-CwMXfDQR.js} +3 -3
- package/dist/{ErrorBoundary-pV36lYEK.js → ErrorBoundary-CAJO-M56.js} +1 -1
- package/dist/{ImageComparisonComponent-Dlm5aWnH.js → ImageComparisonComponent-Cpfz30OZ.js} +51 -52
- package/dist/{abnfDiagram-VCTEODGH-CpN0FRda.js → abnfDiagram-VCTEODGH-AFhOQTt8.js} +3 -3
- package/dist/{architectureDiagram-5GKGNRK7-DDyj5SRB.js → architectureDiagram-5GKGNRK7-BngksAAQ.js} +5 -5
- package/dist/{blockDiagram-I7D4REHJ-BbXEXJRu.js → blockDiagram-I7D4REHJ-CvBmppdy.js} +9 -9
- package/dist/{c4Diagram-7LVT6UL2-DcLsbQmR.js → c4Diagram-7LVT6UL2-EceL4_jH.js} +7 -7
- package/dist/{cells-B5-y5EY3.js → cells-Cv93oav_.js} +3 -3
- package/dist/{channel-B5XnTarr.js → channel-z7HZXHwv.js} +1 -1
- package/dist/{chat-ui-HJZsTl7o.js → chat-ui-DLSF8a04.js} +4 -4
- package/dist/{chunk-4HAMMTFA-D2qv8E0X.js → chunk-4HAMMTFA-BPTTOOC5.js} +5 -5
- package/dist/{chunk-75Z2AOVW-5_HsvXwr.js → chunk-75Z2AOVW-C4AOleKf.js} +1 -1
- package/dist/{chunk-DU6HZSFF-BUgAHvnM.js → chunk-DU6HZSFF-1TwWR6gh.js} +1 -1
- package/dist/{chunk-F27PBJKO-DHmYWZXr.js → chunk-F27PBJKO-DMI1PBe4.js} +1 -1
- package/dist/{chunk-GMAD6QVW-Czynz8aA.js → chunk-GMAD6QVW-vStrMz2P.js} +3 -3
- package/dist/{chunk-GVQU2GXP-yQEdulRS.js → chunk-GVQU2GXP-2HwWgs4u.js} +2 -2
- package/dist/{chunk-IMKFNOWR-BfwTebD0.js → chunk-IMKFNOWR-UOVZuZVn.js} +5 -5
- package/dist/{chunk-L3NEJ4N5-DwRWnDDK.js → chunk-L3NEJ4N5-RhC7i0I2.js} +5 -5
- package/dist/{chunk-OSK3NFVY-BBKU_Ign.js → chunk-OSK3NFVY-CZV09N-U.js} +6 -6
- package/dist/{chunk-P2QGCYS3-C0iGU29N.js → chunk-P2QGCYS3-0TAWai9C.js} +1 -1
- package/dist/{chunk-POPQ4Y6H-BCbS3Ozc.js → chunk-POPQ4Y6H-Cc3_56GX.js} +1 -1
- package/dist/{chunk-PWAF6VOD-CTFCL0jI.js → chunk-PWAF6VOD-lNxB9k8z.js} +1 -1
- package/dist/{chunk-SHT3W25Y-BspJEJ5H.js → chunk-SHT3W25Y-CrEPyWy1.js} +7 -7
- package/dist/{chunk-SVP7TREG-DX3rFNTe.js → chunk-SVP7TREG-uIyyySp6.js} +2 -2
- package/dist/{chunk-TICWLB2K-fVF7Uujg.js → chunk-TICWLB2K-DdXM3eg6.js} +5 -5
- package/dist/classDiagram-ZZMXUADV-BiATbBE4.js +30 -0
- package/dist/classDiagram-v2-VYDZK3BY-JnH97GYw.js +30 -0
- package/dist/{code-visibility-CgZS2a3W.js → code-visibility-XU9RAJNV.js} +2 -2
- package/dist/{common-DnMDPPaW.js → common-C0fbrgB8.js} +13 -13
- package/dist/{cynefinDiagram-5FMLGOSQ-CFQrqzSX.js → cynefinDiagram-5FMLGOSQ-zknaAsGy.js} +3 -3
- package/dist/{dagre-GXQ25YYZ-xHNAUTyG.js → dagre-GXQ25YYZ-BhMOoMGJ.js} +10 -10
- package/dist/{data-grid-overlay-editor-hHYgD_Sm.js → data-grid-overlay-editor-BnhbJgoq.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-Bt1rPbAx.js → diagram-S7CK7UJ4-V5-Z-EDY.js} +4 -4
- package/dist/{diagram-UQ7AKVKN-D1sq5FoZ.js → diagram-UQ7AKVKN-qw8AjDal.js} +3 -3
- package/dist/{diagram-VSXAHHWV-BKpmG23x.js → diagram-VSXAHHWV-CR7BJygZ.js} +2 -2
- package/dist/{diagram-VX7I27RA-BMwGFVD6.js → diagram-VX7I27RA-DfuqFb1E.js} +5 -5
- package/dist/{diagram-Z3DM3KII--KLDR9Pl.js → diagram-Z3DM3KII-DpWwlYZB.js} +3 -3
- package/dist/{dist-BaHjhkpZ.js → dist-CcyKTBTF.js} +1 -1
- package/dist/{ebnfDiagram-PWID7BFC-WnG4cvSQ.js → ebnfDiagram-PWID7BFC-C20OnNMZ.js} +3 -3
- package/dist/{erDiagram-RLTQ6QDP-DhzKiYHc.js → erDiagram-RLTQ6QDP-DBXLWO9v.js} +12 -12
- package/dist/{error-entries-Bkbpx0T0.js → error-entries-DLl0XqoW.js} +1 -1
- package/dist/{feedback-button-CvKssdG_.js → feedback-button-B0QSkbSp.js} +4 -4
- package/dist/flowDiagram-HODETNUW-DL52nMkt.js +16 -0
- package/dist/{formats-C8rLgZT9.js → formats-Cl_67ghI.js} +1 -1
- package/dist/{ganttDiagram-EL5Y4UJY-DbzEBLbl.js → ganttDiagram-EL5Y4UJY-cRRaDt88.js} +2 -2
- package/dist/{gitGraphDiagram-WWUBYQGX-BMf0iKi1.js → gitGraphDiagram-WWUBYQGX-Pox5k9-Y.js} +2 -2
- package/dist/{glide-data-editor-Ohetlgag.js → glide-data-editor-ymIQdwrb.js} +3 -3
- package/dist/{globals-CPNNcOJI.js → globals-B0S3-e_D.js} +1 -1
- package/dist/{html-to-image-BAgJOlSW.js → html-to-image-CGVgroef.js} +2 -2
- package/dist/{infoDiagram-27XIBGKW-BagtCX_5.js → infoDiagram-27XIBGKW-ntpxMfrq.js} +2 -2
- package/dist/{ishikawaDiagram-5VMMS53U-DByDehYy.js → ishikawaDiagram-5VMMS53U-BllIlHE5.js} +3 -3
- package/dist/{journeyDiagram-3NMN7TZE-D2LcKDUO.js → journeyDiagram-3NMN7TZE-EPJDPlt0.js} +2 -2
- package/dist/{kanban-definition-UXKFOSKX-BxwkbBI_.js → kanban-definition-UXKFOSKX-GYtNMjtS.js} +9 -9
- package/dist/{katex-C6D4cX_N.js → katex-BNCmKUol.js} +983 -1120
- package/dist/{loader-D2W4oM-3.js → loader-DEZSzvma.js} +253 -248
- package/dist/main.js +72 -69
- package/dist/{mermaid-DPNuhemn.js → mermaid-Dnzoxjt1.js} +49 -49
- package/dist/{mhchem-DWCF06w9.js → mhchem-BEc7A1or.js} +1 -1
- package/dist/{mindmap-definition-YA3MSWOX-Cgvojw3y.js → mindmap-definition-YA3MSWOX-Cth76xgH.js} +11 -11
- package/dist/{number-overlay-editor-CHWg5gGO.js → number-overlay-editor-DB3HJDI1.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-DahHhYyN.js → pegDiagram-XKGWAZYB-Cu4uOXii.js} +3 -3
- package/dist/{pieDiagram-E7YTZNPT-CCtX0oCK.js → pieDiagram-E7YTZNPT-Bh3eDa9s.js} +3 -3
- package/dist/{process-output-zDX4jbhd.js → process-output-CGfg-JmZ.js} +2 -2
- package/dist/{quadrantDiagram-AXDQQJYC-DftINo6g.js → quadrantDiagram-AXDQQJYC--kqzFC3w.js} +1 -1
- package/dist/{railroadDiagram-O6MQD6OU-Du5NsPUb.js → railroadDiagram-O6MQD6OU-DG-M6Rnc.js} +3 -3
- package/dist/{react-vega-5AcMW8gG.js → react-vega-ewj7q_U5.js} +1 -1
- package/dist/{requirementDiagram-BXWQKSXE-0pmmxL6_.js → requirementDiagram-BXWQKSXE-DCwsThh0.js} +11 -11
- package/dist/{reveal-component-BujcZI2B.js → reveal-component-CfTzIkA2.js} +3 -3
- package/dist/{sankeyDiagram-P5KCCOFB-CDKR5TJH.js → sankeyDiagram-P5KCCOFB-BdzhT0BM.js} +1 -1
- package/dist/{sequenceDiagram-WJ2MYXX4-DB-ChWwU.js → sequenceDiagram-WJ2MYXX4-CbXB1_PU.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-orN6AwMx.js → stateDiagram-D77RDMKH-A-Zf3Sb2.js} +13 -13
- package/dist/stateDiagram-v2-MP3YSRHH-D9YMnUGx.js +30 -0
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-BkSDcqDT.js → swimlanes-42K2YHIH-B_pMf0J4.js} +10 -10
- package/dist/swimlanesDiagram-VR7AAH4N-Ctgy-yGP.js +30 -0
- package/dist/{timeline-definition-24CTP7MA-BuqJUIRZ.js → timeline-definition-24CTP7MA-DTXFjTTM.js} +3 -3
- package/dist/{vega-component-CNf5gcrm.js → vega-component-tFOzgarw.js} +4 -4
- package/dist/{vega-embed-container-CbnTccZi.js → vega-embed-container-sSR5hAsy.js} +2 -2
- package/dist/{vega-loader.browser-D95WfUcj.js → vega-loader.browser-DNST6uVf.js} +2 -2
- package/dist/{vennDiagram-4TSXK5OY-CTUlJ2PK.js → vennDiagram-4TSXK5OY-BPHjZo0R.js} +3 -3
- package/dist/{wardleyDiagram-VM6X3IG4-3evLUb0M.js → wardleyDiagram-VM6X3IG4-6fTLYBuD.js} +3 -3
- package/dist/{xychartDiagram-S5SC5T6Z-DL2E3K8-.js → xychartDiagram-S5SC5T6Z-BYjwjrzE.js} +5 -5
- package/package.json +1 -2
- package/src/__mocks__/common.ts +3 -3
- package/src/__tests__/CellStatus.test.tsx +1 -1
- package/src/__tests__/setup.ts +7 -7
- package/src/components/app-config/ai-config.tsx +2 -0
- package/src/components/app-config/optional-features.tsx +1 -1
- package/src/components/chat/chat-panel.tsx +19 -8
- package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +286 -0
- package/src/components/data-table/charts/charts.tsx +26 -13
- package/src/components/data-table/column-summary/chart-spec-model.tsx +4 -4
- package/src/components/dependency-graph/elements.ts +2 -2
- package/src/components/editor/__tests__/package-alert.test.tsx +140 -0
- package/src/components/editor/actions/__tests__/pair-with-agent.test.tsx +107 -0
- package/src/components/editor/actions/pair-with-agent.tsx +119 -0
- package/src/components/editor/actions/useNotebookActions.tsx +2 -1
- package/src/components/editor/ai/add-cell-with-ai.tsx +2 -0
- package/src/components/editor/ai/staged-cell-submission.ts +2 -2
- package/src/components/editor/ai/transport/chat-transport.tsx +1 -1
- package/src/components/editor/chrome/components/contribute-snippet-button.tsx +6 -1
- package/src/components/editor/connections/database/as-code.ts +44 -44
- package/src/components/editor/connections/storage/as-code.ts +3 -3
- package/src/components/editor/file-tree/requesting-tree.tsx +16 -13
- package/src/components/editor/navigation/clipboard.ts +2 -2
- package/src/components/editor/notebook-cell.tsx +2 -2
- package/src/components/editor/output/MarimoTracebackOutput.tsx +1 -1
- package/src/components/editor/output/VideoOutput.tsx +1 -1
- package/src/components/editor/output/ansi-reduce.ts +21 -17
- package/src/components/editor/output/console/ConsoleOutput.tsx +3 -3
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +59 -0
- package/src/components/editor/output/console/text-rendering.tsx +3 -1
- package/src/components/editor/package-alert.tsx +20 -7
- package/src/components/home/components.tsx +1 -0
- package/src/components/pages/run-page.tsx +1 -0
- package/src/components/slides/__tests__/minimap-actions.test.tsx +7 -7
- package/src/components/slides/__tests__/minimap.test.ts +12 -12
- package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +8 -8
- package/src/components/static-html/share-modal.tsx +2 -1
- package/src/components/static-html/static-banner.tsx +2 -2
- package/src/components/ui/links.tsx +6 -1
- package/src/components/ui/typography.tsx +16 -8
- package/src/core/ai/context/__tests__/registry.test.ts +31 -28
- package/src/core/ai/context/providers/cell-output.ts +8 -8
- package/src/core/ai/context/providers/datasource.ts +10 -7
- package/src/core/ai/context/providers/error.ts +7 -7
- package/src/core/ai/context/providers/file.ts +8 -8
- package/src/core/ai/context/providers/tables.ts +7 -7
- package/src/core/ai/context/providers/variable.ts +7 -7
- package/src/core/ai/context/registry.ts +18 -18
- package/src/core/ai/ids/ids.ts +5 -5
- package/src/core/ai/model-registry.ts +12 -9
- package/src/core/ai/staged-cells.ts +6 -6
- package/src/core/ai/tools/base.ts +6 -6
- package/src/core/ai/tools/edit-notebook-tool.ts +6 -6
- package/src/core/ai/tools/registry.ts +4 -4
- package/src/core/ai/tools/run-cells-tool.ts +7 -7
- package/src/core/ai/tools/sample-tool.ts +6 -6
- package/src/core/cells/__tests__/cells.test.ts +27 -0
- package/src/core/cells/cells.ts +2 -1
- package/src/core/codemirror/cells/debugger-decorations.ts +13 -7
- package/src/core/codemirror/cells/line-timing-decorations.ts +9 -9
- package/src/core/codemirror/cells/traceback-decorations.ts +7 -4
- package/src/core/codemirror/code-lens/extension.ts +13 -13
- package/src/core/codemirror/copilot/__tests__/language-server.test.ts +6 -6
- package/src/core/codemirror/copilot/__tests__/transport.test.ts +12 -12
- package/src/core/codemirror/copilot/language-server.ts +13 -13
- package/src/core/codemirror/copilot/transport.ts +1 -1
- package/src/core/codemirror/find-replace/search-highlight.ts +5 -5
- package/src/core/codemirror/go-to-definition/underline.ts +3 -3
- package/src/core/codemirror/keymaps/vim.ts +3 -3
- package/src/core/codemirror/language/languages/markdown.ts +8 -8
- package/src/core/codemirror/language/languages/python.ts +7 -7
- package/src/core/codemirror/language/languages/sql/completion-builder.ts +5 -5
- package/src/core/codemirror/language/languages/sql/completion-store.ts +4 -4
- package/src/core/codemirror/language/languages/sql/sql.ts +21 -21
- package/src/core/codemirror/lsp/__tests__/transports.test.ts +10 -10
- package/src/core/codemirror/lsp/federated-lsp.ts +29 -27
- package/src/core/codemirror/lsp/notebook-lsp.ts +21 -21
- package/src/core/codemirror/misc/__tests__/dnd.test.ts +10 -10
- package/src/core/codemirror/misc/__tests__/paste.test.ts +7 -4
- package/src/core/codemirror/reactive-references/extension.ts +3 -3
- package/src/core/codemirror/rtc/loro/awareness.ts +12 -12
- package/src/core/codemirror/rtc/loro/sync.ts +5 -5
- package/src/core/codemirror/vim/cursor-visibility.ts +3 -3
- package/src/core/dom/ui-element.ts +5 -5
- package/src/core/dom/uiregistry.ts +10 -10
- package/src/core/hotkeys/hotkeys.ts +9 -9
- package/src/core/islands/__tests__/bridge.test.ts +4 -4
- package/src/core/islands/__tests__/test-utils.tsx +4 -4
- package/src/core/islands/bridge.ts +85 -82
- package/src/core/islands/components/web-components.tsx +7 -7
- package/src/core/islands/worker/__tests__/controller.test.ts +1 -1
- package/src/core/islands/worker/controller.ts +6 -3
- package/src/core/islands/worker-factory.ts +2 -2
- package/src/core/kernel/RuntimeState.ts +4 -4
- package/src/core/lsp/__tests__/transport.test.ts +19 -19
- package/src/core/lsp/transport.ts +5 -5
- package/src/core/network/CachingRequestRegistry.ts +2 -2
- package/src/core/network/DeferredRequestRegistry.ts +4 -4
- package/src/core/runtime/runtime.ts +25 -20
- package/src/core/static/virtual-file-tracker.ts +5 -5
- package/src/core/wasm/__tests__/bridge.test.ts +2 -2
- package/src/core/wasm/bridge.ts +130 -126
- package/src/core/wasm/router.ts +5 -5
- package/src/core/wasm/store.ts +4 -4
- package/src/core/wasm/worker/bootstrap.ts +8 -5
- package/src/core/wasm/worker/message-buffer.ts +3 -3
- package/src/core/websocket/transports/__tests__/ws.test.ts +8 -8
- package/src/core/websocket/transports/basic.ts +15 -8
- package/src/core/websocket/transports/sse.ts +7 -7
- package/src/core/websocket/transports/transport.ts +3 -3
- package/src/core/websocket/transports/ws.ts +9 -7
- package/src/css/globals.css +18 -21
- package/src/css/katex.min.css +260 -241
- package/src/hooks/__tests__/useOverflowDetection.test.tsx +5 -5
- package/src/hooks/__tests__/useResizeObserver.test.tsx +12 -12
- package/src/plugins/core/registerReactComponent.tsx +5 -5
- package/src/plugins/core/sidebar-element.tsx +2 -2
- package/src/plugins/impl/ButtonPlugin.tsx +3 -3
- package/src/plugins/impl/CheckboxPlugin.tsx +3 -3
- package/src/plugins/impl/CodeEditorPlugin.tsx +3 -3
- package/src/plugins/impl/DatePickerPlugin.tsx +3 -3
- package/src/plugins/impl/DateRangePlugin.tsx +3 -3
- package/src/plugins/impl/DateTimePickerPlugin.tsx +3 -3
- package/src/plugins/impl/DictPlugin.tsx +3 -3
- package/src/plugins/impl/DropdownPlugin.tsx +3 -3
- package/src/plugins/impl/FileUploadPlugin.tsx +3 -3
- package/src/plugins/impl/MatrixPlugin.tsx +4 -4
- package/src/plugins/impl/MicrophonePlugin.tsx +3 -3
- package/src/plugins/impl/MultiselectPlugin.tsx +3 -3
- package/src/plugins/impl/NumberPlugin.tsx +3 -3
- package/src/plugins/impl/RadioPlugin.tsx +9 -5
- package/src/plugins/impl/RangeSliderPlugin.tsx +3 -3
- package/src/plugins/impl/RefreshPlugin.tsx +3 -3
- package/src/plugins/impl/SliderPlugin.tsx +3 -3
- package/src/plugins/impl/SwitchPlugin.tsx +3 -3
- package/src/plugins/impl/TabsPlugin.tsx +3 -3
- package/src/plugins/impl/TextAreaPlugin.tsx +3 -3
- package/src/plugins/impl/TextInputPlugin.tsx +3 -3
- package/src/plugins/impl/__tests__/MatrixPlugin.test.tsx +2 -2
- package/src/plugins/impl/anywidget/model.ts +10 -10
- package/src/plugins/impl/anywidget/registry.ts +12 -9
- package/src/plugins/impl/anywidget/runtime.ts +11 -9
- package/src/plugins/impl/anywidget/widget-binding.ts +6 -6
- package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +7 -6
- package/src/plugins/impl/matplotlib/MatplotlibPlugin.tsx +3 -3
- package/src/plugins/impl/matplotlib/__tests__/matplotlib-renderer.test.ts +2 -2
- package/src/plugins/impl/matplotlib/matplotlib-renderer.ts +2 -2
- package/src/plugins/impl/mpl-interactive/mpl-websocket-shim.ts +10 -10
- package/src/plugins/impl/panel/utils.ts +5 -5
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +3 -3
- package/src/plugins/impl/vega/VegaPlugin.tsx +3 -3
- package/src/plugins/impl/vega/__tests__/use-vega-container-remeasure.test.ts +7 -7
- package/src/plugins/impl/vega/__tests__/utils.test.ts +16 -1
- package/src/plugins/impl/vega/__tests__/vega.test.ts +37 -0
- package/src/plugins/impl/vega/loader.ts +23 -1
- package/src/plugins/impl/vega/utils.ts +5 -4
- package/src/plugins/layout/AccordionPlugin.tsx +3 -3
- package/src/plugins/layout/CalloutPlugin.tsx +3 -3
- package/src/plugins/layout/ImageComparisonPlugin.tsx +5 -3
- package/src/plugins/layout/JsonOutputPlugin.tsx +3 -3
- package/src/plugins/layout/MimeRenderPlugin.tsx +3 -3
- package/src/plugins/layout/NavigationMenuPlugin.tsx +3 -3
- package/src/plugins/layout/OutlinePlugin.tsx +3 -3
- package/src/plugins/layout/ProgressPlugin.tsx +3 -3
- package/src/plugins/layout/RoutesPlugin.tsx +6 -8
- package/src/plugins/layout/StatPlugin.tsx +3 -3
- package/src/plugins/layout/TexPlugin.tsx +3 -3
- package/src/plugins/layout/carousel/CarouselPlugin.tsx +4 -4
- package/src/plugins/layout/mermaid/MermaidPlugin.tsx +3 -3
- package/src/utils/Deferred.ts +6 -6
- package/src/utils/async-capture-tracker.ts +10 -7
- package/src/utils/errors.ts +5 -5
- package/src/utils/id-tree.tsx +83 -80
- package/src/utils/lru.ts +1 -1
- package/src/utils/multi-map.ts +14 -12
- package/src/utils/paths.ts +6 -6
- package/src/utils/pluralize.ts +3 -3
- package/src/utils/progress.ts +6 -6
- package/src/utils/python-poet/poet.ts +14 -14
- package/src/utils/routes.ts +4 -2
- package/src/utils/semaphore.ts +6 -6
- package/src/utils/storage/storage.ts +6 -6
- package/src/utils/storage/typed.ts +16 -12
- package/src/utils/time.ts +9 -9
- package/src/utils/timed-cache.ts +4 -4
- package/src/utils/tracer.ts +9 -6
- package/dist/classDiagram-ZZMXUADV-Fe-V14Sc.js +0 -30
- package/dist/classDiagram-v2-VYDZK3BY-xTDg7lOs.js +0 -30
- package/dist/flowDiagram-HODETNUW-6dMdB8pR.js +0 -16
- package/dist/katex-DFBiSucW.js +0 -21840
- package/dist/stateDiagram-v2-MP3YSRHH-o05_rJN8.js +0 -30
- package/dist/swimlanesDiagram-VR7AAH4N-D_nFQfRc.js +0 -30
|
@@ -99,21 +99,21 @@ function getLatestEngine(): ConnectionName {
|
|
|
99
99
|
*/
|
|
100
100
|
export class SQLLanguageAdapter implements LanguageAdapter<SQLLanguageAdapterMetadata> {
|
|
101
101
|
private parser = new SQLParser();
|
|
102
|
-
readonly type = "sql";
|
|
103
|
-
sqlModeEnabled: boolean;
|
|
102
|
+
public readonly type = "sql";
|
|
103
|
+
public sqlModeEnabled: boolean;
|
|
104
104
|
|
|
105
|
-
constructor() {
|
|
105
|
+
public constructor() {
|
|
106
106
|
this.sqlModeEnabled = true;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
get defaultMetadata(): SQLLanguageAdapterMetadata {
|
|
109
|
+
public get defaultMetadata(): SQLLanguageAdapterMetadata {
|
|
110
110
|
return {
|
|
111
111
|
...this.parser.defaultMetadata,
|
|
112
112
|
engine: getLatestEngine() || DUCKDB_ENGINE,
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
get defaultCode(): string {
|
|
116
|
+
public get defaultCode(): string {
|
|
117
117
|
const engine = getLatestEngine();
|
|
118
118
|
if (engine && engine !== DUCKDB_ENGINE) {
|
|
119
119
|
return `_df = mo.sql(f"""SELECT * FROM """, engine=${engine})`;
|
|
@@ -121,9 +121,9 @@ export class SQLLanguageAdapter implements LanguageAdapter<SQLLanguageAdapterMet
|
|
|
121
121
|
return this.parser.defaultCode;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
static fromQuery = (query: string) => SQLParser.fromQuery(query);
|
|
124
|
+
public static fromQuery = (query: string) => SQLParser.fromQuery(query);
|
|
125
125
|
|
|
126
|
-
transformIn(
|
|
126
|
+
public transformIn(
|
|
127
127
|
pythonCode: string,
|
|
128
128
|
): [
|
|
129
129
|
sqlQuery: string,
|
|
@@ -143,7 +143,7 @@ export class SQLLanguageAdapter implements LanguageAdapter<SQLLanguageAdapterMet
|
|
|
143
143
|
return [result.code, result.offset, metadata];
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
transformOut(
|
|
146
|
+
public transformOut(
|
|
147
147
|
code: string,
|
|
148
148
|
metadata: SQLLanguageAdapterMetadata,
|
|
149
149
|
): [string, number] {
|
|
@@ -151,11 +151,11 @@ export class SQLLanguageAdapter implements LanguageAdapter<SQLLanguageAdapterMet
|
|
|
151
151
|
return [result.code, result.offset];
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
isSupported(pythonCode: string): boolean {
|
|
154
|
+
public isSupported(pythonCode: string): boolean {
|
|
155
155
|
return this.parser.isSupported(pythonCode);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
getExtension(
|
|
158
|
+
public getExtension(
|
|
159
159
|
_cellId: CellId,
|
|
160
160
|
_completionConfig: CompletionConfig,
|
|
161
161
|
_hotkeys: HotkeyProvider,
|
|
@@ -309,19 +309,19 @@ class DialectAwareQueryContextAnalyzer extends QueryContextAnalyzer {
|
|
|
309
309
|
private readonly analyzers = new Map<ParserDialects, QueryContextAnalyzer>();
|
|
310
310
|
private readonly analysisParser: NodeSqlParser;
|
|
311
311
|
|
|
312
|
-
constructor(analysisParser: NodeSqlParser) {
|
|
312
|
+
public constructor(analysisParser: NodeSqlParser) {
|
|
313
313
|
super(analysisParser);
|
|
314
314
|
this.analysisParser = analysisParser;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
override getContext(
|
|
317
|
+
public override getContext(
|
|
318
318
|
sql: string,
|
|
319
319
|
opts: { state: EditorState },
|
|
320
320
|
): ReturnType<QueryContextAnalyzer["getContext"]> {
|
|
321
321
|
return this.getAnalyzer(opts.state).getContext(sql, opts);
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
override clearCache(): void {
|
|
324
|
+
public override clearCache(): void {
|
|
325
325
|
for (const analyzer of this.analyzers.values()) {
|
|
326
326
|
analyzer.clearCache();
|
|
327
327
|
}
|
|
@@ -342,25 +342,25 @@ class DialectAwareSqlStructureAnalyzer extends SqlStructureAnalyzer {
|
|
|
342
342
|
private readonly analyzers = new Map<ParserDialects, SqlStructureAnalyzer>();
|
|
343
343
|
private readonly analysisParser: NodeSqlParser;
|
|
344
344
|
|
|
345
|
-
constructor(analysisParser: NodeSqlParser) {
|
|
345
|
+
public constructor(analysisParser: NodeSqlParser) {
|
|
346
346
|
super(analysisParser);
|
|
347
347
|
this.analysisParser = analysisParser;
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
override analyzeDocument(
|
|
350
|
+
public override analyzeDocument(
|
|
351
351
|
state: EditorState,
|
|
352
352
|
): ReturnType<SqlStructureAnalyzer["analyzeDocument"]> {
|
|
353
353
|
return this.getAnalyzer(state).analyzeDocument(state);
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
-
override getStatementAtPosition(
|
|
356
|
+
public override getStatementAtPosition(
|
|
357
357
|
state: EditorState,
|
|
358
358
|
position: number,
|
|
359
359
|
): ReturnType<SqlStructureAnalyzer["getStatementAtPosition"]> {
|
|
360
360
|
return this.getAnalyzer(state).getStatementAtPosition(state, position);
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
-
override getStatementsInRange(
|
|
363
|
+
public override getStatementsInRange(
|
|
364
364
|
state: EditorState,
|
|
365
365
|
from: number,
|
|
366
366
|
to: number,
|
|
@@ -368,7 +368,7 @@ class DialectAwareSqlStructureAnalyzer extends SqlStructureAnalyzer {
|
|
|
368
368
|
return this.getAnalyzer(state).getStatementsInRange(state, from, to);
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
override clearCache(): void {
|
|
371
|
+
public override clearCache(): void {
|
|
372
372
|
for (const analyzer of this.analyzers.values()) {
|
|
373
373
|
analyzer.clearCache();
|
|
374
374
|
}
|
|
@@ -392,7 +392,7 @@ class CustomSqlParser extends NodeSqlParser {
|
|
|
392
392
|
private readonly VALIDATION_DELAY_MS = 300; // Wait 300ms after user stops typing
|
|
393
393
|
private isFocused = false; // Only validate if the editor is focused
|
|
394
394
|
|
|
395
|
-
setFocusState(focused: boolean) {
|
|
395
|
+
public setFocusState(focused: boolean) {
|
|
396
396
|
this.isFocused = focused;
|
|
397
397
|
}
|
|
398
398
|
|
|
@@ -446,7 +446,7 @@ class CustomSqlParser extends NodeSqlParser {
|
|
|
446
446
|
});
|
|
447
447
|
}
|
|
448
448
|
|
|
449
|
-
override async validateSql(
|
|
449
|
+
public override async validateSql(
|
|
450
450
|
sql: string,
|
|
451
451
|
opts: { state: EditorState },
|
|
452
452
|
): Promise<SqlParseError[]> {
|
|
@@ -470,7 +470,7 @@ class CustomSqlParser extends NodeSqlParser {
|
|
|
470
470
|
);
|
|
471
471
|
}
|
|
472
472
|
|
|
473
|
-
override async parse(
|
|
473
|
+
public override async parse(
|
|
474
474
|
sql: string,
|
|
475
475
|
opts: { state: EditorState },
|
|
476
476
|
): Promise<NodeSqlParserResult> {
|
|
@@ -17,38 +17,38 @@ vi.mock("../../../runtime/config", () => ({
|
|
|
17
17
|
|
|
18
18
|
/** Minimal stand-in for the browser WebSocket used by `WebSocketTransport`. */
|
|
19
19
|
class FakeWebSocket {
|
|
20
|
-
static readonly instances: FakeWebSocket[] = [];
|
|
21
|
-
static readonly OPEN = 1;
|
|
20
|
+
public static readonly instances: FakeWebSocket[] = [];
|
|
21
|
+
public static readonly OPEN = 1;
|
|
22
22
|
|
|
23
|
-
readyState = 0;
|
|
24
|
-
readonly url: string;
|
|
23
|
+
public readyState = 0;
|
|
24
|
+
public readonly url: string;
|
|
25
25
|
private readonly listeners = new Map<string, Set<(event: unknown) => void>>();
|
|
26
26
|
|
|
27
|
-
constructor(url: string) {
|
|
27
|
+
public constructor(url: string) {
|
|
28
28
|
this.url = url;
|
|
29
29
|
FakeWebSocket.instances.push(this);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
addEventListener(type: string, listener: (event: unknown) => void) {
|
|
32
|
+
public addEventListener(type: string, listener: (event: unknown) => void) {
|
|
33
33
|
const listeners = this.listeners.get(type) ?? new Set();
|
|
34
34
|
listeners.add(listener);
|
|
35
35
|
this.listeners.set(type, listeners);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
send() {
|
|
38
|
+
public send() {
|
|
39
39
|
// no-op
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
close() {
|
|
42
|
+
public close() {
|
|
43
43
|
this.readyState = 3;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
open() {
|
|
46
|
+
public open() {
|
|
47
47
|
this.readyState = FakeWebSocket.OPEN;
|
|
48
48
|
this.emit("open", {});
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
receive(message: unknown) {
|
|
51
|
+
public receive(message: unknown) {
|
|
52
52
|
this.emit("message", { data: JSON.stringify(message) });
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -18,12 +18,12 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
18
18
|
private readonly clients: ILanguageServerClient[] = [];
|
|
19
19
|
public readonly documentUri: string;
|
|
20
20
|
|
|
21
|
-
constructor(clients: ILanguageServerClient[]) {
|
|
21
|
+
public constructor(clients: ILanguageServerClient[]) {
|
|
22
22
|
this.clients = clients;
|
|
23
23
|
this.documentUri = getLspDocumentUri();
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
onNotification(
|
|
26
|
+
public onNotification(
|
|
27
27
|
listener: (n: {
|
|
28
28
|
jsonrpc: "2.0";
|
|
29
29
|
id?: null | undefined;
|
|
@@ -43,7 +43,7 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
get clientCapabilities(): LSP.ClientCapabilities | undefined {
|
|
46
|
+
public get clientCapabilities(): LSP.ClientCapabilities | undefined {
|
|
47
47
|
const capabilities = this.clients
|
|
48
48
|
.map((client) => {
|
|
49
49
|
if (client.clientCapabilities) {
|
|
@@ -59,34 +59,34 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
59
59
|
return mergeDictsIgnoreFalsey<LSP.ClientCapabilities>(capabilities);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
get ready(): boolean {
|
|
62
|
+
public get ready(): boolean {
|
|
63
63
|
return this.clients.some((client) => client.ready);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
set ready(value: boolean) {
|
|
66
|
+
public set ready(value: boolean) {
|
|
67
67
|
this.clients.forEach((client) => {
|
|
68
68
|
client.ready = value;
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
get capabilities(): LSP.ServerCapabilities | null {
|
|
72
|
+
public get capabilities(): LSP.ServerCapabilities | null {
|
|
73
73
|
const capabilities = this.clients
|
|
74
74
|
.map((client) => client.capabilities)
|
|
75
75
|
.filter((c): c is LSP.ServerCapabilities => c !== null);
|
|
76
76
|
return mergeDictsIgnoreFalsey<LSP.ServerCapabilities>(capabilities);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
set capabilities(value: LSP.ServerCapabilities) {
|
|
79
|
+
public set capabilities(value: LSP.ServerCapabilities) {
|
|
80
80
|
this.clients.forEach((client) => {
|
|
81
81
|
client.capabilities = value;
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
get initializePromise(): Promise<void> {
|
|
85
|
+
public get initializePromise(): Promise<void> {
|
|
86
86
|
return this.clients[0].initializePromise;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
set initializePromise(value: Promise<void>) {
|
|
89
|
+
public set initializePromise(value: Promise<void>) {
|
|
90
90
|
this.clients.forEach((client) => {
|
|
91
91
|
client.initializePromise = value;
|
|
92
92
|
});
|
|
@@ -104,19 +104,19 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
104
104
|
return this.clients.filter((client) => client.hasCapability(method));
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
hasCapability(method: string): boolean {
|
|
107
|
+
public hasCapability(method: string): boolean {
|
|
108
108
|
return this.clients.some((client) => client.hasCapability(method));
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
async initialize(): Promise<void> {
|
|
111
|
+
public async initialize(): Promise<void> {
|
|
112
112
|
await Promise.all(this.clients.map((client) => client.initialize()));
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
async close(): Promise<void> {
|
|
115
|
+
public async close(): Promise<void> {
|
|
116
116
|
await Promise.all(this.clients.map((client) => client.close()));
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
async textDocumentDidChange(
|
|
119
|
+
public async textDocumentDidChange(
|
|
120
120
|
params: LSP.DidChangeTextDocumentParams,
|
|
121
121
|
): Promise<void> {
|
|
122
122
|
await Promise.all(
|
|
@@ -124,7 +124,7 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
async completionItemResolve(
|
|
127
|
+
public async completionItemResolve(
|
|
128
128
|
item: LSP.CompletionItem,
|
|
129
129
|
): Promise<LSP.CompletionItem> {
|
|
130
130
|
const client = this.firstWithMethod("textDocument/completion");
|
|
@@ -134,7 +134,7 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
134
134
|
return item;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
async textDocumentCodeAction(
|
|
137
|
+
public async textDocumentCodeAction(
|
|
138
138
|
params: LSP.CodeActionParams,
|
|
139
139
|
): Promise<(LSP.Command | LSP.CodeAction)[] | null> {
|
|
140
140
|
const client = this.firstWithMethod("textDocument/codeAction");
|
|
@@ -144,12 +144,14 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
144
144
|
return null;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
async codeActionResolve(
|
|
147
|
+
public async codeActionResolve(
|
|
148
|
+
action: LSP.CodeAction,
|
|
149
|
+
): Promise<LSP.CodeAction> {
|
|
148
150
|
const client = this.firstWithMethod("textDocument/codeAction");
|
|
149
151
|
return client ? client.codeActionResolve(action) : action;
|
|
150
152
|
}
|
|
151
153
|
|
|
152
|
-
async textDocumentRename(
|
|
154
|
+
public async textDocumentRename(
|
|
153
155
|
params: LSP.RenameParams,
|
|
154
156
|
): Promise<LSP.WorkspaceEdit | null> {
|
|
155
157
|
const client = this.firstWithMethod("textDocument/rename");
|
|
@@ -159,7 +161,7 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
159
161
|
return null;
|
|
160
162
|
}
|
|
161
163
|
|
|
162
|
-
async textDocumentPrepareRename(
|
|
164
|
+
public async textDocumentPrepareRename(
|
|
163
165
|
params: LSP.PrepareRenameParams,
|
|
164
166
|
): Promise<LSP.PrepareRenameResult | null> {
|
|
165
167
|
const client = this.firstWithMethod("textDocument/prepareRename");
|
|
@@ -169,7 +171,7 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
169
171
|
return null;
|
|
170
172
|
}
|
|
171
173
|
|
|
172
|
-
async textDocumentSignatureHelp(
|
|
174
|
+
public async textDocumentSignatureHelp(
|
|
173
175
|
params: LSP.SignatureHelpParams,
|
|
174
176
|
): Promise<LSP.SignatureHelp | null> {
|
|
175
177
|
const client = this.firstWithMethod("textDocument/signatureHelp");
|
|
@@ -180,7 +182,7 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
180
182
|
}
|
|
181
183
|
|
|
182
184
|
// Merge completions from all clients
|
|
183
|
-
async textDocumentCompletion(
|
|
185
|
+
public async textDocumentCompletion(
|
|
184
186
|
params: LSP.CompletionParams,
|
|
185
187
|
): Promise<LSP.CompletionList | LSP.CompletionItem[] | null> {
|
|
186
188
|
const clients = this.clientsWithMethod("textDocument/completion");
|
|
@@ -191,7 +193,7 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
191
193
|
return mergeCompletions(results);
|
|
192
194
|
}
|
|
193
195
|
|
|
194
|
-
async textDocumentDefinition(
|
|
196
|
+
public async textDocumentDefinition(
|
|
195
197
|
params: LSP.DefinitionParams,
|
|
196
198
|
): Promise<LSP.Definition | LSP.LocationLink[] | null> {
|
|
197
199
|
const client = this.firstWithMethod("textDocument/definition");
|
|
@@ -201,7 +203,7 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
201
203
|
return null;
|
|
202
204
|
}
|
|
203
205
|
|
|
204
|
-
async textDocumentDidOpen(
|
|
206
|
+
public async textDocumentDidOpen(
|
|
205
207
|
params: LSP.DidOpenTextDocumentParams,
|
|
206
208
|
): Promise<boolean> {
|
|
207
209
|
const results = await Promise.all(
|
|
@@ -211,7 +213,7 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
211
213
|
return results.some((result) => result !== false);
|
|
212
214
|
}
|
|
213
215
|
|
|
214
|
-
async textDocumentDidClose(
|
|
216
|
+
public async textDocumentDidClose(
|
|
215
217
|
params: LSP.DidCloseTextDocumentParams,
|
|
216
218
|
): Promise<void> {
|
|
217
219
|
await Promise.all(
|
|
@@ -219,7 +221,7 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
219
221
|
);
|
|
220
222
|
}
|
|
221
223
|
|
|
222
|
-
async textDocumentWillSave(
|
|
224
|
+
public async textDocumentWillSave(
|
|
223
225
|
params: LSP.WillSaveTextDocumentParams,
|
|
224
226
|
): Promise<void> {
|
|
225
227
|
await Promise.all(
|
|
@@ -227,7 +229,7 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
227
229
|
);
|
|
228
230
|
}
|
|
229
231
|
|
|
230
|
-
async textDocumentWillSaveWaitUntil(
|
|
232
|
+
public async textDocumentWillSaveWaitUntil(
|
|
231
233
|
params: LSP.WillSaveTextDocumentParams,
|
|
232
234
|
): Promise<LSP.TextEdit[] | null> {
|
|
233
235
|
// This blocks the save, so query concurrently rather than paying the sum of
|
|
@@ -247,7 +249,7 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
247
249
|
return null;
|
|
248
250
|
}
|
|
249
251
|
|
|
250
|
-
async textDocumentDidSave(
|
|
252
|
+
public async textDocumentDidSave(
|
|
251
253
|
params: LSP.DidSaveTextDocumentParams,
|
|
252
254
|
): Promise<void> {
|
|
253
255
|
await Promise.all(
|
|
@@ -255,7 +257,7 @@ export class FederatedLanguageServerClient implements ILanguageServerClient {
|
|
|
255
257
|
);
|
|
256
258
|
}
|
|
257
259
|
|
|
258
|
-
async textDocumentHover(params: LSP.HoverParams): Promise<LSP.Hover> {
|
|
260
|
+
public async textDocumentHover(params: LSP.HoverParams): Promise<LSP.Hover> {
|
|
259
261
|
for (const client of this.clients) {
|
|
260
262
|
if (!client.hasCapability("textDocument/hover")) {
|
|
261
263
|
continue;
|
|
@@ -42,7 +42,7 @@ class Snapshotter {
|
|
|
42
42
|
codes: Record<CellId, string>;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
constructor(
|
|
45
|
+
public constructor(
|
|
46
46
|
getNotebookCode: () => {
|
|
47
47
|
cellIds: CellId[];
|
|
48
48
|
codes: Record<CellId, string>;
|
|
@@ -226,7 +226,7 @@ export class NotebookLanguageServerClient implements ILanguageServerClient {
|
|
|
226
226
|
private latestDiagnosticsVersion: number | null = null;
|
|
227
227
|
private forwardedDiagnosticsVersion = 0;
|
|
228
228
|
|
|
229
|
-
constructor(
|
|
229
|
+
public constructor(
|
|
230
230
|
client: ILanguageServerClient,
|
|
231
231
|
initialSettings: Record<string, unknown>,
|
|
232
232
|
getNotebookEditors: () => Record<
|
|
@@ -254,7 +254,7 @@ export class NotebookLanguageServerClient implements ILanguageServerClient {
|
|
|
254
254
|
this.snapshotter = new Snapshotter(this.getNotebookCode.bind(this));
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
onNotification(
|
|
257
|
+
public onNotification(
|
|
258
258
|
listener: (n: {
|
|
259
259
|
jsonrpc: "2.0";
|
|
260
260
|
id?: null | undefined;
|
|
@@ -265,44 +265,44 @@ export class NotebookLanguageServerClient implements ILanguageServerClient {
|
|
|
265
265
|
return this.client.onNotification(listener);
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
get ready(): boolean {
|
|
268
|
+
public get ready(): boolean {
|
|
269
269
|
return this.client.ready;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
set ready(value: boolean) {
|
|
272
|
+
public set ready(value: boolean) {
|
|
273
273
|
this.client.ready = value;
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
get capabilities(): LSP.ServerCapabilities | null {
|
|
276
|
+
public get capabilities(): LSP.ServerCapabilities | null {
|
|
277
277
|
return this.client.capabilities;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
set capabilities(value: LSP.ServerCapabilities) {
|
|
280
|
+
public set capabilities(value: LSP.ServerCapabilities) {
|
|
281
281
|
this.client.capabilities = value;
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
get initializePromise(): Promise<void> {
|
|
284
|
+
public get initializePromise(): Promise<void> {
|
|
285
285
|
return this.client.initializePromise;
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
set initializePromise(value: Promise<void>) {
|
|
288
|
+
public set initializePromise(value: Promise<void>) {
|
|
289
289
|
this.client.initializePromise = value;
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
get clientCapabilities() {
|
|
292
|
+
public get clientCapabilities() {
|
|
293
293
|
return this.client.clientCapabilities;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
async initialize(): Promise<void> {
|
|
296
|
+
public async initialize(): Promise<void> {
|
|
297
297
|
await this.client.initialize();
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
close(): void {
|
|
300
|
+
public close(): void {
|
|
301
301
|
this.openCellDocumentCounts.clear();
|
|
302
302
|
this.client.close();
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
hasCapability(method: string): boolean {
|
|
305
|
+
public hasCapability(method: string): boolean {
|
|
306
306
|
return this.client.hasCapability(method);
|
|
307
307
|
}
|
|
308
308
|
|
|
@@ -430,7 +430,7 @@ export class NotebookLanguageServerClient implements ILanguageServerClient {
|
|
|
430
430
|
* This ensures the caller uses the same lens that was sent to the server,
|
|
431
431
|
* avoiding race conditions if cells change between sync and subsequent operations.
|
|
432
432
|
*/
|
|
433
|
-
async sync(): Promise<{
|
|
433
|
+
public async sync(): Promise<{
|
|
434
434
|
params: LSP.DidChangeTextDocumentParams;
|
|
435
435
|
lens: NotebookLens;
|
|
436
436
|
}> {
|
|
@@ -499,7 +499,7 @@ export class NotebookLanguageServerClient implements ILanguageServerClient {
|
|
|
499
499
|
});
|
|
500
500
|
}
|
|
501
501
|
|
|
502
|
-
async textDocumentDefinition(
|
|
502
|
+
public async textDocumentDefinition(
|
|
503
503
|
params: LSP.DefinitionParams,
|
|
504
504
|
): Promise<LSP.Definition | LSP.LocationLink[] | null> {
|
|
505
505
|
// Get the cell document URI from the params
|
|
@@ -525,7 +525,7 @@ export class NotebookLanguageServerClient implements ILanguageServerClient {
|
|
|
525
525
|
});
|
|
526
526
|
}
|
|
527
527
|
|
|
528
|
-
async textDocumentSignatureHelp(
|
|
528
|
+
public async textDocumentSignatureHelp(
|
|
529
529
|
params: LSP.SignatureHelpParams,
|
|
530
530
|
): Promise<LSP.SignatureHelp | null> {
|
|
531
531
|
const cellDocumentUri = params.textDocument.uri;
|
|
@@ -572,7 +572,7 @@ export class NotebookLanguageServerClient implements ILanguageServerClient {
|
|
|
572
572
|
*
|
|
573
573
|
* See textDocumentRename for a similar workaround that manually applies edits.
|
|
574
574
|
*/
|
|
575
|
-
textDocumentCodeAction(
|
|
575
|
+
public textDocumentCodeAction(
|
|
576
576
|
params: LSP.CodeActionParams,
|
|
577
577
|
): Promise<(LSP.Command | LSP.CodeAction)[] | null> {
|
|
578
578
|
const disabledCodeAction = true;
|
|
@@ -582,7 +582,7 @@ export class NotebookLanguageServerClient implements ILanguageServerClient {
|
|
|
582
582
|
return this.client.textDocumentCodeAction(params);
|
|
583
583
|
}
|
|
584
584
|
|
|
585
|
-
codeActionResolve(action: LSP.CodeAction): Promise<LSP.CodeAction> {
|
|
585
|
+
public codeActionResolve(action: LSP.CodeAction): Promise<LSP.CodeAction> {
|
|
586
586
|
return Promise.resolve(action);
|
|
587
587
|
}
|
|
588
588
|
|
|
@@ -646,7 +646,7 @@ export class NotebookLanguageServerClient implements ILanguageServerClient {
|
|
|
646
646
|
* LSP edit application flow. The trade-off is that we lose undo grouping
|
|
647
647
|
* across cells.
|
|
648
648
|
*/
|
|
649
|
-
async textDocumentRename(
|
|
649
|
+
public async textDocumentRename(
|
|
650
650
|
params: LSP.RenameParams,
|
|
651
651
|
): Promise<LSP.WorkspaceEdit | null> {
|
|
652
652
|
// Get the cell document URI from the params
|
|
@@ -784,7 +784,7 @@ export class NotebookLanguageServerClient implements ILanguageServerClient {
|
|
|
784
784
|
};
|
|
785
785
|
}
|
|
786
786
|
|
|
787
|
-
async completionItemResolve(
|
|
787
|
+
public async completionItemResolve(
|
|
788
788
|
params: LSP.CompletionItem,
|
|
789
789
|
): Promise<LSP.CompletionItem> {
|
|
790
790
|
// Used cached result to avoid jitter while typing in the same completion item
|
|
@@ -801,7 +801,7 @@ export class NotebookLanguageServerClient implements ILanguageServerClient {
|
|
|
801
801
|
return resolved;
|
|
802
802
|
}
|
|
803
803
|
|
|
804
|
-
async textDocumentPrepareRename(
|
|
804
|
+
public async textDocumentPrepareRename(
|
|
805
805
|
params: LSP.PrepareRenameParams,
|
|
806
806
|
): Promise<LSP.PrepareRenameResult | null> {
|
|
807
807
|
// Get the cell document URI from the params
|
|
@@ -66,11 +66,11 @@ describe("dnd", () => {
|
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
class DragEvent extends Event {
|
|
69
|
-
dataTransfer: DataTransfer;
|
|
70
|
-
clientX: number;
|
|
71
|
-
clientY: number;
|
|
69
|
+
public dataTransfer: DataTransfer;
|
|
70
|
+
public clientX: number;
|
|
71
|
+
public clientY: number;
|
|
72
72
|
|
|
73
|
-
constructor(
|
|
73
|
+
public constructor(
|
|
74
74
|
type: string,
|
|
75
75
|
{
|
|
76
76
|
dataTransfer,
|
|
@@ -86,14 +86,14 @@ class DragEvent extends Event {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
class DataTransfer {
|
|
89
|
-
data: Record<string, string> = {};
|
|
90
|
-
_items: File[] = [];
|
|
89
|
+
public data: Record<string, string> = {};
|
|
90
|
+
public _items: File[] = [];
|
|
91
91
|
|
|
92
|
-
setData(type: string, data: string) {
|
|
92
|
+
public setData(type: string, data: string) {
|
|
93
93
|
this.data[type] = data;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
get items() {
|
|
96
|
+
public get items() {
|
|
97
97
|
return {
|
|
98
98
|
add: (file: File) => {
|
|
99
99
|
this._items.push(file);
|
|
@@ -101,11 +101,11 @@ class DataTransfer {
|
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
get files() {
|
|
104
|
+
public get files() {
|
|
105
105
|
return this._items;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
getData(type: string) {
|
|
108
|
+
public getData(type: string) {
|
|
109
109
|
return this.data[type];
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -320,17 +320,20 @@ def foo():
|
|
|
320
320
|
// Mock ClipboardEvent and DataTransfer
|
|
321
321
|
class MockDataTransfer {
|
|
322
322
|
private data: Record<string, string> = {};
|
|
323
|
-
setData(format: string, data: string) {
|
|
323
|
+
public setData(format: string, data: string) {
|
|
324
324
|
this.data[format] = data;
|
|
325
325
|
}
|
|
326
|
-
getData(format: string) {
|
|
326
|
+
public getData(format: string) {
|
|
327
327
|
return this.data[format];
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
class MockClipboardEvent extends Event {
|
|
332
|
-
clipboardData: MockDataTransfer;
|
|
333
|
-
constructor(
|
|
332
|
+
public clipboardData: MockDataTransfer;
|
|
333
|
+
public constructor(
|
|
334
|
+
type: string,
|
|
335
|
+
init?: { clipboardData?: MockDataTransfer },
|
|
336
|
+
) {
|
|
334
337
|
super(type);
|
|
335
338
|
this.clipboardData = init?.clipboardData || new MockDataTransfer();
|
|
336
339
|
}
|
|
@@ -50,7 +50,7 @@ class ReactiveReferencesPlugin {
|
|
|
50
50
|
// Debounced function to trigger highlighting
|
|
51
51
|
private readonly scheduleHighlighting: DebouncedFunc<() => void>;
|
|
52
52
|
|
|
53
|
-
constructor(view: EditorView, cellId: CellId) {
|
|
53
|
+
public constructor(view: EditorView, cellId: CellId) {
|
|
54
54
|
this.view = view;
|
|
55
55
|
this.cellId = cellId;
|
|
56
56
|
|
|
@@ -67,13 +67,13 @@ class ReactiveReferencesPlugin {
|
|
|
67
67
|
this.scheduleHighlighting();
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
update(update: ViewUpdate) {
|
|
70
|
+
public update(update: ViewUpdate) {
|
|
71
71
|
if (update.docChanged || update.focusChanged) {
|
|
72
72
|
this.scheduleHighlighting();
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
destroy() {
|
|
76
|
+
public destroy() {
|
|
77
77
|
this.scheduleHighlighting.cancel();
|
|
78
78
|
this.variablesUnsubscribe();
|
|
79
79
|
}
|