@marimo-team/islands 0.25.2-dev99 → 0.25.3-dev10
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-BZmqc_F0.js → ConnectedDataExplorerComponent-CNMliVzw.js} +15 -15
- package/dist/{ErrorBoundary-CXkr_IcB.js → ErrorBoundary-BsqSMK9Y.js} +12 -12
- package/dist/{ImageComparisonComponent-Cpfz30OZ.js → ImageComparisonComponent-uU8FSKZE.js} +3 -3
- package/dist/{Plot-CTyjbQDT.js → Plot-DdYOe1UK.js} +2 -2
- package/dist/{abnfDiagram-VCTEODGH-C_Lmaa2j.js → abnfDiagram-VCTEODGH-D-Ez91gV.js} +3 -3
- package/dist/{any-language-editor-BFzqhOBR.js → any-language-editor-DZ_YTVus.js} +7 -7
- package/dist/{architectureDiagram-5GKGNRK7-BKMataHB.js → architectureDiagram-5GKGNRK7-CTpcNtO8.js} +5 -5
- package/dist/assets/__vite-browser-external-BXYkiFsk.js +1 -0
- package/dist/assets/worker-HPY9fbhz.js +114 -0
- package/dist/{blockDiagram-I7D4REHJ-BeHOjyDk.js → blockDiagram-I7D4REHJ-Cg25UrxT.js} +9 -9
- package/dist/{button-BtsM2UqM.js → button-CvjkwdSk.js} +5 -5
- package/dist/{c4Diagram-7LVT6UL2-Bao10t_O.js → c4Diagram-7LVT6UL2-BxFgrnNV.js} +7 -7
- package/dist/{capabilities-A5jrzjCJ.js → capabilities-CQ5IjhzL.js} +1 -1
- package/dist/{channel-BxCkvUgE.js → channel-CPObtJXj.js} +1 -1
- package/dist/{chat-ui-CwOWzoSO.js → chat-ui-0lKdOoQ3.js} +1588 -1396
- package/dist/{check-CNP79M3A.js → check-EDwSwP89.js} +1 -1
- package/dist/{chunk-4HAMMTFA-CH7Gpamd.js → chunk-4HAMMTFA-D4eFPyFh.js} +5 -5
- package/dist/{chunk-75Z2AOVW-AI7CvgKn.js → chunk-75Z2AOVW-D7gxIs2Q.js} +1 -1
- package/dist/{chunk-DU6HZSFF-BSvuTkX4.js → chunk-DU6HZSFF-BwiyaNpg.js} +1 -1
- package/dist/{chunk-F27PBJKO-CLshwT9T.js → chunk-F27PBJKO-ufseIn5y.js} +1 -1
- package/dist/{chunk-GMAD6QVW-wnHcn-lH.js → chunk-GMAD6QVW-BhaJx0X3.js} +3 -3
- package/dist/{chunk-GVQU2GXP-7O2p8hut.js → chunk-GVQU2GXP-Cwbt-lF0.js} +2 -2
- package/dist/{chunk-IMKFNOWR-Bu0Vh_Yi.js → chunk-IMKFNOWR-DGxi-zeo.js} +5 -5
- package/dist/{chunk-L3NEJ4N5-B9_Alrxb.js → chunk-L3NEJ4N5-n-zgIVSy.js} +5 -5
- package/dist/{chunk-OSK3NFVY-PeQPH2fD.js → chunk-OSK3NFVY-DXa-Cxbn.js} +6 -6
- package/dist/{chunk-P2QGCYS3-D9twiFuU.js → chunk-P2QGCYS3-B_Zd3-X0.js} +1 -1
- package/dist/{chunk-POPQ4Y6H-BUiNs18s.js → chunk-POPQ4Y6H-hYOXbYH_.js} +1 -1
- package/dist/{chunk-PWAF6VOD-D8S9NPCy.js → chunk-PWAF6VOD-CQw5qATZ.js} +1 -1
- package/dist/{chunk-SHT3W25Y-B2dyNZ31.js → chunk-SHT3W25Y-CV9J3rAB.js} +7 -7
- package/dist/{chunk-SVP7TREG-D7UPvB10.js → chunk-SVP7TREG-BL-9Fqgg.js} +2 -2
- package/dist/{chunk-TICWLB2K-BNaGoadd.js → chunk-TICWLB2K-Cu_XMjDM.js} +5 -5
- package/dist/{chunk-YOKDWASO-DrWbKnxA.js → chunk-YOKDWASO-DPZk8vhS.js} +6 -6
- package/dist/classDiagram-ZZMXUADV-BXXV13Hq.js +30 -0
- package/dist/classDiagram-v2-VYDZK3BY-B7FXJ1Cp.js +30 -0
- package/dist/{code-visibility-pPjYsRTH.js → code-visibility-CXQvUXHT.js} +18 -18
- package/dist/{common-CkvBp0B4.js → common-CuD-CAC-.js} +6128 -7136
- package/dist/{compiler-runtime-Cj8ZWiNS.js → compiler-runtime-CldRdSsv.js} +2 -2
- package/dist/{copy-icon-BY7jgcaV.js → copy-icon-Ft7t9bqz.js} +6 -6
- package/dist/{cynefinDiagram-5FMLGOSQ-CCDn4Z9e.js → cynefinDiagram-5FMLGOSQ-CH96rwba.js} +3 -3
- package/dist/{dagre-GXQ25YYZ-BJiUO_SV.js → dagre-GXQ25YYZ-BD3PmpFY.js} +10 -10
- package/dist/{data-grid-overlay-editor-L6ELxFAh.js → data-grid-overlay-editor-DgeyYmC1.js} +7 -7
- package/dist/{data-grid-types-BucVmDDp.js → data-grid-types-BH_r7g7l.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-BZfxFNRR.js → diagram-S7CK7UJ4-BsSJJldB.js} +4 -4
- package/dist/{diagram-UQ7AKVKN-1xcsiIMg.js → diagram-UQ7AKVKN-muQtNZc4.js} +3 -3
- package/dist/{diagram-VSXAHHWV-DPAWJ9Nw.js → diagram-VSXAHHWV-BJWcVVJY.js} +2 -2
- package/dist/{diagram-VX7I27RA-DmRsnHYY.js → diagram-VX7I27RA-CdhuZAqR.js} +5 -5
- package/dist/{diagram-Z3DM3KII--b49ryKx.js → diagram-Z3DM3KII-BD8mXjOj.js} +3 -3
- package/dist/{dialog-CmExhUDI.js → dialog-CEBFZNyc.js} +6 -6
- package/dist/{dist-CcyKTBTF.js → dist-DpBpA_n1.js} +2 -2
- package/dist/{dropdown-menu-Cz4TdOJh.js → dropdown-menu-CP_qCYHC.js} +139 -139
- package/dist/{ebnfDiagram-PWID7BFC-rSwVyh4y.js → ebnfDiagram-PWID7BFC-BIN1sweE.js} +3 -3
- package/dist/{erDiagram-RLTQ6QDP-Bfd3iAoC.js → erDiagram-RLTQ6QDP-Ctp5cfoN.js} +12 -12
- package/dist/{error-banner-D30nA9nE.js → error-banner-D-WCIiMt.js} +16 -11
- package/dist/{cells-DZi0ioak.js → error-entries-DSvFWT_M.js} +6171 -5075
- package/dist/{esm-DAVrGVKP.js → esm-AMFssoNp.js} +4 -4
- package/dist/{feedback-button-D-pV0Qji.js → feedback-button-DZMj9PF3.js} +119 -120
- package/dist/flowDiagram-HODETNUW-3EfLrlFb.js +16 -0
- package/dist/{formats-DhhbdyAH.js → formats-CeOmU1MU.js} +6 -6
- package/dist/{ganttDiagram-EL5Y4UJY-B4m_YsKa.js → ganttDiagram-EL5Y4UJY-BQT16JSc.js} +2 -2
- package/dist/{gitGraphDiagram-WWUBYQGX-QRBbvWXh.js → gitGraphDiagram-WWUBYQGX-D5nSIzdE.js} +2 -2
- package/dist/{glide-data-editor-D6CfYwdr.js → glide-data-editor-g_L8FLAC.js} +60 -60
- package/dist/{glide-utils-BVJ4fkxX.js → glide-utils-DJyqh0EM.js} +4 -4
- package/dist/{globals-BwK9YGrX.js → globals-CYGlmBXb.js} +3 -3
- package/dist/{highlighted-body-KPVGNVTW-Ad3MKZ18.js → highlighted-body-KPVGNVTW-zwjq21tf.js} +4 -4
- package/dist/{html-to-image-Cn1_16-x.js → html-to-image-B8s5SgGm.js} +37 -37
- package/dist/{infoDiagram-27XIBGKW-DVQFYvhg.js → infoDiagram-27XIBGKW-DipQoHxl.js} +2 -2
- package/dist/{ishikawaDiagram-5VMMS53U-viPND-nm.js → ishikawaDiagram-5VMMS53U-DgFMjSGz.js} +3 -3
- package/dist/{journeyDiagram-3NMN7TZE-BeeJdJo3.js → journeyDiagram-3NMN7TZE-BaLqn-dZ.js} +2 -2
- package/dist/{jsx-runtime-DgDPJV9S.js → jsx-runtime-3BD1kT0s.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-Dcl_ECO9.js → kanban-definition-UXKFOSKX-w1ACVjgl.js} +9 -9
- package/dist/{katex-BNCmKUol.js → katex-BIdZGsyO.js} +141 -116
- package/dist/{label-DQO1jFjf.js → label-BDKF3Afc.js} +10 -10
- package/dist/{loader-Cm-ATtou.js → loader-BQOfjTIJ.js} +1 -1
- package/dist/main.js +623 -590
- package/dist/{mermaid-BfhcnSj-.js → mermaid-CHo49Yv-.js} +56 -56
- package/dist/mermaid-HWGCJPDP-ByCsZnYF.js +2 -0
- package/dist/{mhchem-BEc7A1or.js → mhchem-CdWPJK6g.js} +1 -1
- package/dist/{mindmap-definition-YA3MSWOX-BdxxhF-5.js → mindmap-definition-YA3MSWOX-CrT0KSfX.js} +11 -11
- package/dist/{number-overlay-editor-tMylyldi.js → number-overlay-editor-9VRv-pdj.js} +5 -5
- package/dist/{pegDiagram-XKGWAZYB-Du5p2s0w.js → pegDiagram-XKGWAZYB-BqvywNJA.js} +3 -3
- package/dist/{pieDiagram-E7YTZNPT-DJg-SOIq.js → pieDiagram-E7YTZNPT-BfxJ_XCc.js} +3 -3
- package/dist/{process-output-CUG57KRp.js → process-output-CKRXyszb.js} +5 -5
- package/dist/{quadrantDiagram-AXDQQJYC-keLfFx9f.js → quadrantDiagram-AXDQQJYC-Ccw0xMjN.js} +1 -1
- package/dist/{railroadDiagram-O6MQD6OU-C0ojm-6_.js → railroadDiagram-O6MQD6OU-8vFLVTPu.js} +3 -3
- package/dist/{react-dom-BUgJ-ab_.js → react-dom-DUmH0GXv.js} +29 -21
- package/dist/{react-ofJbxM4x.js → react-sHtZdjeP.js} +103 -94
- package/dist/{react-vega-ewj7q_U5.js → react-vega-BED0DjiB.js} +3 -3
- package/dist/{requirementDiagram-BXWQKSXE-CNwNBmI3.js → requirementDiagram-BXWQKSXE-a_MxGvxe.js} +11 -11
- package/dist/{reveal-component-LXUMcqWX.js → reveal-component-C87mv9Mn.js} +906 -878
- package/dist/{sankeyDiagram-P5KCCOFB-Bh4EsJox.js → sankeyDiagram-P5KCCOFB-ELvOcnZH.js} +1 -1
- package/dist/{select-Bs-nmvm6.js → select-BButFi-d.js} +11 -11
- package/dist/{sequenceDiagram-WJ2MYXX4-DQaW5qBG.js → sequenceDiagram-WJ2MYXX4-CXFMnxGh.js} +4 -4
- package/dist/{spec-DVsoMvYT.js → spec-BwarBpUJ.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-BDa515QC.js → stateDiagram-D77RDMKH-DQeA_CwI.js} +13 -13
- package/dist/stateDiagram-v2-MP3YSRHH-BxxQucm1.js +30 -0
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-M4IdGi8J.js → swimlanes-42K2YHIH-Do6L-cYg.js} +10 -10
- package/dist/swimlanesDiagram-VR7AAH4N-DUzPvSVU.js +30 -0
- package/dist/{swiper-component-CpN-hewZ.js → swiper-component-DKntyn8p.js} +5 -5
- package/dist/{timeline-definition-24CTP7MA-DH-kvakg.js → timeline-definition-24CTP7MA-D3c46WM5.js} +3 -3
- package/dist/{toDate-vEi5kTfY.js → toDate-vIXljnsr.js} +43 -42
- package/dist/{toast-DfEpJedt.js → toast-B9UMEi8u.js} +9 -9
- package/dist/{tooltip-CuNWg2ay.js → tooltip-BO1REbqs.js} +7 -7
- package/dist/{use-restore-focus-kmgwrL8q.js → use-restore-focus-BEM7sFWl.js} +2042 -1827
- package/dist/{use-vega-container-remeasure-4DwJbPWu.js → use-vega-container-remeasure-Bz4PZMtt.js} +2 -2
- package/dist/{useAsyncData-rkAlR_vh.js → useAsyncData-Deh5kszT.js} +3 -3
- package/dist/{useDateFormatter-C-tz65rD.js → useDateFormatter-D8XruNGG.js} +4 -4
- package/dist/{useDeepCompareMemoize-BlHFBj5_.js → useDeepCompareMemoize-DXwzRINI.js} +2 -2
- package/dist/{useIframeCapabilities-C1Bt04Iz.js → useIframeCapabilities-DBETvvPl.js} +2 -2
- package/dist/{useLifecycle-B68iY077.js → useLifecycle-j7D9uD1o.js} +6 -6
- package/dist/{useTheme-BwSgeAFb.js → useTheme-CRnjkku0.js} +7 -7
- package/dist/{vega-component-C-bPttRN.js → vega-component-DTG6zxaY.js} +14 -14
- package/dist/{vega-embed-container-sSR5hAsy.js → vega-embed-container-BNHE18G9.js} +5 -5
- package/dist/{vennDiagram-4TSXK5OY-d5g7XeiI.js → vennDiagram-4TSXK5OY-BSZD8JcZ.js} +3 -3
- package/dist/{wardleyDiagram-VM6X3IG4-BfX3bSzR.js → wardleyDiagram-VM6X3IG4-48cUWkfA.js} +3 -3
- package/dist/{xychartDiagram-S5SC5T6Z-C1QsLZg7.js → xychartDiagram-S5SC5T6Z-CswYgYeu.js} +5 -5
- package/package.json +25 -22
- package/src/__tests__/fixtures/{pair-preview.ts → pair-config.ts} +3 -2
- package/src/__tests__/host-imports.test.ts +100 -0
- package/src/__tests__/mount.test.ts +8 -8
- package/src/components/data-table/__tests__/column_formatting.test.ts +30 -0
- package/src/components/data-table/__tests__/columns.test.tsx +70 -0
- package/src/components/data-table/__tests__/context-menu.test.ts +176 -0
- package/src/components/data-table/__tests__/date-filter-inputs.test.tsx +24 -1
- package/src/components/data-table/__tests__/export-actions.test.tsx +329 -6
- package/src/components/data-table/column-formatting/feature.ts +20 -1
- package/src/components/data-table/columns.tsx +25 -18
- package/src/components/data-table/context-menu.tsx +125 -26
- package/src/components/data-table/date-filter-inputs.tsx +15 -42
- package/src/components/data-table/export-actions.tsx +192 -116
- package/src/components/data-table/schemas.ts +14 -36
- package/src/components/data-table/utils.ts +18 -0
- package/src/components/editor/Output.tsx +9 -2
- package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +80 -252
- package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +186 -34
- package/src/components/editor/actions/pair-with-agent-commands.ts +42 -51
- package/src/components/editor/actions/pair-with-agent-modal.tsx +96 -36
- package/src/components/editor/chrome/panels/error-panel.tsx +1 -0
- package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +372 -0
- package/src/components/editor/chrome/wrapper/footer-item.tsx +32 -24
- package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +237 -0
- package/src/components/editor/chrome/wrapper/footer.tsx +2 -0
- package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +4 -3
- package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +548 -0
- package/src/components/editor/errors/send-error-report-button.tsx +69 -0
- package/src/components/editor/output/MarimoErrorOutput.tsx +21 -5
- package/src/components/editor/output/MarimoTracebackOutput.tsx +35 -20
- package/src/components/editor/output/__tests__/ansi-reduce.test.ts +18 -0
- package/src/components/editor/output/ansi-reduce.ts +6 -0
- package/src/components/editor/output/console/ConsoleOutput.tsx +5 -3
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +18 -0
- package/src/components/storage/__tests__/storage-file-viewer.test.tsx +2 -1
- package/src/core/attachments/__tests__/toast.test.tsx +58 -0
- package/src/core/attachments/state.ts +21 -0
- package/src/core/attachments/toast.ts +15 -0
- package/src/core/cells/__tests__/cells.test.ts +52 -0
- package/src/core/cells/__tests__/document-roundtrip.test.ts +16 -0
- package/src/core/cells/__tests__/error-report.test.ts +139 -0
- package/src/core/cells/__tests__/session.test.ts +50 -1
- package/src/core/cells/error-report.ts +63 -0
- package/src/core/cells/session.ts +28 -1
- package/src/core/codemirror/copilot/__tests__/completion-integration.test.ts +447 -0
- package/src/core/codemirror/copilot/__tests__/inline-completion.test.ts +395 -0
- package/src/core/codemirror/copilot/__tests__/language-server.test.ts +511 -2
- package/src/core/codemirror/copilot/__tests__/rpc-cancellation.test.ts +201 -0
- package/src/core/codemirror/copilot/extension.ts +22 -11
- package/src/core/codemirror/copilot/language-server.ts +109 -60
- package/src/core/codemirror/language/__tests__/sql.test.ts +4 -3
- package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +138 -26
- package/src/core/codemirror/language/embedded/embedded-python.ts +47 -13
- package/src/core/codemirror/language/embedded/latex.ts +20 -13
- package/src/core/config/pair.ts +5 -3
- package/src/core/datasets/__tests__/data-source-discovery.test.ts +18 -11
- package/src/core/host/AGENTS.md +6 -0
- package/src/core/host/__tests__/protocol.test.ts +214 -0
- package/src/core/host/protocol.ts +1943 -0
- package/src/core/islands/__tests__/bootstrap.test.ts +26 -0
- package/src/core/islands/bootstrap.ts +1 -0
- package/src/core/islands/bridge.ts +2 -2
- package/src/core/kernel/messages.ts +4 -7
- package/src/core/network/__tests__/api.test.ts +114 -1
- package/src/core/network/api.ts +3 -2
- package/src/core/wasm/bridge.ts +2 -2
- package/src/core/wasm/worker/types.ts +2 -2
- package/src/core/websocket/__tests__/useMarimoKernelConnection.hook.test.tsx +193 -0
- package/src/core/websocket/useMarimoKernelConnection.tsx +9 -0
- package/src/css/katex-css.test.ts +1 -1
- package/src/css/katex.min.css +6 -1
- package/src/hooks/__tests__/useEventListener.test.tsx +45 -1
- package/src/hooks/useEventListener.ts +6 -1
- package/src/mount.tsx +3 -3
- package/src/plugins/impl/NumberPlugin.tsx +20 -3
- package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +84 -0
- package/src/plugins/impl/__tests__/NumberPlugin.test.tsx +159 -1
- package/src/utils/__tests__/dates.test.ts +116 -0
- package/src/utils/dates.ts +94 -0
- package/dist/assets/__vite-browser-external-BqAtzd2P.js +0 -1
- package/dist/assets/worker-Bf8dt6S-.js +0 -109
- package/dist/classDiagram-ZZMXUADV-Bbo2n384.js +0 -30
- package/dist/classDiagram-v2-VYDZK3BY-xR8cGP0r.js +0 -30
- package/dist/error-entries-BovkFYNy.js +0 -56
- package/dist/flowDiagram-HODETNUW-D7IBKS12.js +0 -16
- package/dist/mermaid-HWGCJPDP-DYCzSILp.js +0 -2
- package/dist/stateDiagram-v2-MP3YSRHH-ChNddepZ.js +0 -30
- package/dist/swimlanesDiagram-VR7AAH4N-FUSwmzEp.js +0 -30
|
@@ -5,10 +5,12 @@ import type {
|
|
|
5
5
|
JSONRPCRequest,
|
|
6
6
|
Transport,
|
|
7
7
|
} from "@marimo-team/codemirror-languageserver";
|
|
8
|
-
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
8
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
9
|
+
import type { InlineCompletionParams } from "vscode-languageserver-protocol";
|
|
9
10
|
import { store } from "@/core/state/jotai";
|
|
11
|
+
import * as notebookCodes from "../getCodes";
|
|
10
12
|
import { CopilotLanguageServerClient } from "../language-server";
|
|
11
|
-
import { copilotStatusState } from "../state";
|
|
13
|
+
import { copilotStatusState, githubCopilotLoadingVersion } from "../state";
|
|
12
14
|
|
|
13
15
|
const copilotState = vi.hoisted(() => ({ isEnabled: true }));
|
|
14
16
|
|
|
@@ -382,6 +384,7 @@ describe("CopilotLanguageServerClient", () => {
|
|
|
382
384
|
contentChanges: [{ text: "value = 2" }],
|
|
383
385
|
});
|
|
384
386
|
|
|
387
|
+
await client.flushDocumentChanges();
|
|
385
388
|
expect(notifications(mockTransport, "textDocument/didChange")).toEqual([
|
|
386
389
|
{
|
|
387
390
|
jsonrpc: "2.0",
|
|
@@ -503,3 +506,509 @@ describe("CopilotLanguageServerClient", () => {
|
|
|
503
506
|
});
|
|
504
507
|
});
|
|
505
508
|
});
|
|
509
|
+
|
|
510
|
+
describe("Copilot completion requests", () => {
|
|
511
|
+
let transport: MockTransport;
|
|
512
|
+
let client: CopilotLanguageServerClient;
|
|
513
|
+
const params: InlineCompletionParams = {
|
|
514
|
+
textDocument: { uri: "file:///test.py" },
|
|
515
|
+
position: { line: 0, character: 1 },
|
|
516
|
+
context: { triggerKind: 2 },
|
|
517
|
+
};
|
|
518
|
+
const suggestion = [{ insertText: "result" }];
|
|
519
|
+
|
|
520
|
+
function requests() {
|
|
521
|
+
return transport.sent.filter(
|
|
522
|
+
(message): message is JSONRPCRequest =>
|
|
523
|
+
isRequest(message) &&
|
|
524
|
+
message.method === "textDocument/inlineCompletion",
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
async function change(text: string) {
|
|
529
|
+
await client.textDocumentDidChange({
|
|
530
|
+
textDocument: { uri: params.textDocument.uri, version: 1 },
|
|
531
|
+
contentChanges: [{ text }],
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
async function tick() {
|
|
536
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
beforeEach(async () => {
|
|
540
|
+
vi.useFakeTimers();
|
|
541
|
+
copilotState.isEnabled = true;
|
|
542
|
+
store.set(githubCopilotLoadingVersion, null);
|
|
543
|
+
transport = new MockTransport();
|
|
544
|
+
client = new CopilotLanguageServerClient({
|
|
545
|
+
rootUri: "file:///test",
|
|
546
|
+
workspaceFolders: null,
|
|
547
|
+
transport,
|
|
548
|
+
});
|
|
549
|
+
await client.initializePromise;
|
|
550
|
+
await client.textDocumentDidOpen({
|
|
551
|
+
textDocument: {
|
|
552
|
+
uri: params.textDocument.uri,
|
|
553
|
+
languageId: "python",
|
|
554
|
+
version: 1,
|
|
555
|
+
text: "x",
|
|
556
|
+
},
|
|
557
|
+
});
|
|
558
|
+
transport.sent.length = 0;
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
afterEach(() => {
|
|
562
|
+
client.close();
|
|
563
|
+
const shutdown = transport.sent.find(
|
|
564
|
+
(message) => isRequest(message) && message.method === "shutdown",
|
|
565
|
+
);
|
|
566
|
+
if (shutdown && isRequest(shutdown)) {
|
|
567
|
+
transport.emit({ jsonrpc: "2.0", id: shutdown.id, result: null });
|
|
568
|
+
}
|
|
569
|
+
vi.useRealTimers();
|
|
570
|
+
vi.restoreAllMocks();
|
|
571
|
+
});
|
|
572
|
+
|
|
573
|
+
it("coalesces edits and sends the latest document before the completion", async () => {
|
|
574
|
+
for (const text of ["p", "pr", "pri", "prin", "print"]) {
|
|
575
|
+
await change(text);
|
|
576
|
+
}
|
|
577
|
+
expect(notifications(transport, "textDocument/didChange")).toEqual([]);
|
|
578
|
+
const response = client.getCompletion(params);
|
|
579
|
+
await tick();
|
|
580
|
+
expect(transport.sent).toEqual([
|
|
581
|
+
{
|
|
582
|
+
jsonrpc: "2.0",
|
|
583
|
+
method: "textDocument/didChange",
|
|
584
|
+
params: {
|
|
585
|
+
textDocument: { uri: params.textDocument.uri, version: 6 },
|
|
586
|
+
contentChanges: [{ text: "print" }],
|
|
587
|
+
},
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
jsonrpc: "2.0",
|
|
591
|
+
id: expect.any(Number),
|
|
592
|
+
method: "textDocument/inlineCompletion",
|
|
593
|
+
params: {
|
|
594
|
+
...params,
|
|
595
|
+
textDocument: { uri: params.textDocument.uri, version: 6 },
|
|
596
|
+
},
|
|
597
|
+
},
|
|
598
|
+
]);
|
|
599
|
+
transport.emit({
|
|
600
|
+
jsonrpc: "2.0",
|
|
601
|
+
id: requests()[0].id,
|
|
602
|
+
result: suggestion,
|
|
603
|
+
});
|
|
604
|
+
await expect(response).resolves.toEqual(suggestion);
|
|
605
|
+
expect(store.get(githubCopilotLoadingVersion)).toBeNull();
|
|
606
|
+
expect(await client.flushDocumentChanges()).toBe("print");
|
|
607
|
+
expect(notifications(transport, "textDocument/didChange")).toHaveLength(1);
|
|
608
|
+
});
|
|
609
|
+
|
|
610
|
+
it.each(["x", ""])(
|
|
611
|
+
"does not upload an unchanged focused cell %j again",
|
|
612
|
+
async (text) => {
|
|
613
|
+
const assemble = vi.spyOn(notebookCodes, "getCodes");
|
|
614
|
+
await change(text);
|
|
615
|
+
expect(await client.flushDocumentChanges(text)).toBe(text);
|
|
616
|
+
expect(await client.flushDocumentChanges(text)).toBe(text);
|
|
617
|
+
expect(await client.flushDocumentChanges(text)).toBe(text);
|
|
618
|
+
expect(assemble).toHaveBeenCalledTimes(3);
|
|
619
|
+
expect(notifications(transport, "textDocument/didChange")).toEqual([
|
|
620
|
+
{
|
|
621
|
+
jsonrpc: "2.0",
|
|
622
|
+
method: "textDocument/didChange",
|
|
623
|
+
params: {
|
|
624
|
+
textDocument: { uri: params.textDocument.uri, version: 2 },
|
|
625
|
+
contentChanges: [{ text }],
|
|
626
|
+
},
|
|
627
|
+
},
|
|
628
|
+
]);
|
|
629
|
+
|
|
630
|
+
await change("next");
|
|
631
|
+
await client.flushDocumentChanges("next");
|
|
632
|
+
expect(
|
|
633
|
+
notifications(transport, "textDocument/didChange")[1].params,
|
|
634
|
+
).toEqual({
|
|
635
|
+
textDocument: { uri: params.textDocument.uri, version: 3 },
|
|
636
|
+
contentChanges: [{ text: "next" }],
|
|
637
|
+
});
|
|
638
|
+
},
|
|
639
|
+
);
|
|
640
|
+
|
|
641
|
+
it("does not upload a document that already matches didOpen", async () => {
|
|
642
|
+
expect(await client.flushDocumentChanges("x")).toBe("x");
|
|
643
|
+
expect(notifications(transport, "textDocument/didChange")).toEqual([]);
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
it("compares the assembled notebook and uploads changes in another cell", async () => {
|
|
647
|
+
let otherCell = "import math";
|
|
648
|
+
const assemble = vi
|
|
649
|
+
.spyOn(notebookCodes, "getCodes")
|
|
650
|
+
.mockImplementation((code) => `${otherCell}\n${code}`);
|
|
651
|
+
await change("x");
|
|
652
|
+
expect(await client.flushDocumentChanges("x")).toBe("import math\nx");
|
|
653
|
+
expect(await client.flushDocumentChanges("x")).toBe("import math\nx");
|
|
654
|
+
otherCell = "import random";
|
|
655
|
+
expect(await client.flushDocumentChanges("x")).toBe("import random\nx");
|
|
656
|
+
expect(await client.flushDocumentChanges("x")).toBe("import random\nx");
|
|
657
|
+
expect(assemble).toHaveBeenCalledTimes(4);
|
|
658
|
+
expect(notifications(transport, "textDocument/didChange")).toEqual([
|
|
659
|
+
{
|
|
660
|
+
jsonrpc: "2.0",
|
|
661
|
+
method: "textDocument/didChange",
|
|
662
|
+
params: {
|
|
663
|
+
textDocument: { uri: params.textDocument.uri, version: 2 },
|
|
664
|
+
contentChanges: [{ text: "import math\nx" }],
|
|
665
|
+
},
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
jsonrpc: "2.0",
|
|
669
|
+
method: "textDocument/didChange",
|
|
670
|
+
params: {
|
|
671
|
+
textDocument: { uri: params.textDocument.uri, version: 3 },
|
|
672
|
+
contentChanges: [{ text: "import random\nx" }],
|
|
673
|
+
},
|
|
674
|
+
},
|
|
675
|
+
]);
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
it("assembles once with the focused cell last when another cell has a pending edit", async () => {
|
|
679
|
+
const assemble = vi
|
|
680
|
+
.spyOn(notebookCodes, "getCodes")
|
|
681
|
+
.mockImplementation((code) => `other\n${code}`);
|
|
682
|
+
await change("other");
|
|
683
|
+
expect(await client.flushDocumentChanges("x")).toBe("other\nx");
|
|
684
|
+
expect(assemble).toHaveBeenCalledExactlyOnceWith("x");
|
|
685
|
+
expect(notifications(transport, "textDocument/didChange")).toEqual([
|
|
686
|
+
{
|
|
687
|
+
jsonrpc: "2.0",
|
|
688
|
+
method: "textDocument/didChange",
|
|
689
|
+
params: {
|
|
690
|
+
textDocument: { uri: params.textDocument.uri, version: 3 },
|
|
691
|
+
contentChanges: [{ text: "other\nx" }],
|
|
692
|
+
},
|
|
693
|
+
},
|
|
694
|
+
]);
|
|
695
|
+
});
|
|
696
|
+
|
|
697
|
+
it("retries a failed upload even when its text matches the last attempted document", async () => {
|
|
698
|
+
const assemble = vi.spyOn(notebookCodes, "getCodes");
|
|
699
|
+
transport.send.mockImplementationOnce(() => {
|
|
700
|
+
throw new Error("socket closed");
|
|
701
|
+
});
|
|
702
|
+
await expect(client.flushDocumentChanges("latest")).rejects.toThrow(
|
|
703
|
+
"socket closed",
|
|
704
|
+
);
|
|
705
|
+
expect(await client.flushDocumentChanges("latest")).toBe("latest");
|
|
706
|
+
expect(await client.flushDocumentChanges("latest")).toBe("latest");
|
|
707
|
+
expect(assemble).toHaveBeenCalledTimes(3);
|
|
708
|
+
expect(notifications(transport, "textDocument/didChange")).toEqual([
|
|
709
|
+
{
|
|
710
|
+
jsonrpc: "2.0",
|
|
711
|
+
method: "textDocument/didChange",
|
|
712
|
+
params: {
|
|
713
|
+
textDocument: { uri: params.textDocument.uri, version: 2 },
|
|
714
|
+
contentChanges: [{ text: "latest" }],
|
|
715
|
+
},
|
|
716
|
+
},
|
|
717
|
+
]);
|
|
718
|
+
});
|
|
719
|
+
|
|
720
|
+
it("cancels a rapid request instead of giving the next caller its promise", async () => {
|
|
721
|
+
const first = client.getCompletion(params);
|
|
722
|
+
await tick();
|
|
723
|
+
const second = client.getCompletion({
|
|
724
|
+
...params,
|
|
725
|
+
position: { line: 0, character: 0 },
|
|
726
|
+
});
|
|
727
|
+
await tick();
|
|
728
|
+
expect(requests()).toHaveLength(2);
|
|
729
|
+
expect(notifications(transport, "$/cancelRequest")).toEqual([
|
|
730
|
+
{
|
|
731
|
+
jsonrpc: "2.0",
|
|
732
|
+
method: "$/cancelRequest",
|
|
733
|
+
params: { id: requests()[0].id },
|
|
734
|
+
},
|
|
735
|
+
]);
|
|
736
|
+
await expect(first).resolves.toBeNull();
|
|
737
|
+
// Both requests use the same version; old cleanup must not hide the new spinner.
|
|
738
|
+
expect(store.get(githubCopilotLoadingVersion)).toBe(1);
|
|
739
|
+
transport.emit({
|
|
740
|
+
jsonrpc: "2.0",
|
|
741
|
+
id: requests()[1].id,
|
|
742
|
+
result: suggestion,
|
|
743
|
+
});
|
|
744
|
+
await expect(second).resolves.toEqual(suggestion);
|
|
745
|
+
transport.emit({
|
|
746
|
+
jsonrpc: "2.0",
|
|
747
|
+
id: requests()[0].id,
|
|
748
|
+
result: [{ insertText: "stale" }],
|
|
749
|
+
});
|
|
750
|
+
expect(store.get(githubCopilotLoadingVersion)).toBeNull();
|
|
751
|
+
});
|
|
752
|
+
|
|
753
|
+
it("suppresses a request superseded before it reaches the wire", async () => {
|
|
754
|
+
const first = client.getCompletion(params);
|
|
755
|
+
const second = client.getCompletion(params);
|
|
756
|
+
await tick();
|
|
757
|
+
expect(requests()).toHaveLength(1);
|
|
758
|
+
await expect(first).resolves.toBeNull();
|
|
759
|
+
transport.emit({
|
|
760
|
+
jsonrpc: "2.0",
|
|
761
|
+
id: requests()[0].id,
|
|
762
|
+
result: suggestion,
|
|
763
|
+
});
|
|
764
|
+
await expect(second).resolves.toEqual(suggestion);
|
|
765
|
+
});
|
|
766
|
+
|
|
767
|
+
it("aborts on an edit before any replacement completion is requested", async () => {
|
|
768
|
+
const response = client.getCompletion(params);
|
|
769
|
+
await tick();
|
|
770
|
+
await change("changed");
|
|
771
|
+
await expect(response).resolves.toBeNull();
|
|
772
|
+
expect(notifications(transport, "$/cancelRequest")).toHaveLength(1);
|
|
773
|
+
expect(notifications(transport, "textDocument/didChange")).toEqual([]);
|
|
774
|
+
expect(store.get(githubCopilotLoadingVersion)).toBeNull();
|
|
775
|
+
});
|
|
776
|
+
|
|
777
|
+
it.each([false, true])(
|
|
778
|
+
"handles external cancellation (already sent: %s)",
|
|
779
|
+
async (sent) => {
|
|
780
|
+
const controller = new AbortController();
|
|
781
|
+
if (!sent) {
|
|
782
|
+
controller.abort();
|
|
783
|
+
}
|
|
784
|
+
const response = client.getCompletion(params, controller.signal);
|
|
785
|
+
if (sent) {
|
|
786
|
+
await tick();
|
|
787
|
+
controller.abort();
|
|
788
|
+
}
|
|
789
|
+
await expect(response).resolves.toBeNull();
|
|
790
|
+
expect(requests()).toHaveLength(sent ? 1 : 0);
|
|
791
|
+
expect(notifications(transport, "$/cancelRequest")).toHaveLength(
|
|
792
|
+
sent ? 1 : 0,
|
|
793
|
+
);
|
|
794
|
+
expect(store.get(githubCopilotLoadingVersion)).toBeNull();
|
|
795
|
+
},
|
|
796
|
+
);
|
|
797
|
+
|
|
798
|
+
it.each([null, [], { items: [] }])(
|
|
799
|
+
"handles empty response %j",
|
|
800
|
+
async (result) => {
|
|
801
|
+
const response = client.getCompletion(params);
|
|
802
|
+
await tick();
|
|
803
|
+
transport.emit({ jsonrpc: "2.0", id: requests()[0].id, result });
|
|
804
|
+
await expect(response).resolves.toEqual(result);
|
|
805
|
+
expect(store.get(githubCopilotLoadingVersion)).toBeNull();
|
|
806
|
+
},
|
|
807
|
+
);
|
|
808
|
+
|
|
809
|
+
it("fails quietly on a server error and allows a subsequent request", async () => {
|
|
810
|
+
const response = client.getCompletion(params);
|
|
811
|
+
await tick();
|
|
812
|
+
transport.emit({
|
|
813
|
+
jsonrpc: "2.0",
|
|
814
|
+
id: requests()[0].id,
|
|
815
|
+
error: { code: -32603, message: "unavailable" },
|
|
816
|
+
});
|
|
817
|
+
await expect(response).resolves.toBeNull();
|
|
818
|
+
const retry = client.getCompletion(params);
|
|
819
|
+
await tick();
|
|
820
|
+
transport.emit({
|
|
821
|
+
jsonrpc: "2.0",
|
|
822
|
+
id: requests()[1].id,
|
|
823
|
+
result: suggestion,
|
|
824
|
+
});
|
|
825
|
+
await expect(retry).resolves.toEqual(suggestion);
|
|
826
|
+
});
|
|
827
|
+
|
|
828
|
+
it("cancels a timed-out request and clears its loading state", async () => {
|
|
829
|
+
const response = client.getCompletion(params);
|
|
830
|
+
await vi.advanceTimersByTimeAsync(10_000);
|
|
831
|
+
await expect(response).resolves.toBeNull();
|
|
832
|
+
expect(notifications(transport, "$/cancelRequest")).toHaveLength(1);
|
|
833
|
+
expect(store.get(githubCopilotLoadingVersion)).toBeNull();
|
|
834
|
+
});
|
|
835
|
+
|
|
836
|
+
it("does not send requests while disabled or display a response after disabling", async () => {
|
|
837
|
+
copilotState.isEnabled = false;
|
|
838
|
+
await expect(client.getCompletion(params)).resolves.toBeNull();
|
|
839
|
+
expect(requests()).toEqual([]);
|
|
840
|
+
copilotState.isEnabled = true;
|
|
841
|
+
const response = client.getCompletion(params);
|
|
842
|
+
await tick();
|
|
843
|
+
copilotState.isEnabled = false;
|
|
844
|
+
transport.emit({
|
|
845
|
+
jsonrpc: "2.0",
|
|
846
|
+
id: requests()[0].id,
|
|
847
|
+
result: suggestion,
|
|
848
|
+
});
|
|
849
|
+
await expect(response).resolves.toBeNull();
|
|
850
|
+
});
|
|
851
|
+
|
|
852
|
+
it("preserves pending edits after a failed document upload and retries them", async () => {
|
|
853
|
+
await change("latest");
|
|
854
|
+
transport.send.mockImplementationOnce(() => {
|
|
855
|
+
throw new Error("socket closed");
|
|
856
|
+
});
|
|
857
|
+
await expect(client.getCompletion(params)).resolves.toBeNull();
|
|
858
|
+
expect(requests()).toEqual([]);
|
|
859
|
+
const response = client.getCompletion(params);
|
|
860
|
+
await tick();
|
|
861
|
+
expect(notifications(transport, "textDocument/didChange")).toEqual([
|
|
862
|
+
{
|
|
863
|
+
jsonrpc: "2.0",
|
|
864
|
+
method: "textDocument/didChange",
|
|
865
|
+
params: {
|
|
866
|
+
textDocument: { uri: params.textDocument.uri, version: 2 },
|
|
867
|
+
contentChanges: [{ text: "latest" }],
|
|
868
|
+
},
|
|
869
|
+
},
|
|
870
|
+
]);
|
|
871
|
+
transport.emit({
|
|
872
|
+
jsonrpc: "2.0",
|
|
873
|
+
id: requests()[0].id,
|
|
874
|
+
result: suggestion,
|
|
875
|
+
});
|
|
876
|
+
await expect(response).resolves.toEqual(suggestion);
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
it.each(["success", "failure"])(
|
|
880
|
+
"cancels a request during a stalled reconnect before handshake %s",
|
|
881
|
+
async (outcome) => {
|
|
882
|
+
transport.send.mockImplementationOnce((message) => {
|
|
883
|
+
transport.sent.push(message);
|
|
884
|
+
});
|
|
885
|
+
const reconnect = client.reInitialize().then(
|
|
886
|
+
() => "ready",
|
|
887
|
+
(error: unknown) => error,
|
|
888
|
+
);
|
|
889
|
+
const initialize = transport.sent.find(
|
|
890
|
+
(message) => isRequest(message) && message.method === "initialize",
|
|
891
|
+
);
|
|
892
|
+
if (!initialize || !isRequest(initialize)) {
|
|
893
|
+
throw new Error("Expected initialize request");
|
|
894
|
+
}
|
|
895
|
+
const controller = new AbortController();
|
|
896
|
+
const remove = vi.spyOn(controller.signal, "removeEventListener");
|
|
897
|
+
const settled = vi.fn();
|
|
898
|
+
const response = client
|
|
899
|
+
.getCompletion(params, controller.signal)
|
|
900
|
+
.then(settled);
|
|
901
|
+
await tick();
|
|
902
|
+
expect(settled).not.toHaveBeenCalled();
|
|
903
|
+
expect(requests()).toEqual([]);
|
|
904
|
+
expect(store.get(githubCopilotLoadingVersion)).toBe(1);
|
|
905
|
+
controller.abort();
|
|
906
|
+
await tick();
|
|
907
|
+
// Assert before answering initialize so the handshake cannot hide a stuck abort.
|
|
908
|
+
expect(settled).toHaveBeenCalledExactlyOnceWith(null);
|
|
909
|
+
expect(remove).toHaveBeenCalledExactlyOnceWith(
|
|
910
|
+
"abort",
|
|
911
|
+
expect.any(Function),
|
|
912
|
+
);
|
|
913
|
+
expect(store.get(githubCopilotLoadingVersion)).toBeNull();
|
|
914
|
+
expect(notifications(transport, "$/cancelRequest")).toEqual([]);
|
|
915
|
+
transport.emit(
|
|
916
|
+
outcome === "success"
|
|
917
|
+
? {
|
|
918
|
+
jsonrpc: "2.0",
|
|
919
|
+
id: initialize.id,
|
|
920
|
+
result: { capabilities: {} },
|
|
921
|
+
}
|
|
922
|
+
: {
|
|
923
|
+
jsonrpc: "2.0",
|
|
924
|
+
id: initialize.id,
|
|
925
|
+
error: { code: -32603, message: "handshake failed" },
|
|
926
|
+
},
|
|
927
|
+
);
|
|
928
|
+
const handshakeError = expect.objectContaining({
|
|
929
|
+
message: "handshake failed",
|
|
930
|
+
});
|
|
931
|
+
await expect(reconnect).resolves.toEqual(
|
|
932
|
+
outcome === "success" ? "ready" : handshakeError,
|
|
933
|
+
);
|
|
934
|
+
expect(requests()).toEqual([]);
|
|
935
|
+
let retryResult: unknown;
|
|
936
|
+
if (outcome === "success") {
|
|
937
|
+
const retry = client.getCompletion(params);
|
|
938
|
+
await tick();
|
|
939
|
+
transport.emit({
|
|
940
|
+
jsonrpc: "2.0",
|
|
941
|
+
id: requests()[0].id,
|
|
942
|
+
result: suggestion,
|
|
943
|
+
});
|
|
944
|
+
retryResult = await retry;
|
|
945
|
+
}
|
|
946
|
+
expect(requests()).toHaveLength(outcome === "success" ? 1 : 0);
|
|
947
|
+
expect(retryResult).toEqual(
|
|
948
|
+
outcome === "success" ? suggestion : undefined,
|
|
949
|
+
);
|
|
950
|
+
await response;
|
|
951
|
+
expect(settled).toHaveBeenCalledTimes(1);
|
|
952
|
+
},
|
|
953
|
+
);
|
|
954
|
+
|
|
955
|
+
it("replays the most recent unsent edit on reconnect", async () => {
|
|
956
|
+
await change("first");
|
|
957
|
+
await change("latest");
|
|
958
|
+
await client.reInitialize();
|
|
959
|
+
expect(notifications(transport, "textDocument/didOpen")).toEqual([
|
|
960
|
+
{
|
|
961
|
+
jsonrpc: "2.0",
|
|
962
|
+
method: "textDocument/didOpen",
|
|
963
|
+
params: {
|
|
964
|
+
textDocument: {
|
|
965
|
+
uri: params.textDocument.uri,
|
|
966
|
+
languageId: "python",
|
|
967
|
+
version: 3,
|
|
968
|
+
text: "latest",
|
|
969
|
+
},
|
|
970
|
+
},
|
|
971
|
+
},
|
|
972
|
+
]);
|
|
973
|
+
expect(notifications(transport, "textDocument/didChange")).toEqual([]);
|
|
974
|
+
});
|
|
975
|
+
|
|
976
|
+
it("cancels requests and drops pending changes when the final editor closes", async () => {
|
|
977
|
+
const response = client.getCompletion(params);
|
|
978
|
+
await tick();
|
|
979
|
+
await client.textDocumentDidClose({ textDocument: params.textDocument });
|
|
980
|
+
await expect(response).resolves.toBeNull();
|
|
981
|
+
await change("unsent");
|
|
982
|
+
await client.textDocumentDidClose({ textDocument: params.textDocument });
|
|
983
|
+
await client.flushDocumentChanges();
|
|
984
|
+
expect(notifications(transport, "textDocument/didChange")).toEqual([]);
|
|
985
|
+
});
|
|
986
|
+
it("does not request completions for a closed document", async () => {
|
|
987
|
+
await client.textDocumentDidClose({ textDocument: params.textDocument });
|
|
988
|
+
await expect(client.getCompletion(params)).resolves.toBeNull();
|
|
989
|
+
expect(requests()).toEqual([]);
|
|
990
|
+
expect(store.get(githubCopilotLoadingVersion)).toBeNull();
|
|
991
|
+
});
|
|
992
|
+
|
|
993
|
+
it("keeps a newer edit when an earlier upload fails", async () => {
|
|
994
|
+
await change("old");
|
|
995
|
+
transport.send.mockImplementationOnce(() => {
|
|
996
|
+
void change("new");
|
|
997
|
+
throw new Error("send failed");
|
|
998
|
+
});
|
|
999
|
+
await expect(client.flushDocumentChanges("old")).rejects.toThrow(
|
|
1000
|
+
"send failed",
|
|
1001
|
+
);
|
|
1002
|
+
expect(await client.flushDocumentChanges("new")).toBe("new");
|
|
1003
|
+
expect(notifications(transport, "textDocument/didChange")).toEqual([
|
|
1004
|
+
{
|
|
1005
|
+
jsonrpc: "2.0",
|
|
1006
|
+
method: "textDocument/didChange",
|
|
1007
|
+
params: {
|
|
1008
|
+
textDocument: { uri: params.textDocument.uri, version: 3 },
|
|
1009
|
+
contentChanges: [{ text: "new" }],
|
|
1010
|
+
},
|
|
1011
|
+
},
|
|
1012
|
+
]);
|
|
1013
|
+
});
|
|
1014
|
+
});
|