Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add "Volar: Reload Project" command
close #1605
- Loading branch information
1 parent
a819bd2
commit 0f08c0f
Showing
6 changed files
with
56 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
extensions/vscode-vue-language-features/src/features/reloadProject.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as vscode from 'vscode'; | ||
import * as shared from '@volar/shared'; | ||
import type { BaseLanguageClient } from 'vscode-languageclient'; | ||
|
||
export async function register(cmd: string, context: vscode.ExtensionContext, languageClients: BaseLanguageClient[]) { | ||
context.subscriptions.push(vscode.commands.registerCommand(cmd, () => { | ||
if (vscode.window.activeTextEditor) { | ||
for (const client of languageClients) { | ||
client.sendNotification(shared.ReloadProjectNotification.type, client.code2ProtocolConverter.asTextDocumentIdentifier(vscode.window.activeTextEditor.document)); | ||
} | ||
} | ||
})); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters