Skip to content

Commit

Permalink
god i hate vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
SunsetTechuila committed Jan 30, 2025
1 parent 012a377 commit 3a0d693
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/test/suite/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as assert from 'assert'
import * as os from 'os'
import { Position, window, workspace, WorkspaceEdit } from 'vscode'
import { Position, window, workspace, WorkspaceEdit, Uri } from 'vscode'
import { getFixturePath, getOptionsForFixture, wait } from '../testUtils'

import * as utils from 'vscode-test-utils'
Expand Down Expand Up @@ -335,10 +335,15 @@ function withSetting(
},
}
async function createDoc(contents = '', name = 'test') {
const uri = await utils.createFile(
contents,
getFixturePath([rule, value, name]),
)
const fixturePath = getFixturePath([rule, value, name])

try {
await workspace.fs.delete(Uri.file(fixturePath))
} catch {
// ignore
}

const uri = await utils.createFile(contents, fixturePath)
const doc = await workspace.openTextDocument(uri)
await window.showTextDocument(doc)
await wait(50) // wait for EditorConfig to apply new settings
Expand Down

0 comments on commit 3a0d693

Please sign in to comment.