Sha256: d71a34863bf8728db86ef5b2020052dfc28d1f8b41cf1daf00b44b9892bf4ce5
Contents?: true
Size: 1.04 KB
Versions: 11
Compression:
Stored size: 1.04 KB
Contents
import * as vscode from 'vscode'; import * as path from 'path'; export let doc: vscode.TextDocument; export let editor: vscode.TextEditor; export let documentEol: string; export let platformEol: string; export async function activate(docUri: vscode.Uri) { const ext = vscode.extensions.getExtension('tomoasleep.yoda'); await ext.activate(); try { doc = await vscode.workspace.openTextDocument(docUri); editor = await vscode.window.showTextDocument(doc); await sleep(20000); // Wait for server activation } catch (e) { console.error(e); } } async function sleep(ms: number) { return new Promise(resolve => setTimeout(resolve, ms)); } export const getDocPath = (p: string) => { return path.resolve(__dirname, '../../testFixture', p); }; export const getDocUri = (p: string) => { return vscode.Uri.file(getDocPath(p)); }; export async function setTestContent(content: string): Promise<boolean> { const all = new vscode.Range( doc.positionAt(0), doc.positionAt(doc.getText().length) ); return editor.edit(eb => eb.replace(all, content)); }
Version data entries
11 entries across 11 versions & 1 rubygems