Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Remove old rls.findImpls command #564

Merged
merged 2 commits into from
Apr 11, 2019
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
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,6 @@ Some highlights:

## Features

### Commands

Commands can be found in the command palette <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>. We provide the
following commands:

* `Find Implementations` - Find locations of `impl` blocks for traits, structs, and enums.
Usefull to find all structs implementing a specific trait or all traits implemented for a struct.
Select a type when running the command.


### Snippets

Snippets are code templates which expand into common boilerplate. Intellisense
Expand Down
15 changes: 0 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@
}
],
"commands": [
{
"command": "rls.findImpls",
"title": "Find Implementations",
"description": "Show impl blocks for trait, struct, or enum",
"category": "Rust"
},
{
"command": "rls.update",
"title": "Update the RLS",
Expand All @@ -99,15 +93,6 @@
"category": "Rust"
}
],
"menus": {
"editor/context": [
{
"command": "rls.findImpls",
"when": "editorLangId == rust && editorHasReferenceProvider",
"group": "navigation@4"
}
]
},
"taskDefinitions": [
{
"type": "cargo",
Expand Down
42 changes: 0 additions & 42 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ import {
IndentAction,
languages,
TextDocument,
TextEditor,
TextEditorEdit,
Uri,
window,
workspace,
WorkspaceFolder,
WorkspaceFoldersChangeEvent,
} from 'vscode';
import {
ImplementationRequest,
LanguageClient,
LanguageClientOptions,
Location,
NotificationType,
ServerOptions,
} from 'vscode-languageclient';
Expand Down Expand Up @@ -298,44 +294,6 @@ class ClientWorkspace {
return;
}

const findImplsDisposable = commands.registerTextEditorCommand(
'rls.findImpls',
async (textEditor: TextEditor, _edit: TextEditorEdit) => {
if (!this.lc) {
return;
}
await this.lc.onReady();
// Prior to https://github.com/rust-lang-nursery/rls/pull/936 we used a custom
// LSP message - if the implementation provider is specified this means we can use the 3.6 one.
const useLSPRequest =
this.lc.initializeResult &&
this.lc.initializeResult.capabilities.implementationProvider === true;
const request = useLSPRequest
? ImplementationRequest.type.method
: 'rustDocument/implementations';

const params = this.lc.code2ProtocolConverter.asTextDocumentPositionParams(
textEditor.document,
textEditor.selection.active,
);
let locations: Location[];
try {
locations = await this.lc.sendRequest<Location[]>(request, params);
} catch (reason) {
window.showWarningMessage(`find implementations failed: ${reason}`);
return;
}

return commands.executeCommand(
'editor.action.showReferences',
textEditor.document.uri,
textEditor.selection.active,
locations.map(this.lc.protocol2CodeConverter.asLocation),
);
},
);
this.disposables.push(findImplsDisposable);

const rustupUpdateDisposable = commands.registerCommand(
'rls.update',
() => {
Expand Down