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

Commit 69107f6

Browse files
authored
Merge pull request #564 from Xanewok/remove-custom-impls-command
Remove old `rls.findImpls` command
2 parents 45e02e3 + b6ab797 commit 69107f6

File tree

3 files changed

+0
-67
lines changed

3 files changed

+0
-67
lines changed

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,6 @@ Some highlights:
6565

6666
## Features
6767

68-
### Commands
69-
70-
Commands can be found in the command palette <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>. We provide the
71-
following commands:
72-
73-
* `Find Implementations` - Find locations of `impl` blocks for traits, structs, and enums.
74-
Usefull to find all structs implementing a specific trait or all traits implemented for a struct.
75-
Select a type when running the command.
76-
77-
7868
### Snippets
7969

8070
Snippets are code templates which expand into common boilerplate. Intellisense

package.json

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@
8080
}
8181
],
8282
"commands": [
83-
{
84-
"command": "rls.findImpls",
85-
"title": "Find Implementations",
86-
"description": "Show impl blocks for trait, struct, or enum",
87-
"category": "Rust"
88-
},
8983
{
9084
"command": "rls.update",
9185
"title": "Update the RLS",
@@ -99,15 +93,6 @@
9993
"category": "Rust"
10094
}
10195
],
102-
"menus": {
103-
"editor/context": [
104-
{
105-
"command": "rls.findImpls",
106-
"when": "editorLangId == rust && editorHasReferenceProvider",
107-
"group": "navigation@4"
108-
}
109-
]
110-
},
11196
"taskDefinitions": [
11297
{
11398
"type": "cargo",

src/extension.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,15 @@ import {
88
IndentAction,
99
languages,
1010
TextDocument,
11-
TextEditor,
12-
TextEditorEdit,
1311
Uri,
1412
window,
1513
workspace,
1614
WorkspaceFolder,
1715
WorkspaceFoldersChangeEvent,
1816
} from 'vscode';
1917
import {
20-
ImplementationRequest,
2118
LanguageClient,
2219
LanguageClientOptions,
23-
Location,
2420
NotificationType,
2521
ServerOptions,
2622
} from 'vscode-languageclient';
@@ -290,44 +286,6 @@ class ClientWorkspace {
290286
return;
291287
}
292288

293-
const findImplsDisposable = commands.registerTextEditorCommand(
294-
'rls.findImpls',
295-
async (textEditor: TextEditor, _edit: TextEditorEdit) => {
296-
if (!this.lc) {
297-
return;
298-
}
299-
await this.lc.onReady();
300-
// Prior to https://github.com/rust-lang-nursery/rls/pull/936 we used a custom
301-
// LSP message - if the implementation provider is specified this means we can use the 3.6 one.
302-
const useLSPRequest =
303-
this.lc.initializeResult &&
304-
this.lc.initializeResult.capabilities.implementationProvider === true;
305-
const request = useLSPRequest
306-
? ImplementationRequest.type.method
307-
: 'rustDocument/implementations';
308-
309-
const params = this.lc.code2ProtocolConverter.asTextDocumentPositionParams(
310-
textEditor.document,
311-
textEditor.selection.active,
312-
);
313-
let locations: Location[];
314-
try {
315-
locations = await this.lc.sendRequest<Location[]>(request, params);
316-
} catch (reason) {
317-
window.showWarningMessage(`find implementations failed: ${reason}`);
318-
return;
319-
}
320-
321-
return commands.executeCommand(
322-
'editor.action.showReferences',
323-
textEditor.document.uri,
324-
textEditor.selection.active,
325-
locations.map(this.lc.protocol2CodeConverter.asLocation),
326-
);
327-
},
328-
);
329-
this.disposables.push(findImplsDisposable);
330-
331289
const rustupUpdateDisposable = commands.registerCommand(
332290
'rls.update',
333291
() => {

0 commit comments

Comments
 (0)