|
1 | 1 | import * as assert from 'assert' |
2 | 2 | import * as os from 'os' |
3 | | -import { Position, window, workspace, WorkspaceEdit, Uri } from 'vscode' |
| 3 | +import { Position, window, workspace, WorkspaceEdit } from 'vscode' |
4 | 4 | import { getFixturePath, getOptionsForFixture, wait } from '../testUtils' |
5 | 5 |
|
6 | 6 | import * as utils from 'vscode-test-utils' |
@@ -291,7 +291,7 @@ suite('EditorConfig extension', function () { |
291 | 291 | }).saveText('foobar') |
292 | 292 | assert(window.activeTextEditor, 'no active editor') |
293 | 293 |
|
294 | | - // Before saving, the selection is on line 0. This should remain unchanged. |
| 294 | + // Before saving, the selection is on line 0. This should remain unchanged. |
295 | 295 | assert.strictEqual( |
296 | 296 | window.activeTextEditor.selection.start.line, |
297 | 297 | 0, |
@@ -336,18 +336,13 @@ function withSetting( |
336 | 336 | }, |
337 | 337 | } |
338 | 338 | async function createDoc(contents = '', name = 'test') { |
339 | | - const fixturePath = getFixturePath([rule, value, name]) |
340 | | - |
341 | | - try { |
342 | | - await workspace.fs.delete(Uri.file(fixturePath)) |
343 | | - } catch { |
344 | | - // ignore |
345 | | - } |
346 | | - |
347 | | - const uri = await utils.createFile(contents, fixturePath) |
| 339 | + const uri = await utils.createFile( |
| 340 | + contents, |
| 341 | + getFixturePath([rule, value, name]), |
| 342 | + ) |
348 | 343 | const doc = await workspace.openTextDocument(uri) |
349 | 344 | await window.showTextDocument(doc) |
350 | | - await wait(50) // wait for EditorConfig to apply new settings |
| 345 | + await wait(100) // wait for EditorConfig to apply new settings |
351 | 346 | return doc |
352 | 347 | } |
353 | 348 | } |
0 commit comments