mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Move matching brace to new Ctx
This commit is contained in:
parent
57df9bed70
commit
5dd9edaeaf
4 changed files with 35 additions and 32 deletions
|
@ -13,6 +13,13 @@ export class Ctx {
|
|||
return Server.client;
|
||||
}
|
||||
|
||||
get activeRustEditor(): vscode.TextEditor | undefined {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
return editor && editor.document.languageId === 'rust'
|
||||
? editor
|
||||
: undefined;
|
||||
}
|
||||
|
||||
registerCommand(name: string, factory: (ctx: Ctx) => Cmd) {
|
||||
const fullName = `rust-analyzer.${name}`;
|
||||
const cmd = factory(this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue