diff --git a/client/src/commands.ts b/client/src/commands.ts index 1d952be..8b90f29 100644 --- a/client/src/commands.ts +++ b/client/src/commands.ts @@ -36,8 +36,8 @@ export function virtualMergedDocument(e: Extension): Command { } const docProvider = new class implements vscode.TextDocumentContentProvider { - onDidChangeEmitter = new vscode.EventEmitter(); - onDidChange = this.onDidChangeEmitter.event; + onDidChangeEmitter = new vscode.EventEmitter() + onDidChange = this.onDidChangeEmitter.event provideTextDocumentContent(uri: vscode.Uri, __: vscode.CancellationToken): vscode.ProviderResult { return getVirtualDocument(uri.path) @@ -50,6 +50,7 @@ export function virtualMergedDocument(e: Extension): Command { const uri = vscode.window.activeTextEditor.document.uri const path = vscode.Uri.parse('mcglsl:' + uri.path) const doc = await vscode.workspace.openTextDocument(path) + docProvider.onDidChangeEmitter.fire(path) await vscode.window.showTextDocument(doc, {preview: true}) } } \ No newline at end of file diff --git a/client/src/extension.ts b/client/src/extension.ts index 0c1e9a0..1028484 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -53,7 +53,7 @@ export class Extension { registerCommand = (name: string, f: (e: Extension) => commands.Command) => { const cmd = f(this) - this.context.subscriptions.push(vscode.commands.registerCommand('mcshader.'+name, cmd)) + this.context.subscriptions.push(vscode.commands.registerCommand('mcglsl.'+name, cmd)) } deactivate = async () => { diff --git a/client/src/lspClient.ts b/client/src/lspClient.ts index 6dead3a..456b322 100644 --- a/client/src/lspClient.ts +++ b/client/src/lspClient.ts @@ -11,8 +11,8 @@ export class LanguageClient extends lsp.LanguageClient { constructor(ext: Extension) { super('vscode-mc-shader', 'VSCode MC Shader', { command: process.env['MCSHADER_DEBUG'] ? - ext.context.asAbsolutePath(path.join('server', 'target', 'debug', 'vscode-mc-shader')) : - path.join(ext.context.globalStoragePath, 'mcshader-lsp') + ext.context.asAbsolutePath(path.join('server', 'target', 'debug', 'mcshader-lsp')) : + path.join(ext.context.globalStoragePath, 'mcshader-lsp') }, { documentSelector: [{scheme: 'file', language: 'glsl'}], outputChannel: lspOutputChannel,