Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find All references doesn't exist for typescript plugin #14856 #7055

Merged
merged 1 commit into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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