mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
auto-fixed prefer-const violation
This commit is contained in:
@@ -132,7 +132,7 @@ suite('vscode API - workspace', () => {
|
||||
assert.ok(doc.isDirty);
|
||||
|
||||
let closed: vscode.TextDocument;
|
||||
let d0 = vscode.workspace.onDidCloseTextDocument(e => closed = e);
|
||||
const d0 = vscode.workspace.onDidCloseTextDocument(e => closed = e);
|
||||
|
||||
return vscode.window.showTextDocument(doc).then(() => {
|
||||
return doc.save().then((didSave: boolean) => {
|
||||
@@ -153,7 +153,7 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
test('openTextDocument, uri scheme/auth/path', function () {
|
||||
|
||||
let registration = vscode.workspace.registerTextDocumentContentProvider('sc', {
|
||||
const registration = vscode.workspace.registerTextDocumentContentProvider('sc', {
|
||||
provideTextDocumentContent() {
|
||||
return 'SC';
|
||||
}
|
||||
@@ -182,28 +182,28 @@ suite('vscode API - workspace', () => {
|
||||
const fs = new TestFS('this-fs', false);
|
||||
const reg = vscode.workspace.registerFileSystemProvider(fs.scheme, fs, { isCaseSensitive: fs.isCaseSensitive });
|
||||
|
||||
let uriOne = vscode.Uri.parse('this-fs:/one');
|
||||
let uriTwo = vscode.Uri.parse('this-fs:/two');
|
||||
let uriONE = vscode.Uri.parse('this-fs:/ONE'); // same resource, different uri
|
||||
let uriTWO = vscode.Uri.parse('this-fs:/TWO');
|
||||
const uriOne = vscode.Uri.parse('this-fs:/one');
|
||||
const uriTwo = vscode.Uri.parse('this-fs:/two');
|
||||
const uriONE = vscode.Uri.parse('this-fs:/ONE'); // same resource, different uri
|
||||
const uriTWO = vscode.Uri.parse('this-fs:/TWO');
|
||||
|
||||
fs.writeFile(uriOne, Buffer.from('one'), { create: true, overwrite: true });
|
||||
fs.writeFile(uriTwo, Buffer.from('two'), { create: true, overwrite: true });
|
||||
|
||||
// lower case (actual case) comes first
|
||||
let docOne = await vscode.workspace.openTextDocument(uriOne);
|
||||
const docOne = await vscode.workspace.openTextDocument(uriOne);
|
||||
assert.strictEqual(docOne.uri.toString(), uriOne.toString());
|
||||
|
||||
let docONE = await vscode.workspace.openTextDocument(uriONE);
|
||||
const docONE = await vscode.workspace.openTextDocument(uriONE);
|
||||
assert.strictEqual(docONE === docOne, true);
|
||||
assert.strictEqual(docONE.uri.toString(), uriOne.toString());
|
||||
assert.strictEqual(docONE.uri.toString() !== uriONE.toString(), true); // yep
|
||||
|
||||
// upper case (NOT the actual case) comes first
|
||||
let docTWO = await vscode.workspace.openTextDocument(uriTWO);
|
||||
const docTWO = await vscode.workspace.openTextDocument(uriTWO);
|
||||
assert.strictEqual(docTWO.uri.toString(), uriTWO.toString());
|
||||
|
||||
let docTwo = await vscode.workspace.openTextDocument(uriTwo);
|
||||
const docTwo = await vscode.workspace.openTextDocument(uriTwo);
|
||||
assert.strictEqual(docTWO === docTwo, true);
|
||||
assert.strictEqual(docTwo.uri.toString(), uriTWO.toString());
|
||||
assert.strictEqual(docTwo.uri.toString() !== uriTwo.toString(), true); // yep
|
||||
@@ -264,7 +264,7 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
test('eol, change via onWillSave', async function () {
|
||||
let called = false;
|
||||
let sub = vscode.workspace.onWillSaveTextDocument(e => {
|
||||
const sub = vscode.workspace.onWillSaveTextDocument(e => {
|
||||
called = true;
|
||||
e.waitUntil(Promise.resolve([vscode.TextEdit.setEndOfLine(vscode.EndOfLine.LF)]));
|
||||
});
|
||||
@@ -292,11 +292,11 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
test('events: onDidOpenTextDocument, onDidChangeTextDocument, onDidSaveTextDocument', async () => {
|
||||
const file = await createRandomFile();
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
|
||||
await revertAllDirty(); // needed for a clean state for `onDidSaveTextDocument` (#102365)
|
||||
|
||||
let pendingAsserts: Function[] = [];
|
||||
const pendingAsserts: Function[] = [];
|
||||
let onDidOpenTextDocument = false;
|
||||
disposables.push(vscode.workspace.onDidOpenTextDocument(e => {
|
||||
pendingAsserts.push(() => assertEqualPath(e.uri.fsPath, file.fsPath));
|
||||
@@ -333,8 +333,8 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
test('events: onDidSaveTextDocument fires even for non dirty file when saved', async () => {
|
||||
const file = await createRandomFile();
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
let pendingAsserts: Function[] = [];
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
const pendingAsserts: Function[] = [];
|
||||
|
||||
await revertAllDirty(); // needed for a clean state for `onDidSaveTextDocument` (#102365)
|
||||
|
||||
@@ -369,7 +369,7 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
test('registerTextDocumentContentProvider, simple', function () {
|
||||
|
||||
let registration = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
const registration = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
provideTextDocumentContent(uri) {
|
||||
return uri.toString();
|
||||
}
|
||||
@@ -406,7 +406,7 @@ suite('vscode API - workspace', () => {
|
||||
test('registerTextDocumentContentProvider, multiple', function () {
|
||||
|
||||
// duplicate registration
|
||||
let registration1 = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
const registration1 = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
provideTextDocumentContent(uri) {
|
||||
if (uri.authority === 'foo') {
|
||||
return '1';
|
||||
@@ -414,7 +414,7 @@ suite('vscode API - workspace', () => {
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
let registration2 = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
const registration2 = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
provideTextDocumentContent(uri) {
|
||||
if (uri.authority === 'bar') {
|
||||
return '2';
|
||||
@@ -435,12 +435,12 @@ suite('vscode API - workspace', () => {
|
||||
test('registerTextDocumentContentProvider, evil provider', function () {
|
||||
|
||||
// duplicate registration
|
||||
let registration1 = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
const registration1 = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
provideTextDocumentContent(_uri) {
|
||||
return '1';
|
||||
}
|
||||
});
|
||||
let registration2 = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
const registration2 = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
provideTextDocumentContent(_uri): string {
|
||||
throw new Error('fail');
|
||||
}
|
||||
@@ -455,7 +455,7 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
test('registerTextDocumentContentProvider, invalid text', function () {
|
||||
|
||||
let registration = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
const registration = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
provideTextDocumentContent(_uri) {
|
||||
return <any>123;
|
||||
}
|
||||
@@ -470,7 +470,7 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
test('registerTextDocumentContentProvider, show virtual document', function () {
|
||||
|
||||
let registration = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
const registration = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
provideTextDocumentContent(_uri) {
|
||||
return 'I am virtual';
|
||||
}
|
||||
@@ -489,7 +489,7 @@ suite('vscode API - workspace', () => {
|
||||
test('registerTextDocumentContentProvider, open/open document', function () {
|
||||
|
||||
let callCount = 0;
|
||||
let registration = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
const registration = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
provideTextDocumentContent(_uri) {
|
||||
callCount += 1;
|
||||
return 'I am virtual';
|
||||
@@ -499,7 +499,7 @@ suite('vscode API - workspace', () => {
|
||||
const uri = vscode.Uri.parse('foo://testing/path');
|
||||
|
||||
return Promise.all([vscode.workspace.openTextDocument(uri), vscode.workspace.openTextDocument(uri)]).then(docs => {
|
||||
let [first, second] = docs;
|
||||
const [first, second] = docs;
|
||||
assert.ok(first === second);
|
||||
assert.ok(vscode.workspace.textDocuments.some(doc => doc.uri.toString() === uri.toString()));
|
||||
assert.strictEqual(callCount, 1);
|
||||
@@ -509,7 +509,7 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
test('registerTextDocumentContentProvider, empty doc', function () {
|
||||
|
||||
let registration = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
const registration = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
provideTextDocumentContent(_uri) {
|
||||
return '';
|
||||
}
|
||||
@@ -527,9 +527,9 @@ suite('vscode API - workspace', () => {
|
||||
test('registerTextDocumentContentProvider, change event', async function () {
|
||||
|
||||
let callCount = 0;
|
||||
let emitter = new vscode.EventEmitter<vscode.Uri>();
|
||||
const emitter = new vscode.EventEmitter<vscode.Uri>();
|
||||
|
||||
let registration = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
const registration = vscode.workspace.registerTextDocumentContentProvider('foo', {
|
||||
onDidChange: emitter.event,
|
||||
provideTextDocumentContent(_uri) {
|
||||
return 'call' + (callCount++);
|
||||
@@ -544,7 +544,7 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
return new Promise<void>(resolve => {
|
||||
|
||||
let subscription = vscode.workspace.onDidChangeTextDocument(event => {
|
||||
const subscription = vscode.workspace.onDidChangeTextDocument(event => {
|
||||
assert.ok(event.document === doc);
|
||||
assert.strictEqual(event.document.getText(), 'call1');
|
||||
subscription.dispose();
|
||||
@@ -635,10 +635,10 @@ suite('vscode API - workspace', () => {
|
||||
test('applyEdit', async () => {
|
||||
const doc = await vscode.workspace.openTextDocument(vscode.Uri.parse('untitled:' + join(vscode.workspace.rootPath || '', './new2.txt')));
|
||||
|
||||
let edit = new vscode.WorkspaceEdit();
|
||||
const edit = new vscode.WorkspaceEdit();
|
||||
edit.insert(doc.uri, new vscode.Position(0, 0), new Array(1000).join('Hello World'));
|
||||
|
||||
let success = await vscode.workspace.applyEdit(edit);
|
||||
const success = await vscode.workspace.applyEdit(edit);
|
||||
assert.strictEqual(success, true);
|
||||
assert.strictEqual(doc.isDirty, true);
|
||||
});
|
||||
@@ -650,7 +650,7 @@ suite('vscode API - workspace', () => {
|
||||
edit.deleteFile(resource);
|
||||
edit.insert(resource, new vscode.Position(0, 0), '');
|
||||
|
||||
let success = await vscode.workspace.applyEdit(edit);
|
||||
const success = await vscode.workspace.applyEdit(edit);
|
||||
assert.strictEqual(success, false);
|
||||
}));
|
||||
|
||||
@@ -661,7 +661,7 @@ suite('vscode API - workspace', () => {
|
||||
edit.deleteFile(resource);
|
||||
edit.renameFile(resource, resource);
|
||||
|
||||
let success = await vscode.workspace.applyEdit(edit);
|
||||
const success = await vscode.workspace.applyEdit(edit);
|
||||
assert.strictEqual(success, false);
|
||||
}));
|
||||
|
||||
@@ -672,7 +672,7 @@ suite('vscode API - workspace', () => {
|
||||
edit.renameFile(resource, newResource);
|
||||
edit.insert(resource, new vscode.Position(0, 0), '');
|
||||
|
||||
let success = await vscode.workspace.applyEdit(edit);
|
||||
const success = await vscode.workspace.applyEdit(edit);
|
||||
assert.strictEqual(success, false);
|
||||
}));
|
||||
|
||||
@@ -698,7 +698,7 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
assert.ok(await vscode.workspace.applyEdit(edit));
|
||||
|
||||
let doc = await vscode.workspace.openTextDocument(newUri);
|
||||
const doc = await vscode.workspace.openTextDocument(newUri);
|
||||
assert.strictEqual(doc.getText(), 'AFTERBEFORE');
|
||||
assert.strictEqual(doc.isDirty, true);
|
||||
}
|
||||
@@ -708,25 +708,25 @@ suite('vscode API - workspace', () => {
|
||||
}
|
||||
|
||||
test('WorkspaceEdit: applying edits before and after rename duplicates resource #42633', withLogDisabled(async function () {
|
||||
let docUri = await createRandomFile();
|
||||
let newUri = nameWithUnderscore(docUri);
|
||||
const docUri = await createRandomFile();
|
||||
const newUri = nameWithUnderscore(docUri);
|
||||
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
const we = new vscode.WorkspaceEdit();
|
||||
we.insert(docUri, new vscode.Position(0, 0), 'Hello');
|
||||
we.insert(docUri, new vscode.Position(0, 0), 'Foo');
|
||||
we.renameFile(docUri, newUri);
|
||||
we.insert(newUri, new vscode.Position(0, 0), 'Bar');
|
||||
|
||||
assert.ok(await vscode.workspace.applyEdit(we));
|
||||
let doc = await vscode.workspace.openTextDocument(newUri);
|
||||
const doc = await vscode.workspace.openTextDocument(newUri);
|
||||
assert.strictEqual(doc.getText(), 'BarHelloFoo');
|
||||
}));
|
||||
|
||||
test('WorkspaceEdit: Problem recreating a renamed resource #42634', withLogDisabled(async function () {
|
||||
let docUri = await createRandomFile();
|
||||
let newUri = nameWithUnderscore(docUri);
|
||||
const docUri = await createRandomFile();
|
||||
const newUri = nameWithUnderscore(docUri);
|
||||
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
const we = new vscode.WorkspaceEdit();
|
||||
we.insert(docUri, new vscode.Position(0, 0), 'Hello');
|
||||
we.insert(docUri, new vscode.Position(0, 0), 'Foo');
|
||||
we.renameFile(docUri, newUri);
|
||||
@@ -736,15 +736,15 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
assert.ok(await vscode.workspace.applyEdit(we));
|
||||
|
||||
let newDoc = await vscode.workspace.openTextDocument(newUri);
|
||||
const newDoc = await vscode.workspace.openTextDocument(newUri);
|
||||
assert.strictEqual(newDoc.getText(), 'HelloFoo');
|
||||
let doc = await vscode.workspace.openTextDocument(docUri);
|
||||
const doc = await vscode.workspace.openTextDocument(docUri);
|
||||
assert.strictEqual(doc.getText(), 'Bar');
|
||||
}));
|
||||
|
||||
test('WorkspaceEdit api - after saving a deleted file, it still shows up as deleted. #42667', withLogDisabled(async function () {
|
||||
let docUri = await createRandomFile();
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
const docUri = await createRandomFile();
|
||||
const we = new vscode.WorkspaceEdit();
|
||||
we.deleteFile(docUri);
|
||||
we.insert(docUri, new vscode.Position(0, 0), 'InsertText');
|
||||
|
||||
@@ -759,14 +759,14 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
test('WorkspaceEdit: edit and rename parent folder duplicates resource #42641', async function () {
|
||||
|
||||
let dir = vscode.Uri.parse(`${testFs.scheme}:/before-${rndName()}`);
|
||||
const dir = vscode.Uri.parse(`${testFs.scheme}:/before-${rndName()}`);
|
||||
await testFs.createDirectory(dir);
|
||||
|
||||
let docUri = await createRandomFile('', dir);
|
||||
let docParent = docUri.with({ path: posix.dirname(docUri.path) });
|
||||
let newParent = nameWithUnderscore(docParent);
|
||||
const docUri = await createRandomFile('', dir);
|
||||
const docParent = docUri.with({ path: posix.dirname(docUri.path) });
|
||||
const newParent = nameWithUnderscore(docParent);
|
||||
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
const we = new vscode.WorkspaceEdit();
|
||||
we.insert(docUri, new vscode.Position(0, 0), 'Hello');
|
||||
we.renameFile(docParent, newParent);
|
||||
|
||||
@@ -779,30 +779,30 @@ suite('vscode API - workspace', () => {
|
||||
assert.ok(true);
|
||||
}
|
||||
|
||||
let newUri = newParent.with({ path: posix.join(newParent.path, posix.basename(docUri.path)) });
|
||||
let doc = await vscode.workspace.openTextDocument(newUri);
|
||||
const newUri = newParent.with({ path: posix.join(newParent.path, posix.basename(docUri.path)) });
|
||||
const doc = await vscode.workspace.openTextDocument(newUri);
|
||||
assert.ok(doc);
|
||||
|
||||
assert.strictEqual(doc.getText(), 'Hello');
|
||||
});
|
||||
|
||||
test('WorkspaceEdit: rename resource followed by edit does not work #42638', withLogDisabled(async function () {
|
||||
let docUri = await createRandomFile();
|
||||
let newUri = nameWithUnderscore(docUri);
|
||||
const docUri = await createRandomFile();
|
||||
const newUri = nameWithUnderscore(docUri);
|
||||
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
const we = new vscode.WorkspaceEdit();
|
||||
we.renameFile(docUri, newUri);
|
||||
we.insert(newUri, new vscode.Position(0, 0), 'Hello');
|
||||
|
||||
assert.ok(await vscode.workspace.applyEdit(we));
|
||||
|
||||
let doc = await vscode.workspace.openTextDocument(newUri);
|
||||
const doc = await vscode.workspace.openTextDocument(newUri);
|
||||
assert.strictEqual(doc.getText(), 'Hello');
|
||||
}));
|
||||
|
||||
test('WorkspaceEdit: create & override', withLogDisabled(async function () {
|
||||
|
||||
let docUri = await createRandomFile('before');
|
||||
const docUri = await createRandomFile('before');
|
||||
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
we.createFile(docUri);
|
||||
@@ -816,7 +816,7 @@ suite('vscode API - workspace', () => {
|
||||
}));
|
||||
|
||||
test('WorkspaceEdit: create & ignoreIfExists', withLogDisabled(async function () {
|
||||
let docUri = await createRandomFile('before');
|
||||
const docUri = await createRandomFile('before');
|
||||
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
we.createFile(docUri, { ignoreIfExists: true });
|
||||
@@ -830,8 +830,8 @@ suite('vscode API - workspace', () => {
|
||||
}));
|
||||
|
||||
test('WorkspaceEdit: rename & ignoreIfExists', withLogDisabled(async function () {
|
||||
let aUri = await createRandomFile('aaa');
|
||||
let bUri = await createRandomFile('bbb');
|
||||
const aUri = await createRandomFile('aaa');
|
||||
const bUri = await createRandomFile('bbb');
|
||||
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
we.renameFile(aUri, bUri);
|
||||
@@ -852,7 +852,7 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
test('WorkspaceEdit: delete & ignoreIfNotExists', withLogDisabled(async function () {
|
||||
|
||||
let docUri = await createRandomFile();
|
||||
const docUri = await createRandomFile();
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
we.deleteFile(docUri, { ignoreIfNotExists: false });
|
||||
assert.ok(await vscode.workspace.applyEdit(we));
|
||||
@@ -868,14 +868,14 @@ suite('vscode API - workspace', () => {
|
||||
|
||||
test('WorkspaceEdit: insert & rename multiple', async function () {
|
||||
|
||||
let [f1, f2, f3] = await Promise.all([createRandomFile(), createRandomFile(), createRandomFile()]);
|
||||
const [f1, f2, f3] = await Promise.all([createRandomFile(), createRandomFile(), createRandomFile()]);
|
||||
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
const we = new vscode.WorkspaceEdit();
|
||||
we.insert(f1, new vscode.Position(0, 0), 'f1');
|
||||
we.insert(f2, new vscode.Position(0, 0), 'f2');
|
||||
we.insert(f3, new vscode.Position(0, 0), 'f3');
|
||||
|
||||
let f1_ = nameWithUnderscore(f1);
|
||||
const f1_ = nameWithUnderscore(f1);
|
||||
we.renameFile(f1, f1_);
|
||||
|
||||
assert.ok(await vscode.workspace.applyEdit(we));
|
||||
@@ -911,7 +911,7 @@ suite('vscode API - workspace', () => {
|
||||
}
|
||||
|
||||
for (let i = 0; i < 4; i++) {
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
const we = new vscode.WorkspaceEdit();
|
||||
let oldUri: vscode.Uri;
|
||||
let newUri: vscode.Uri;
|
||||
let expected: string;
|
||||
@@ -946,7 +946,7 @@ suite('vscode API - workspace', () => {
|
||||
test('The api workspace.applyEdit failed for some case of mixing resourceChange and textEdit #80688', async function () {
|
||||
const file1 = await createRandomFile();
|
||||
const file2 = await createRandomFile();
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
const we = new vscode.WorkspaceEdit();
|
||||
we.insert(file1, new vscode.Position(0, 0), 'import1;');
|
||||
|
||||
const file2Name = basename(file2.fsPath);
|
||||
@@ -965,7 +965,7 @@ suite('vscode API - workspace', () => {
|
||||
test('The api workspace.applyEdit failed for some case of mixing resourceChange and textEdit #80688', async function () {
|
||||
const file1 = await createRandomFile();
|
||||
const file2 = await createRandomFile();
|
||||
let we = new vscode.WorkspaceEdit();
|
||||
const we = new vscode.WorkspaceEdit();
|
||||
we.insert(file1, new vscode.Position(0, 0), 'import1;');
|
||||
we.insert(file1, new vscode.Position(0, 0), 'import2;');
|
||||
|
||||
@@ -990,7 +990,7 @@ suite('vscode API - workspace', () => {
|
||||
const file2New = await createRandomFile();
|
||||
|
||||
const event = new Promise<vscode.FileWillRenameEvent>(resolve => {
|
||||
let sub = vscode.workspace.onWillRenameFiles(e => {
|
||||
const sub = vscode.workspace.onWillRenameFiles(e => {
|
||||
sub.dispose();
|
||||
resolve(e);
|
||||
});
|
||||
@@ -1035,7 +1035,7 @@ suite('vscode API - workspace', () => {
|
||||
test('Should send a single FileWillRenameEvent instead of separate events when moving multiple files at once#111867, 2/3', async function () {
|
||||
|
||||
const event = new Promise<vscode.FileWillCreateEvent>(resolve => {
|
||||
let sub = vscode.workspace.onWillCreateFiles(e => {
|
||||
const sub = vscode.workspace.onWillCreateFiles(e => {
|
||||
sub.dispose();
|
||||
resolve(e);
|
||||
});
|
||||
@@ -1062,7 +1062,7 @@ suite('vscode API - workspace', () => {
|
||||
const file2 = await createRandomFile();
|
||||
|
||||
const event = new Promise<vscode.FileWillDeleteEvent>(resolve => {
|
||||
let sub = vscode.workspace.onWillDeleteFiles(e => {
|
||||
const sub = vscode.workspace.onWillDeleteFiles(e => {
|
||||
sub.dispose();
|
||||
resolve(e);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user