mirror of
https://github.com/Strum355/mcshader-lsp.git
synced 2025-08-30 05:24:10 +00:00
fixes virtual merged document not updating on changes
This commit is contained in:
parent
93e3d4ded2
commit
45bb16e429
3 changed files with 6 additions and 5 deletions
|
@ -36,8 +36,8 @@ export function virtualMergedDocument(e: Extension): Command {
|
|||
}
|
||||
|
||||
const docProvider = new class implements vscode.TextDocumentContentProvider {
|
||||
onDidChangeEmitter = new vscode.EventEmitter<vscode.Uri>();
|
||||
onDidChange = this.onDidChangeEmitter.event;
|
||||
onDidChangeEmitter = new vscode.EventEmitter<vscode.Uri>()
|
||||
onDidChange = this.onDidChangeEmitter.event
|
||||
|
||||
provideTextDocumentContent(uri: vscode.Uri, __: vscode.CancellationToken): vscode.ProviderResult<string> {
|
||||
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})
|
||||
}
|
||||
}
|
|
@ -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 () => {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue