mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Apply tslint suggestions, round one
This commit is contained in:
parent
69de7e2fd7
commit
4d62cfccbb
16 changed files with 257 additions and 241 deletions
|
@ -1,9 +1,9 @@
|
|||
import * as vscode from 'vscode';
|
||||
|
||||
import * as commands from './commands'
|
||||
import * as events from './events'
|
||||
import { Server } from './server';
|
||||
import * as commands from './commands';
|
||||
import { TextDocumentContentProvider } from './commands/syntaxTree';
|
||||
import * as events from './events';
|
||||
import { Server } from './server';
|
||||
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
function disposeOnDeactivation(disposable: vscode.Disposable) {
|
||||
|
@ -11,10 +11,10 @@ export function activate(context: vscode.ExtensionContext) {
|
|||
}
|
||||
|
||||
function registerCommand(name: string, f: any) {
|
||||
disposeOnDeactivation(vscode.commands.registerCommand(name, f))
|
||||
disposeOnDeactivation(vscode.commands.registerCommand(name, f));
|
||||
}
|
||||
|
||||
registerCommand('ra-lsp.syntaxTree', commands.syntaxTree.handle)
|
||||
registerCommand('ra-lsp.syntaxTree', commands.syntaxTree.handle);
|
||||
registerCommand('ra-lsp.extendSelection', commands.extendSelection.handle);
|
||||
registerCommand('ra-lsp.matchingBrace', commands.matchingBrace.handle);
|
||||
registerCommand('ra-lsp.joinLines', commands.joinLines.handle);
|
||||
|
@ -22,19 +22,19 @@ export function activate(context: vscode.ExtensionContext) {
|
|||
registerCommand('ra-lsp.run', commands.runnables.handle);
|
||||
registerCommand('ra-lsp.applySourceChange', commands.applySourceChange.handle);
|
||||
|
||||
let textDocumentContentProvider = new TextDocumentContentProvider()
|
||||
const textDocumentContentProvider = new TextDocumentContentProvider();
|
||||
disposeOnDeactivation(vscode.workspace.registerTextDocumentContentProvider(
|
||||
'ra-lsp',
|
||||
textDocumentContentProvider
|
||||
))
|
||||
textDocumentContentProvider,
|
||||
));
|
||||
|
||||
Server.start()
|
||||
Server.start();
|
||||
|
||||
vscode.workspace.onDidChangeTextDocument(
|
||||
events.changeTextDocument.createHandler(textDocumentContentProvider),
|
||||
null,
|
||||
context.subscriptions)
|
||||
vscode.window.onDidChangeActiveTextEditor(events.changeActiveTextEditor.handle)
|
||||
context.subscriptions);
|
||||
vscode.window.onDidChangeActiveTextEditor(events.changeActiveTextEditor.handle);
|
||||
}
|
||||
|
||||
export function deactivate(): Thenable<void> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue