Skip to content

Commit 45bb16e

Browse files
committed
fixes virtual merged document not updating on changes
1 parent 93e3d4d commit 45bb16e

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

client/src/commands.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export function virtualMergedDocument(e: Extension): Command {
3636
}
3737

3838
const docProvider = new class implements vscode.TextDocumentContentProvider {
39-
onDidChangeEmitter = new vscode.EventEmitter<vscode.Uri>();
40-
onDidChange = this.onDidChangeEmitter.event;
39+
onDidChangeEmitter = new vscode.EventEmitter<vscode.Uri>()
40+
onDidChange = this.onDidChangeEmitter.event
4141

4242
provideTextDocumentContent(uri: vscode.Uri, __: vscode.CancellationToken): vscode.ProviderResult<string> {
4343
return getVirtualDocument(uri.path)
@@ -50,6 +50,7 @@ export function virtualMergedDocument(e: Extension): Command {
5050
const uri = vscode.window.activeTextEditor.document.uri
5151
const path = vscode.Uri.parse('mcglsl:' + uri.path)
5252
const doc = await vscode.workspace.openTextDocument(path)
53+
docProvider.onDidChangeEmitter.fire(path)
5354
await vscode.window.showTextDocument(doc, {preview: true})
5455
}
5556
}

client/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class Extension {
5353

5454
registerCommand = (name: string, f: (e: Extension) => commands.Command) => {
5555
const cmd = f(this)
56-
this.context.subscriptions.push(vscode.commands.registerCommand('mcshader.'+name, cmd))
56+
this.context.subscriptions.push(vscode.commands.registerCommand('mcglsl.'+name, cmd))
5757
}
5858

5959
deactivate = async () => {

client/src/lspClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export class LanguageClient extends lsp.LanguageClient {
1111
constructor(ext: Extension) {
1212
super('vscode-mc-shader', 'VSCode MC Shader', {
1313
command: process.env['MCSHADER_DEBUG'] ?
14-
ext.context.asAbsolutePath(path.join('server', 'target', 'debug', 'vscode-mc-shader')) :
15-
path.join(ext.context.globalStoragePath, 'mcshader-lsp')
14+
ext.context.asAbsolutePath(path.join('server', 'target', 'debug', 'mcshader-lsp')) :
15+
path.join(ext.context.globalStoragePath, 'mcshader-lsp')
1616
}, {
1717
documentSelector: [{scheme: 'file', language: 'glsl'}],
1818
outputChannel: lspOutputChannel,

0 commit comments

Comments
 (0)