Skip to content

Commit

Permalink
fix: direct execution of fileReferences command (#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaegassy committed Jun 8, 2022
1 parent f23d1f3 commit 4af606b
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -6,14 +6,21 @@ import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();

export async function register(context: vscode.ExtensionContext, client: BaseLanguageClient) {
vscode.commands.registerCommand('vue.findAllFileReferences', async (uri: vscode.Uri) => {
vscode.commands.registerCommand('vue.findAllFileReferences', async (uri?: vscode.Uri) => {

// https://github.com/microsoft/vscode/blob/main/extensions/typescript-language-features/src/languageFeatures/fileReferences.ts
await vscode.window.withProgress({
location: vscode.ProgressLocation.Window,
title: localize('progress.title', "Finding file references")
}, async (_progress, token) => {

if (!uri) {
const editor = vscode.window.activeTextEditor;
if (!editor) return;

uri = editor.document.uri;
}

const response = await client.sendRequest(shared.FindFileReferenceRequest.type, { textDocument: { uri: uri.toString() } });
if (!response) {
return;
Expand Down

0 comments on commit 4af606b

Please sign in to comment.