mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
align command naming
This commit is contained in:
parent
7abe1f422c
commit
d1a67c1174
18 changed files with 94 additions and 77 deletions
|
@ -1,7 +1,7 @@
|
|||
import * as vscode from 'vscode';
|
||||
import { Server } from '../server';
|
||||
|
||||
const statusUri = vscode.Uri.parse('ra-lsp-status://status');
|
||||
const statusUri = vscode.Uri.parse('rust-analyzer-status://status');
|
||||
|
||||
export class TextDocumentContentProvider
|
||||
implements vscode.TextDocumentContentProvider {
|
||||
|
@ -15,7 +15,10 @@ export class TextDocumentContentProvider
|
|||
if (editor == null) {
|
||||
return '';
|
||||
}
|
||||
return Server.client.sendRequest<string>('ra/analyzerStatus', null);
|
||||
return Server.client.sendRequest<string>(
|
||||
'rust-analyzer/analyzerStatus',
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
get onDidChange(): vscode.Event<vscode.Uri> {
|
||||
|
@ -31,7 +34,7 @@ export function makeCommand(context: vscode.ExtensionContext) {
|
|||
const textDocumentContentProvider = new TextDocumentContentProvider();
|
||||
context.subscriptions.push(
|
||||
vscode.workspace.registerTextDocumentContentProvider(
|
||||
'ra-lsp-status',
|
||||
'rust-analyzer-status',
|
||||
textDocumentContentProvider
|
||||
)
|
||||
);
|
||||
|
|
|
@ -24,7 +24,7 @@ export async function handle() {
|
|||
textDocument: { uri: editor.document.uri.toString() }
|
||||
};
|
||||
const response = await Server.client.sendRequest<ExtendSelectionResult>(
|
||||
'm/extendSelection',
|
||||
'rust-analyzer/extendSelection',
|
||||
request
|
||||
);
|
||||
editor.selections = response.selections.map((range: Range) => {
|
||||
|
|
|
@ -22,7 +22,7 @@ export async function handle() {
|
|||
textDocument: { uri: editor.document.uri.toString() }
|
||||
};
|
||||
const change = await Server.client.sendRequest<SourceChange>(
|
||||
'm/joinLines',
|
||||
'rust-analyzer/joinLines',
|
||||
request
|
||||
);
|
||||
await applySourceChange(change);
|
||||
|
|
|
@ -20,7 +20,7 @@ export async function handle() {
|
|||
})
|
||||
};
|
||||
const response = await Server.client.sendRequest<Position[]>(
|
||||
'm/findMatchingBrace',
|
||||
'rust-analyzer/findMatchingBrace',
|
||||
request
|
||||
);
|
||||
editor.selections = editor.selections.map((sel, idx) => {
|
||||
|
|
|
@ -22,7 +22,7 @@ export async function handle(event: { text: string }): Promise<boolean> {
|
|||
)
|
||||
};
|
||||
const change = await Server.client.sendRequest<undefined | SourceChange>(
|
||||
'm/onEnter',
|
||||
'rust-analyzer/onEnter',
|
||||
request
|
||||
);
|
||||
if (!change) {
|
||||
|
|
|
@ -15,7 +15,7 @@ export async function handle() {
|
|||
)
|
||||
};
|
||||
const response = await Server.client.sendRequest<lc.Location[]>(
|
||||
'm/parentModule',
|
||||
'rust-analyzer/parentModule',
|
||||
request
|
||||
);
|
||||
const loc = response[0];
|
||||
|
|
|
@ -83,7 +83,7 @@ export async function handle() {
|
|||
)
|
||||
};
|
||||
const runnables = await Server.client.sendRequest<Runnable[]>(
|
||||
'm/runnables',
|
||||
'rust-analyzer/runnables',
|
||||
params
|
||||
);
|
||||
const items: RunnableQuickPick[] = [];
|
||||
|
|
|
@ -3,7 +3,7 @@ import { TextDocumentIdentifier } from 'vscode-languageclient';
|
|||
|
||||
import { Server } from '../server';
|
||||
|
||||
export const syntaxTreeUri = vscode.Uri.parse('ra-lsp://syntaxtree');
|
||||
export const syntaxTreeUri = vscode.Uri.parse('rust-analyzer://syntaxtree');
|
||||
|
||||
export class TextDocumentContentProvider
|
||||
implements vscode.TextDocumentContentProvider {
|
||||
|
@ -21,7 +21,7 @@ export class TextDocumentContentProvider
|
|||
textDocument: { uri: editor.document.uri.toString() }
|
||||
};
|
||||
return Server.client.sendRequest<SyntaxTreeResult>(
|
||||
'm/syntaxTree',
|
||||
'rust-analyzer/syntaxTree',
|
||||
request
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue