Skip to content

Commit

Permalink
Find All references doesn't exist for typescript plugin #14856
Browse files Browse the repository at this point in the history
Fixes: #14856

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
  • Loading branch information
vrubezhny authored and akosyakov committed Mar 3, 2020
1 parent 6d0abe5 commit 5ea335c
Show file tree
Hide file tree
Showing 18 changed files with 746 additions and 335 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
"vscode-builtin-xml": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/xml-1.39.1-prel.vsix",
"vscode-builtin-yaml": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/yaml-1.39.1-prel.vsix",
"vscode-editorconfig": "https://github.com/theia-ide/editorconfig-vscode/releases/download/v0.14.4/EditorConfig-0.14.4.vsix",
"vscode-eslint": "https://github.com/theia-ide/vscode-eslint/releases/download/release%2F2.0.15/vscode-eslint-2.0.15.vsix"
"vscode-eslint": "https://github.com/theia-ide/vscode-eslint/releases/download/release%2F2.0.15/vscode-eslint-2.0.15.vsix",
"vscode-references-view": "https://github.com/theia-ide/vscode-references-view/releases/download/v0.0.47/references-view-0.0.47.vsix"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ import { CommandService } from '@theia/core/lib/common/command';
import TheiaURI from '@theia/core/lib/common/uri';
import { EditorManager } from '@theia/editor/lib/browser';
import { CodeEditorWidget } from '@theia/plugin-ext/lib/main/browser/menus/menus-contribution-handler';
import { TextDocumentShowOptions } from '@theia/plugin-ext/lib/common/plugin-api-rpc-model';
import {
TextDocumentShowOptions,
Location,
CallHierarchyItem,
CallHierarchyIncomingCall,
CallHierarchyOutgoingCall
} from '@theia/plugin-ext/lib/common/plugin-api-rpc-model';
import { DocumentsMainImpl } from '@theia/plugin-ext/lib/main/browser/documents-main';
import { createUntitledURI } from '@theia/plugin-ext/lib/main/browser/editor/untitled-resource';
import { toDocumentSymbol } from '@theia/plugin-ext/lib/plugin/type-converters';
Expand All @@ -40,6 +46,7 @@ import { WorkspaceService, WorkspaceInput } from '@theia/workspace/lib/browser/w
import { DiffService } from '@theia/workspace/lib/browser/diff-service';
import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor';
import { inject, injectable } from 'inversify';
import { Position } from '@theia/plugin-ext/lib/common/plugin-api-rpc';
import URI from 'vscode-uri';

export namespace VscodeCommands {
Expand Down Expand Up @@ -374,8 +381,68 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
})
}
);

// TODO register other `vscode.execute...` commands.
// see https://github.com/microsoft/vscode/blob/master/src/vs/workbench/api/common/extHostApiCommands.ts
commands.registerCommand(
{
id: 'vscode.executeReferenceProvider'
},
{
execute: ((resource: URI, position: Position) => {
const args = {
resource: monaco.Uri.from(resource),
position: position
};
return commands.executeCommand<Location[]>('_executeReferenceProvider', args);
})
}
);
commands.registerCommand(
{
id: 'vscode.executeImplementationProvider'
},
{
execute: ((resource: URI, position: Position) => {
const args = {
resource: monaco.Uri.from(resource),
position: position
};
return commands.executeCommand<Location[]>('_executeImplementationProvider', args);
})
}
);
commands.registerCommand(
{
id: 'vscode.prepareCallHierarchy'
},
{
execute: ((resource: URI, position: Position) => {
const args = {
resource: monaco.Uri.from(resource),
position: position
};
return commands.executeCommand<CallHierarchyItem[]>('_executePrepareCallHierarchy', args);
})
}
);
commands.registerCommand(
{
id: 'vscode.provideIncomingCalls'
},
{
execute: ((item: CallHierarchyItem) =>
commands.executeCommand<CallHierarchyIncomingCall[]>('_executeProvideIncomingCalls', { item }))
}
);
commands.registerCommand(
{
id: 'vscode.provideOutgoingCalls'
},
{
execute: ((item: CallHierarchyItem) =>
commands.executeCommand<CallHierarchyOutgoingCall[]>('_executeProvideOutgoingCalls', { item }))
}
);
}

}
1 change: 0 additions & 1 deletion packages/plugin-ext/src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@
export * from './plugin-protocol';
export * from './plugin-api-rpc';
export * from './plugin-ext-api-contribution';
export * from './known-commands';
Loading

0 comments on commit 5ea335c

Please sign in to comment.