mirror of
https://github.com/James-Yu/LaTeX-Workshop.git
synced 2024-10-05 07:37:24 +03:00
7d0501b21a
- Remove a dependency on the jimp package. - Drop the support for VS Code prior to v1.62.0
46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
import * as assert from 'assert'
|
|
// import * as os from 'os'
|
|
import * as path from 'path'
|
|
|
|
import * as process from 'process'
|
|
import * as vscode from 'vscode'
|
|
|
|
import {
|
|
getFixtureDir,
|
|
// isDockerEnabled,
|
|
runTestWithFixture,
|
|
waitLatexWorkshopActivated
|
|
} from './utils'
|
|
|
|
|
|
suite('Completion test suite', () => {
|
|
|
|
suiteSetup(() => {
|
|
const config = vscode.workspace.getConfiguration()
|
|
if (process.env['LATEXWORKSHOP_CI_ENABLE_DOCKER']) {
|
|
return config.update('latex-workshop.docker.enabled', true, vscode.ConfigurationTarget.Global)
|
|
}
|
|
return
|
|
})
|
|
|
|
runTestWithFixture('fixture001', 'basic completion', async () => {
|
|
const fixtureDir = getFixtureDir()
|
|
const texFileName = 't.tex'
|
|
const texFilePath = vscode.Uri.file(path.join(fixtureDir, texFileName))
|
|
const doc = await vscode.workspace.openTextDocument(texFilePath)
|
|
await vscode.window.showTextDocument(doc)
|
|
const extension = await waitLatexWorkshopActivated()
|
|
const pos = new vscode.Position(3,1)
|
|
const token = new vscode.CancellationTokenSource().token
|
|
const items = await extension.exports.realExtension?.completer.provideCompletionItems?.(
|
|
doc, pos, token,
|
|
{
|
|
triggerKind: vscode.CompletionTriggerKind.Invoke,
|
|
triggerCharacter: undefined
|
|
}
|
|
)
|
|
assert.ok(items && items.length > 0)
|
|
})
|
|
|
|
})
|