Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Case: Multiple updates #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions __tests__/Documents.Test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ describe("documents", () => {
let update = {
removedDocuments: [],
addedDocuments: [testModelAdded],
removedEditors: [],
addedEditors: [],
newActiveEditor: null,
// removedEditors: [],
// addedEditors: [],
// newActiveEditor: null,
};

api.sendNotification(["ExtHostDocumentsAndEditors", "$acceptDocumentsAndEditorsDelta", [update]]);
Expand Down Expand Up @@ -78,6 +78,13 @@ describe("documents", () => {
return info.type === "workspace.onDidChangeTextDocument" && info.fullText == "Greetings\nworld";
})

let onChangePromise2 = api.waitForMessageOnce("MainThreadMessageService", "$showMessage", (v) => {
let [_, data] = v;
let info = JSON.parse(data);

return info.type === "workspace.onDidChangeTextDocument" && info.fullText == "Greetings2ings\nworld";
})

await api.start();
await extensionActivationPromise;

Expand Down Expand Up @@ -117,8 +124,25 @@ describe("documents", () => {
};

api.sendNotification(["ExtHostDocuments", "$acceptModelChanged", [testModelAdded.uri, changedEvent, true]]);

await onChangePromise;

let changedEvent2 = {
changes: [{
range: {
startLineNumber: 1,
endLineNumber: 1,
startColumn: 1,
endColumn: 6,
},
text: "Greetings2",
}],
eol: "\n",
versionId: 101,
};

api.sendNotification(["ExtHostDocuments", "$acceptModelChanged", [testModelAdded.uri, changedEvent2, true]]);

await onChangePromise2;
});
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"postinstall": "node build/npm/postinstall.js",
"compile": "gulp compile --max_old_space_size=4095",
"minify": "gulp --tasks --max_old_space_size=4095",
"watch": "gulp vscode-darwin-min --max_old_space_size=4095",
"watch": "gulp watch --max_old_space_size=4095",
"watch-client": "gulp watch-client --max_old_space_size=4095",
"monaco-editor-test": "mocha --only-monaco-editor",
"gulp": "gulp --max_old_space_size=4095",
Expand Down