From d829c3cf513c6ac8f3a93f69c3d295fa7c89cdcc Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Thu, 9 May 2019 15:42:28 +0200 Subject: [PATCH 01/13] added client-side type hints --- package.json | 131 ++++++++++--------- src/extension.ts | 11 +- src/providers/typeAnnotationsProvider.ts | 153 +++++++++++++++++++++++ 3 files changed, 233 insertions(+), 62 deletions(-) create mode 100644 src/providers/typeAnnotationsProvider.ts diff --git a/package.json b/package.json index e3e4e47d..c364a934 100644 --- a/package.json +++ b/package.json @@ -64,23 +64,37 @@ "vscode": "^1.1.30" }, "contributes": { - "languages": [ - { - "id": "rust", - "extensions": [ - ".rs" - ], - "configuration": "./language-configuration.json" - } - ], - "snippets": [ + "colors": [{ + "id": "rust.typeHintColor", + "description": "Specifies the foreground color of a type hint", + "defaults": { + "dark": "#A0A0A0F0", + "light": "#747474", + "highContrast": "#BEBEBE" + } + }, { - "language": "rust", - "path": "./snippets/rust.json" + "id": "rust.typeHintBackgroundColor", + "description": "Specifies the foreground color of a type hint", + "defaults": { + "dark": "#70707020", + "light": "#74747410", + "highContrast": "#BEBEBE" + } } ], - "commands": [ - { + "languages": [{ + "id": "rust", + "extensions": [ + ".rs" + ], + "configuration": "./language-configuration.json" + }], + "snippets": [{ + "language": "rust", + "path": "./snippets/rust.json" + }], + "commands": [{ "command": "rls.update", "title": "Update the RLS", "description": "Use Rustup to update Rust, the RLS, and required data", @@ -93,52 +107,47 @@ "category": "Rust" } ], - "taskDefinitions": [ - { - "type": "cargo", - "properties": { - "subcommand": { - "type": "string" - } - }, - "required": [ - "subcommand" - ] - } - ], - "problemMatchers": [ - { - "name": "rustc", - "owner": "rust", - "fileLocation": [ - "relative", - "${workspaceRoot}" - ], - "pattern": [ - { - "regexp": "^(warning|warn|error)(\\[(.*)\\])?: (.*)$", - "severity": 1, - "message": 4, - "code": 3 - }, - { - "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", - "file": 2, - "line": 3, - "column": 4 - }, - { - "regexp": "^.*$" - }, - { - "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", - "file": 2, - "line": 3, - "column": 4 - } - ] - } - ], + "taskDefinitions": [{ + "type": "cargo", + "properties": { + "subcommand": { + "type": "string" + } + }, + "required": [ + "subcommand" + ] + }], + "problemMatchers": [{ + "name": "rustc", + "owner": "rust", + "fileLocation": [ + "relative", + "${workspaceRoot}" + ], + "pattern": [{ + "regexp": "^(warning|warn|error)(\\[(.*)\\])?: (.*)$", + "severity": 1, + "message": 4, + "code": 3 + }, + { + "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", + "file": 2, + "line": 3, + "column": 4 + }, + { + "regexp": "^.*$" + }, + { + "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", + "file": 2, + "line": 3, + "column": 4 + } + ] + }], "configuration": { "type": "object", "title": "Rust configuration", @@ -398,4 +407,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index 31365edf..6d0bb3cd 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -23,11 +23,13 @@ import { import { RLSConfiguration } from './configuration'; import { SignatureHelpProvider } from './providers/signatureHelpProvider'; +import { Decorator } from './providers/typeAnnotationsProvider'; import { checkForRls, ensureToolchain, rustupUpdate } from './rustup'; import { startSpinner, stopSpinner } from './spinner'; import { activateTaskProvider, Execution, runRlsCommand } from './tasks'; import { withWsl } from './utils/child_process'; import { uriWindowsToWsl, uriWslToWindows } from './utils/wslpath'; +import * as vscode from 'vscode'; /** * Parameter type to `window/progress` request as issued by the RLS. @@ -201,6 +203,7 @@ class ClientWorkspace { private lc: LanguageClient | null = null; private readonly folder: WorkspaceFolder; private disposables: Disposable[]; + private decorator: Decorator | null = null; constructor(folder: WorkspaceFolder) { this.config = RLSConfiguration.loadFromWorkspace(folder.uri.fsPath); @@ -259,6 +262,8 @@ class ClientWorkspace { clientOptions, ); + this.decorator = new Decorator(this.lc); + this.setupProgressCounter(); this.registerCommands(context); this.disposables.push(activateTaskProvider(this.folder)); @@ -315,12 +320,16 @@ class ClientWorkspace { const runningProgress: Set = new Set(); await this.lc.onReady(); stopSpinner('RLS'); - this.lc.onNotification( new NotificationType('window/progress'), progress => { if (progress.done) { runningProgress.delete(progress.id); + if (this.decorator) { + for (let editor of vscode.window.visibleTextEditors) { + this.decorator.decorate(editor); + } + } } else { runningProgress.add(progress.id); } diff --git a/src/providers/typeAnnotationsProvider.ts b/src/providers/typeAnnotationsProvider.ts new file mode 100644 index 00000000..29cd97ad --- /dev/null +++ b/src/providers/typeAnnotationsProvider.ts @@ -0,0 +1,153 @@ +'use strict'; +import * as vscode from 'vscode'; +import { LanguageClient, HoverRequest } from 'vscode-languageclient'; +import { Position } from 'vscode'; + +const typeHintDecorationType = vscode.window.createTextEditorDecorationType({ + after: { + color: new vscode.ThemeColor('rust.typeHintColor'), + backgroundColor: new vscode.ThemeColor('rust.typeHintBackgroundColor'), + }, +}); + +const MULTIPLE_DECLARATIONS = '(&?(mut\\s+)?\\w+(\\s*:\\s*\\w+)?\\s*,?\\s*)+'; +const SIMPLE_DECLARATION = /(let|for)(\s+mut)?\s+(\w+)[ :=]/; +const TUPLE_UNPACKING: RegExp = new RegExp( + '(let\\s+|for\\s+|if let[^=]+)(\\(' + MULTIPLE_DECLARATIONS + '\\))', +); +const MATCH_CASE: RegExp = new RegExp( + '\\(' + MULTIPLE_DECLARATIONS + '\\)[)\\s]*=>', +); +const CLOSURE_PARAMETERS: RegExp = new RegExp( + '\\|' + MULTIPLE_DECLARATIONS + '\\|', +); +const INNER_DECLARATION: RegExp = new RegExp('&?\\s*(mut\\s+)?\\w+'); + +function unpack_arguments(line: string): number[] { + let result: number[] = []; + let args = line.split(','); + let count = 0; + for (let arg of args) { + let inner = arg.match(INNER_DECLARATION); + if (inner && inner.index !== undefined) { + result.push(count + inner.index + inner[0].length); + } + count += arg.length + 1; + } + return result; +} + +function get_next_position( + line_number: number, + substring: string, + base_charcount: number, +): Position[] { + let match = substring.match(SIMPLE_DECLARATION); + if (match && match.index) { + return [ + new Position( + line_number, + base_charcount + match.index + match[0].length - 1, + ), + ]; + } + let declaration_positions = []; + let closure_match = substring.match(CLOSURE_PARAMETERS); + if (closure_match && closure_match.index) { + for (let character of unpack_arguments(closure_match[0].substr(1))) { + declaration_positions.push( + new Position( + line_number, + base_charcount + closure_match.index + 1 + character, + ), + ); + } + return declaration_positions; + } + let tuple_unpacking = substring.match(TUPLE_UNPACKING); + if (tuple_unpacking && tuple_unpacking.index) { + for (let character of unpack_arguments(tuple_unpacking[2].substr(1))) { + declaration_positions.push( + new Position( + line_number, + base_charcount + + tuple_unpacking.index + + tuple_unpacking[1].length + + 1 + + character, + ), + ); + } + return declaration_positions; + } + let match_arm = substring.match(MATCH_CASE); + if (match_arm && match_arm.index) { + for (let character of unpack_arguments(match_arm[0].substr(1))) { + declaration_positions.push( + new Position( + line_number, + base_charcount + match_arm.index + 1 + character, + ), + ); + } + } + return declaration_positions; +} + +export class Decorator { + lc: LanguageClient; + public constructor(lc: LanguageClient) { + this.lc = lc; + } + + public async decorate(editor: vscode.TextEditor) { + if (!editor.document.uri.toString().endsWith('.rs')) { + return; + } + const text = editor.document.getText(); + const lines = text.split('\n'); + let declaration_positions: Position[] = []; + for (let i = 0; i < lines.length; i++) { + let line = lines[i].split('//')[0]; + if (line.trim().startsWith('impl')) { + continue; + } + let new_positions: Position[] = []; + let count = 0; + do { + new_positions = get_next_position(i, line, count); + for (let position of new_positions) { + declaration_positions.push(position); + } + let last = new_positions[new_positions.length - 1]; + if (last) { + line = line.substr(last.character); + count += last.character; + } + } while (new_positions.length > 0); + } + let hints: vscode.DecorationOptions[] = []; + for (let position of declaration_positions) { + let hover = await this.lc.sendRequest( + HoverRequest.type, + this.lc.code2ProtocolConverter.asTextDocumentPositionParams( + editor.document, + position.translate(0, -1), + ), + ); + if (hover) { + let hint = ': '; + let content = hover.contents; + try { + // @ts-ignore + hint += content[0].value; + } catch (e) {} + hints.push({ + range: new vscode.Range(position, position), + renderOptions: { after: { contentText: hint } }, + }); + } + } + editor.setDecorations(typeHintDecorationType, hints); + } +} From b997a258eb880b01de633293f33c407cf6c0c6ce Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Thu, 9 May 2019 17:27:07 +0200 Subject: [PATCH 02/13] Switching editor activates type hints without the need for reindexing --- src/extension.ts | 9 +++++++ src/providers/typeAnnotationsProvider.ts | 31 +++++++++++++++--------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 6d0bb3cd..124b19a9 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -51,6 +51,15 @@ export async function activate(context: ExtensionContext) { workspace.onDidChangeWorkspaceFolders(e => didChangeWorkspaceFolders(e, context), ); + window.onDidChangeVisibleTextEditors(editors => { + const decorator = Decorator.getInstance()!; + for (const editor of editors) { + decorator.decorate(editor); + } + }); + window.onDidChangeActiveTextEditor(editor => { + Decorator.getInstance()!.decorate(editor!); + }); } export async function deactivate() { diff --git a/src/providers/typeAnnotationsProvider.ts b/src/providers/typeAnnotationsProvider.ts index 29cd97ad..f87e3f1b 100644 --- a/src/providers/typeAnnotationsProvider.ts +++ b/src/providers/typeAnnotationsProvider.ts @@ -95,9 +95,16 @@ function get_next_position( } export class Decorator { - lc: LanguageClient; + private static instance?: Decorator; + private lc: LanguageClient; + public constructor(lc: LanguageClient) { this.lc = lc; + Decorator.instance = this; + } + + public static getInstance(): Decorator | undefined { + return Decorator.instance; } public async decorate(editor: vscode.TextEditor) { @@ -106,29 +113,29 @@ export class Decorator { } const text = editor.document.getText(); const lines = text.split('\n'); - let declaration_positions: Position[] = []; + const declarationPositions: Position[] = []; for (let i = 0; i < lines.length; i++) { let line = lines[i].split('//')[0]; if (line.trim().startsWith('impl')) { continue; } - let new_positions: Position[] = []; + let newPositions: Position[] = []; let count = 0; do { - new_positions = get_next_position(i, line, count); - for (let position of new_positions) { - declaration_positions.push(position); + newPositions = get_next_position(i, line, count); + for (const position of newPositions) { + declarationPositions.push(position); } - let last = new_positions[new_positions.length - 1]; + const last = newPositions[newPositions.length - 1]; if (last) { line = line.substr(last.character); count += last.character; } - } while (new_positions.length > 0); + } while (newPositions.length > 0); } - let hints: vscode.DecorationOptions[] = []; - for (let position of declaration_positions) { - let hover = await this.lc.sendRequest( + const hints: vscode.DecorationOptions[] = []; + for (const position of declarationPositions) { + const hover = await this.lc.sendRequest( HoverRequest.type, this.lc.code2ProtocolConverter.asTextDocumentPositionParams( editor.document, @@ -137,7 +144,7 @@ export class Decorator { ); if (hover) { let hint = ': '; - let content = hover.contents; + const content = hover.contents; try { // @ts-ignore hint += content[0].value; From d6186948f1342f36f1efa4ae39035da379ce8c06 Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Thu, 9 May 2019 18:26:15 +0200 Subject: [PATCH 03/13] And now linter shows 0 warns and won't annoy travis --- src/extension.ts | 123 ++++++++++++----------- src/providers/typeAnnotationsProvider.ts | 87 ++++++++-------- 2 files changed, 107 insertions(+), 103 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 124b19a9..6b86403a 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,19 +1,7 @@ import * as child_process from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; -import { - commands, - Disposable, - ExtensionContext, - IndentAction, - languages, - TextDocument, - Uri, - window, - workspace, - WorkspaceFolder, - WorkspaceFoldersChangeEvent, -} from 'vscode'; +import * as vscode from 'vscode'; import { LanguageClient, LanguageClientOptions, @@ -29,7 +17,6 @@ import { startSpinner, stopSpinner } from './spinner'; import { activateTaskProvider, Execution, runRlsCommand } from './tasks'; import { withWsl } from './utils/child_process'; import { uriWindowsToWsl, uriWslToWindows } from './utils/wslpath'; -import * as vscode from 'vscode'; /** * Parameter type to `window/progress` request as issued by the RLS. @@ -43,21 +30,25 @@ interface ProgressParams { done?: boolean; } -export async function activate(context: ExtensionContext) { +export async function activate(context: vscode.ExtensionContext) { context.subscriptions.push(configureLanguage()); - workspace.onDidOpenTextDocument(doc => didOpenTextDocument(doc, context)); - workspace.textDocuments.forEach(doc => didOpenTextDocument(doc, context)); - workspace.onDidChangeWorkspaceFolders(e => + vscode.workspace.onDidOpenTextDocument(doc => + didOpenTextDocument(doc, context), + ); + vscode.workspace.textDocuments.forEach(doc => + didOpenTextDocument(doc, context), + ); + vscode.workspace.onDidChangeWorkspaceFolders(e => didChangeWorkspaceFolders(e, context), ); - window.onDidChangeVisibleTextEditors(editors => { + vscode.window.onDidChangeVisibleTextEditors(editors => { const decorator = Decorator.getInstance()!; for (const editor of editors) { decorator.decorate(editor); } }); - window.onDidChangeActiveTextEditor(editor => { + vscode.window.onDidChangeActiveTextEditor(editor => { Decorator.getInstance()!.decorate(editor!); }); } @@ -68,20 +59,20 @@ export async function deactivate() { // Taken from https://github.com/Microsoft/vscode-extension-samples/blob/master/lsp-multi-server-sample/client/src/extension.ts function didOpenTextDocument( - document: TextDocument, - context: ExtensionContext, + document: vscode.TextDocument, + context: vscode.ExtensionContext, ) { if (document.languageId !== 'rust' && document.languageId !== 'toml') { return; } const uri = document.uri; - let folder = workspace.getWorkspaceFolder(uri); + let folder = vscode.workspace.getWorkspaceFolder(uri); if (!folder) { return; } if ( - workspace + vscode.workspace .getConfiguration() .get('rust-client.nestedMultiRootConfigInOutermost', true) ) { @@ -105,8 +96,8 @@ function didOpenTextDocument( let _sortedWorkspaceFolders: string[] | undefined; function sortedWorkspaceFolders(): string[] { - if (!_sortedWorkspaceFolders && workspace.workspaceFolders) { - _sortedWorkspaceFolders = workspace.workspaceFolders + if (!_sortedWorkspaceFolders && vscode.workspace.workspaceFolders) { + _sortedWorkspaceFolders = vscode.workspace.workspaceFolders .map(folder => { let result = folder.uri.toString(); if (result.charAt(result.length - 1) !== '/') { @@ -153,7 +144,9 @@ function sortedWorkspaceFolders(): string[] { // return cur_workspace; // } -function getOuterMostWorkspaceFolder(folder: WorkspaceFolder): WorkspaceFolder { +function getOuterMostWorkspaceFolder( + folder: vscode.WorkspaceFolder, +): vscode.WorkspaceFolder { const sorted = sortedWorkspaceFolders(); for (const element of sorted) { let uri = folder.uri.toString(); @@ -161,15 +154,17 @@ function getOuterMostWorkspaceFolder(folder: WorkspaceFolder): WorkspaceFolder { uri = uri + '/'; } if (uri.startsWith(element)) { - return workspace.getWorkspaceFolder(Uri.parse(element)) || folder; + return ( + vscode.workspace.getWorkspaceFolder(vscode.Uri.parse(element)) || folder + ); } } return folder; } function didChangeWorkspaceFolders( - e: WorkspaceFoldersChangeEvent, - context: ExtensionContext, + e: vscode.WorkspaceFoldersChangeEvent, + context: vscode.ExtensionContext, ) { _sortedWorkspaceFolders = undefined; @@ -200,7 +195,7 @@ function didChangeWorkspaceFolders( } } -const workspaces: Map = new Map(); +const workspaces: Map = new Map(); // We run one RLS and one corresponding language client per workspace folder // (VSCode workspace, not Cargo workspace). This class contains all the per-client @@ -210,17 +205,17 @@ class ClientWorkspace { // handle possible `rust-client.*` value changes while extension is running private readonly config: RLSConfiguration; private lc: LanguageClient | null = null; - private readonly folder: WorkspaceFolder; - private disposables: Disposable[]; + private readonly folder: vscode.WorkspaceFolder; + private disposables: vscode.Disposable[]; private decorator: Decorator | null = null; - constructor(folder: WorkspaceFolder) { + constructor(folder: vscode.WorkspaceFolder) { this.config = RLSConfiguration.loadFromWorkspace(folder.uri.fsPath); this.folder = folder; this.disposables = []; } - public async start(context: ExtensionContext) { + public async start(context: vscode.ExtensionContext) { warnOnMissingCargoToml(); startSpinner('RLS', 'Starting'); @@ -249,14 +244,14 @@ class ClientWorkspace { // Changes paths between Windows and Windows Subsystem for Linux if (this.config.useWSL) { clientOptions.uriConverters = { - code2Protocol: (uri: Uri) => { - const res = Uri.file(uriWindowsToWsl(uri.fsPath)).toString(); + code2Protocol: (uri: vscode.Uri) => { + const res = vscode.Uri.file(uriWindowsToWsl(uri.fsPath)).toString(); console.log(`code2Protocol for path ${uri.fsPath} -> ${res}`); return res; }, protocol2Code: (wslUri: string) => { - const urlDecodedPath = Uri.parse(wslUri).path; - const winPath = Uri.file(uriWslToWindows(urlDecodedPath)); + const urlDecodedPath = vscode.Uri.parse(wslUri).path; + const winPath = vscode.Uri.file(uriWslToWindows(urlDecodedPath)); console.log(`protocol2Code for path ${wslUri} -> ${winPath.fsPath}`); return winPath; }, @@ -278,7 +273,7 @@ class ClientWorkspace { this.disposables.push(activateTaskProvider(this.folder)); this.disposables.push(this.lc.start()); this.disposables.push( - languages.registerSignatureHelpProvider( + vscode.languages.registerSignatureHelpProvider( { language: 'rust' }, new SignatureHelpProvider(this.lc), '(', @@ -295,12 +290,12 @@ class ClientWorkspace { this.disposables.forEach(d => d.dispose()); } - private registerCommands(context: ExtensionContext) { + private registerCommands(context: vscode.ExtensionContext) { if (!this.lc) { return; } - const rustupUpdateDisposable = commands.registerCommand( + const rustupUpdateDisposable = vscode.commands.registerCommand( 'rls.update', () => { return rustupUpdate(this.config.rustupConfig()); @@ -308,14 +303,17 @@ class ClientWorkspace { ); this.disposables.push(rustupUpdateDisposable); - const restartServer = commands.registerCommand('rls.restart', async () => { - await this.stop(); - return this.start(context); - }); + const restartServer = vscode.commands.registerCommand( + 'rls.restart', + async () => { + await this.stop(); + return this.start(context); + }, + ); this.disposables.push(restartServer); this.disposables.push( - commands.registerCommand('rls.run', (cmd: Execution) => + vscode.commands.registerCommand('rls.run', (cmd: Execution) => runRlsCommand(this.folder, cmd), ), ); @@ -335,7 +333,7 @@ class ClientWorkspace { if (progress.done) { runningProgress.delete(progress.id); if (this.decorator) { - for (let editor of vscode.window.visibleTextEditors) { + for (const editor of vscode.window.visibleTextEditors) { this.decorator.decorate(editor); } } @@ -399,7 +397,7 @@ class ClientWorkspace { sysroot = await this.getSysroot(env); } catch (e) { console.warn('Error reading sysroot (second try)', e); - window.showWarningMessage(`Error reading sysroot: ${e.message}`); + vscode.window.showWarningMessage(`Error reading sysroot: ${e.message}`); return env; } } @@ -461,7 +459,9 @@ class ClientWorkspace { childProcess.on('error', (err: { code?: string; message: string }) => { if (err.code === 'ENOENT') { console.error(`Could not spawn RLS: ${err.message}`); - window.showWarningMessage(`Could not spawn RLS: \`${err.message}\``); + vscode.window.showWarningMessage( + `Could not spawn RLS: \`${err.message}\``, + ); } }); @@ -482,10 +482,10 @@ class ClientWorkspace { } async function warnOnMissingCargoToml() { - const files = await workspace.findFiles('Cargo.toml'); + const files = await vscode.workspace.findFiles('Cargo.toml'); if (files.length < 1) { - window.showWarningMessage( + vscode.window.showWarningMessage( 'A Cargo.toml file must be at the root of the workspace in order to support all features', ); } @@ -497,45 +497,48 @@ async function warnOnMissingCargoToml() { * * [1]: https://github.com/Microsoft/vscode/issues/11514#issuecomment-244707076 */ -function configureLanguage(): Disposable { - return languages.setLanguageConfiguration('rust', { +function configureLanguage(): vscode.Disposable { + return vscode.languages.setLanguageConfiguration('rust', { onEnterRules: [ { // Doc single-line comment // e.g. ///| beforeText: /^\s*\/{3}.*$/, - action: { indentAction: IndentAction.None, appendText: '/// ' }, + action: { indentAction: vscode.IndentAction.None, appendText: '/// ' }, }, { // Parent doc single-line comment // e.g. //!| beforeText: /^\s*\/{2}\!.*$/, - action: { indentAction: IndentAction.None, appendText: '//! ' }, + action: { indentAction: vscode.IndentAction.None, appendText: '//! ' }, }, { // Begins an auto-closed multi-line comment (standard or parent doc) // e.g. /** | */ or /*! | */ beforeText: /^\s*\/\*(\*|\!)(?!\/)([^\*]|\*(?!\/))*$/, afterText: /^\s*\*\/$/, - action: { indentAction: IndentAction.IndentOutdent, appendText: ' * ' }, + action: { + indentAction: vscode.IndentAction.IndentOutdent, + appendText: ' * ', + }, }, { // Begins a multi-line comment (standard or parent doc) // e.g. /** ...| or /*! ...| beforeText: /^\s*\/\*(\*|\!)(?!\/)([^\*]|\*(?!\/))*$/, - action: { indentAction: IndentAction.None, appendText: ' * ' }, + action: { indentAction: vscode.IndentAction.None, appendText: ' * ' }, }, { // Continues a multi-line comment // e.g. * ...| beforeText: /^(\ \ )*\ \*(\ ([^\*]|\*(?!\/))*)?$/, - action: { indentAction: IndentAction.None, appendText: '* ' }, + action: { indentAction: vscode.IndentAction.None, appendText: '* ' }, }, { // Dedents after closing a multi-line comment // e.g. */| beforeText: /^(\ \ )*\ \*\/\s*$/, - action: { indentAction: IndentAction.None, removeText: 1 }, + action: { indentAction: vscode.IndentAction.None, removeText: 1 }, }, ], }); diff --git a/src/providers/typeAnnotationsProvider.ts b/src/providers/typeAnnotationsProvider.ts index f87e3f1b..7608ce3f 100644 --- a/src/providers/typeAnnotationsProvider.ts +++ b/src/providers/typeAnnotationsProvider.ts @@ -1,7 +1,6 @@ 'use strict'; import * as vscode from 'vscode'; -import { LanguageClient, HoverRequest } from 'vscode-languageclient'; -import { Position } from 'vscode'; +import { HoverRequest, LanguageClient } from 'vscode-languageclient'; const typeHintDecorationType = vscode.window.createTextEditorDecorationType({ after: { @@ -24,11 +23,11 @@ const CLOSURE_PARAMETERS: RegExp = new RegExp( const INNER_DECLARATION: RegExp = new RegExp('&?\\s*(mut\\s+)?\\w+'); function unpack_arguments(line: string): number[] { - let result: number[] = []; - let args = line.split(','); + const result: number[] = []; + const args = line.split(','); let count = 0; - for (let arg of args) { - let inner = arg.match(INNER_DECLARATION); + for (const arg of args) { + const inner = arg.match(INNER_DECLARATION); if (inner && inner.index !== undefined) { result.push(count + inner.index + inner[0].length); } @@ -38,60 +37,60 @@ function unpack_arguments(line: string): number[] { } function get_next_position( - line_number: number, + lineNumber: number, substring: string, - base_charcount: number, -): Position[] { - let match = substring.match(SIMPLE_DECLARATION); + currentCharCount: number, +): vscode.Position[] { + const match = substring.match(SIMPLE_DECLARATION); if (match && match.index) { return [ - new Position( - line_number, - base_charcount + match.index + match[0].length - 1, + new vscode.Position( + lineNumber, + currentCharCount + match.index + match[0].length - 1, ), ]; } - let declaration_positions = []; - let closure_match = substring.match(CLOSURE_PARAMETERS); - if (closure_match && closure_match.index) { - for (let character of unpack_arguments(closure_match[0].substr(1))) { - declaration_positions.push( - new Position( - line_number, - base_charcount + closure_match.index + 1 + character, + const declarationPositions = []; + const closureMatch = substring.match(CLOSURE_PARAMETERS); + if (closureMatch && closureMatch.index) { + for (const character of unpack_arguments(closureMatch[0].substr(1))) { + declarationPositions.push( + new vscode.Position( + lineNumber, + currentCharCount + closureMatch.index + 1 + character, ), ); } - return declaration_positions; + return declarationPositions; } - let tuple_unpacking = substring.match(TUPLE_UNPACKING); - if (tuple_unpacking && tuple_unpacking.index) { - for (let character of unpack_arguments(tuple_unpacking[2].substr(1))) { - declaration_positions.push( - new Position( - line_number, - base_charcount + - tuple_unpacking.index + - tuple_unpacking[1].length + + const tupleUnpacking = substring.match(TUPLE_UNPACKING); + if (tupleUnpacking && tupleUnpacking.index) { + for (const character of unpack_arguments(tupleUnpacking[2].substr(1))) { + declarationPositions.push( + new vscode.Position( + lineNumber, + currentCharCount + + tupleUnpacking.index + + tupleUnpacking[1].length + 1 + character, ), ); } - return declaration_positions; + return declarationPositions; } - let match_arm = substring.match(MATCH_CASE); - if (match_arm && match_arm.index) { - for (let character of unpack_arguments(match_arm[0].substr(1))) { - declaration_positions.push( - new Position( - line_number, - base_charcount + match_arm.index + 1 + character, + const matchArm = substring.match(MATCH_CASE); + if (matchArm && matchArm.index) { + for (const character of unpack_arguments(matchArm[0].substr(1))) { + declarationPositions.push( + new vscode.Position( + lineNumber, + currentCharCount + matchArm.index + 1 + character, ), ); } } - return declaration_positions; + return declarationPositions; } export class Decorator { @@ -113,13 +112,13 @@ export class Decorator { } const text = editor.document.getText(); const lines = text.split('\n'); - const declarationPositions: Position[] = []; + const declarationPositions: vscode.Position[] = []; for (let i = 0; i < lines.length; i++) { let line = lines[i].split('//')[0]; if (line.trim().startsWith('impl')) { continue; } - let newPositions: Position[] = []; + let newPositions: vscode.Position[] = []; let count = 0; do { newPositions = get_next_position(i, line, count); @@ -148,7 +147,9 @@ export class Decorator { try { // @ts-ignore hint += content[0].value; - } catch (e) {} + } catch (e) { + continue; + } hints.push({ range: new vscode.Range(position, position), renderOptions: { after: { contentText: hint } }, From 57277c5051e4006a495936c9ddec820ce32dc411 Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Fri, 10 May 2019 12:31:01 +0200 Subject: [PATCH 04/13] Back to unpack style imports, added mutex, found weird issue --- CHANGELOG.md | 5 + package-lock.json | 1557 +++------------------- package.json | 128 +- src/extension.ts | 143 +- src/providers/typeAnnotationsProvider.ts | 109 +- 5 files changed, 373 insertions(+), 1569 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee3a1647..b8616fc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ### Unreleased +### 0.6.2 - 2019-05-10 + +* Added type annotations _à la_ CLion. + + ### 0.6.1 - 2019-04-04 * Fix Cargo task auto-detection diff --git a/package-lock.json b/package-lock.json index 422b6fdb..84613d91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "rust", - "version": "0.6.1", + "version": "0.6.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -16,10 +16,19 @@ "integrity": "sha1-YGZR0/iovsCLjLJiFhqrkgn0op0=", "dev": true }, + "agent-base": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", + "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + }, "ajv": { "version": "6.10.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha1-kNDVRDnaWHzX6EO/twRfUL0ivfE=", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -28,24 +37,6 @@ "uri-js": "^4.2.2" } }, - "ansi-cyan": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz", - "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM=", - "dev": true, - "requires": { - "ansi-wrap": "0.1.0" - } - }, - "ansi-red": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz", - "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=", - "dev": true, - "requires": { - "ansi-wrap": "0.1.0" - } - }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -61,21 +52,6 @@ "color-convert": "^1.9.0" } }, - "ansi-wrap": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", - "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", - "dev": true - }, - "append-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", - "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", - "dev": true, - "requires": { - "buffer-equal": "^1.0.0" - } - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -85,65 +61,10 @@ "sprintf-js": "~1.0.2" } }, - "arr-diff": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", - "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1", - "array-slice": "^0.2.3" - } - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz", - "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=", - "dev": true - }, - "array-differ": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", - "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", - "dev": true - }, - "array-slice": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", - "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "dev": true, "requires": { "safer-buffer": "~2.1.0" @@ -155,6 +76,11 @@ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true }, + "async-mutex": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.1.3.tgz", + "integrity": "sha1-Cq0hEjaXlas/F+M3RFVtLs9UdWY=" + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -170,7 +96,7 @@ "aws4": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha1-8OAD2cqef1nHpQiUXXsu+aBKVC8=", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", "dev": true }, "babel-code-frame": { @@ -226,15 +152,6 @@ "tweetnacl": "^0.14.3" } }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "dev": true, - "requires": { - "inherits": "~2.0.0" - } - }, "boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -263,16 +180,10 @@ "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", "dev": true }, - "buffer-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", - "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", - "dev": true - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, "builtin-modules": { @@ -312,61 +223,6 @@ "parse5": "^3.0.1" } }, - "clone": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", - "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", - "dev": true - }, - "clone-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", - "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", - "dev": true - }, - "clone-stats": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", - "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", - "dev": true - }, - "cloneable-readable": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz", - "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "process-nextick-args": "^2.0.0", - "readable-stream": "^2.3.5" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -385,7 +241,7 @@ "combined-stream": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha1-LR0kMXr7ir6V1tLAsHtXgTU52Cg=", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", "dev": true, "requires": { "delayed-stream": "~1.0.0" @@ -403,15 +259,6 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -448,30 +295,12 @@ "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { "ms": "2.0.0" } }, - "deep-assign": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/deep-assign/-/deep-assign-1.0.0.tgz", - "integrity": "sha1-sJJ0O+hCfcYh6gBnzex+cN0Z83s=", - "dev": true, - "requires": { - "is-obj": "^1.0.0" - } - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -525,50 +354,6 @@ "domelementtype": "1" } }, - "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", - "dev": true - }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -579,21 +364,27 @@ "safer-buffer": "^2.1.0" } }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", "integrity": "sha1-vfpzUplmTfr9NFKe1PhSKidf6lY=", "dev": true }, + "es6-promise": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", + "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==", + "dev": true + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "dev": true, + "requires": { + "es6-promise": "^4.0.3" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -612,36 +403,12 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, - "event-stream": { - "version": "3.3.4", - "resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", - "dev": true, - "requires": { - "duplexer": "~0.1.1", - "from": "~0", - "map-stream": "~0.1.0", - "pause-stream": "0.0.11", - "split": "0.3", - "stream-combiner": "~0.0.4", - "through": "~2.3.1" - } - }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, - "extend-shallow": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", - "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", - "dev": true, - "requires": { - "kind-of": "^1.1.0" - } - }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -669,42 +436,6 @@ "pend": "~1.2.0" } }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -714,7 +445,7 @@ "form-data": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "requires": { "asynckit": "^0.4.0", @@ -722,46 +453,12 @@ "mime-types": "^2.1.12" } }, - "from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", - "dev": true - }, - "fs-mkdirp-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", - "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "through2": "^2.0.3" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -785,262 +482,12 @@ "path-is-absolute": "^1.0.0" } }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - } - }, - "glob-stream": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", - "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", - "dev": true, - "requires": { - "extend": "^3.0.0", - "glob": "^7.1.1", - "glob-parent": "^3.1.0", - "is-negated-glob": "^1.0.0", - "ordered-read-streams": "^1.0.0", - "pumpify": "^1.3.5", - "readable-stream": "^2.1.5", - "remove-trailing-separator": "^1.0.1", - "to-absolute-glob": "^2.0.0", - "unique-stream": "^2.0.2" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", - "dev": true - }, "growl": { "version": "1.10.3", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", "dev": true }, - "gulp-chmod": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/gulp-chmod/-/gulp-chmod-2.0.0.tgz", - "integrity": "sha1-AMOQuSigeZslGsz2MaoJ4BzGKZw=", - "dev": true, - "requires": { - "deep-assign": "^1.0.0", - "stat-mode": "^0.2.0", - "through2": "^2.0.0" - } - }, - "gulp-filter": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-5.1.0.tgz", - "integrity": "sha1-oF4Rr/sHz33PQafeHLe2OsN4PnM=", - "dev": true, - "requires": { - "multimatch": "^2.0.0", - "plugin-error": "^0.1.2", - "streamfilter": "^1.0.5" - } - }, - "gulp-gunzip": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulp-gunzip/-/gulp-gunzip-1.0.0.tgz", - "integrity": "sha1-FbdBFF6Dqcb1CIYkG1fMWHHxUak=", - "dev": true, - "requires": { - "through2": "~0.6.5", - "vinyl": "~0.4.6" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": ">=1.0.33-1 <1.1.0-0", - "xtend": ">=4.0.0 <4.1.0-0" - } - } - } - }, - "gulp-remote-src-vscode": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/gulp-remote-src-vscode/-/gulp-remote-src-vscode-0.5.1.tgz", - "integrity": "sha512-mw4OGjtC/jlCWJFhbcAlel4YPvccChlpsl3JceNiB/DLJi24/UPxXt53/N26lgI3dknEqd4ErfdHrO8sJ5bATQ==", - "dev": true, - "requires": { - "event-stream": "3.3.4", - "node.extend": "^1.1.2", - "request": "^2.79.0", - "through2": "^2.0.3", - "vinyl": "^2.0.1" - }, - "dependencies": { - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", - "dev": true, - "requires": { - "clone": "^2.1.1", - "clone-buffer": "^1.0.0", - "clone-stats": "^1.0.0", - "cloneable-readable": "^1.0.0", - "remove-trailing-separator": "^1.0.1", - "replace-ext": "^1.0.0" - } - } - } - }, - "gulp-untar": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/gulp-untar/-/gulp-untar-0.0.7.tgz", - "integrity": "sha512-0QfbCH2a1k2qkTLWPqTX+QO4qNsHn3kC546YhAP3/n0h+nvtyGITDuDrYBMDZeW4WnFijmkOvBWa5HshTic1tw==", - "dev": true, - "requires": { - "event-stream": "~3.3.4", - "streamifier": "~0.1.1", - "tar": "^2.2.1", - "through2": "~2.0.3", - "vinyl": "^1.2.0" - }, - "dependencies": { - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true - }, - "replace-ext": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", - "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", - "dev": true - }, - "vinyl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", - "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", - "dev": true, - "requires": { - "clone": "^1.0.0", - "clone-stats": "^0.0.1", - "replace-ext": "0.0.1" - } - } - } - }, - "gulp-vinyl-zip": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/gulp-vinyl-zip/-/gulp-vinyl-zip-2.1.2.tgz", - "integrity": "sha512-wJn09jsb8PyvUeyFF7y7ImEJqJwYy40BqL9GKfJs6UGpaGW9A+N68Q+ajsIpb9AeR6lAdjMbIdDPclIGo1/b7Q==", - "dev": true, - "requires": { - "event-stream": "3.3.4", - "queue": "^4.2.1", - "through2": "^2.0.3", - "vinyl": "^2.0.2", - "vinyl-fs": "^3.0.3", - "yauzl": "^2.2.1", - "yazl": "^2.2.1" - }, - "dependencies": { - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", - "dev": true, - "requires": { - "clone": "^2.1.1", - "clone-buffer": "^1.0.0", - "clone-stats": "^1.0.0", - "cloneable-readable": "^1.0.0", - "remove-trailing-separator": "^1.0.1", - "replace-ext": "^1.0.0" - } - } - } - }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -1050,22 +497,13 @@ "har-validator": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha1-HvievT5JllV2de7ZiTEQ3DUPoIA=", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "dev": true, "requires": { "ajv": "^6.5.5", "har-schema": "^2.0.0" } }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -1081,12 +519,6 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true - }, "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", @@ -1107,6 +539,16 @@ "readable-stream": "^3.1.1" } }, + "http-proxy-agent": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", + "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "dev": true, + "requires": { + "agent-base": "4", + "debug": "3.1.0" + } + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -1118,6 +560,16 @@ "sshpk": "^1.7.0" } }, + "https-proxy-agent": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", + "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "dev": true, + "requires": { + "agent-base": "^4.1.0", + "debug": "^3.1.0" + } + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1134,103 +586,12 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, - "is": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", - "integrity": "sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==", - "dev": true - }, - "is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", - "dev": true, - "requires": { - "is-relative": "^1.0.0", - "is-windows": "^1.0.1" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - }, - "is-negated-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", - "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", - "dev": true - }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - }, - "is-relative": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", - "dev": true, - "requires": { - "is-unc-path": "^1.0.0" - } - }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, - "is-unc-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", - "dev": true, - "requires": { - "unc-path-regex": "^0.1.2" - } - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-valid-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", - "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -1244,9 +605,9 @@ "dev": true }, "js-yaml": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz", - "integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -1268,13 +629,7 @@ "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stringify-safe": { @@ -1295,56 +650,6 @@ "verror": "1.10.0" } }, - "kind-of": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", - "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", - "dev": true - }, - "lazystream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", - "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", - "dev": true, - "requires": { - "readable-stream": "^2.0.5" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "lead": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", - "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", - "dev": true, - "requires": { - "flush-write-stream": "^1.0.2" - } - }, "linkify-it": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.1.0.tgz", @@ -1360,12 +665,6 @@ "integrity": "sha1-s56mIp72B+zYniyN8SU2iRysm40=", "dev": true }, - "map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", - "dev": true - }, "markdown-it": { "version": "8.4.2", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", @@ -1392,18 +691,18 @@ "dev": true }, "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha1-GiqrFtqesWe0nG5N8tnGjWPY4q0=", + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", "dev": true }, "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha1-/ms1WhkJJqt2mMmgVWoRGZshmb0=", + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "dev": true, "requires": { - "mime-db": "~1.38.0" + "mime-db": "1.40.0" } }, "minimatch": { @@ -1430,58 +729,59 @@ "minimist": "0.0.8" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "multimatch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", - "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", - "dev": true, - "requires": { - "array-differ": "^1.0.0", - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "minimatch": "^3.0.0" - } - }, - "mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha1-FjDEKyJR/4HiooPelqVJfqkuXg0=", - "dev": true - }, - "node.extend": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.1.8.tgz", - "integrity": "sha512-L/dvEBwyg3UowwqOUTyDsGBU6kjBQOpOhshio9V3i3BMPv5YUb9+mWNN8MK0IbWqT0AqaTSONZf0aTuMMahWgA==", - "dev": true, - "requires": { - "has": "^1.0.3", - "is": "^3.2.1" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "now-and-later": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.0.tgz", - "integrity": "sha1-vGHLtFbXnLMiB85HygUTb/Ln1u4=", - "dev": true, - "requires": { - "once": "^1.3.2" + "mocha": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz", + "integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==", + "dev": true, + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.11.0", + "debug": "3.1.0", + "diff": "3.3.1", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.3", + "he": "1.1.1", + "mkdirp": "0.5.1", + "supports-color": "4.4.0" + }, + "dependencies": { + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "dev": true, + "requires": { + "has-flag": "^2.0.0" + } + } } }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha1-FjDEKyJR/4HiooPelqVJfqkuXg0=", + "dev": true + }, "nth-check": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", @@ -1494,27 +794,9 @@ "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU=", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true }, - "object-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", - "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", - "dev": true - }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - } - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1524,41 +806,6 @@ "wrappy": "1" } }, - "ordered-read-streams": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", - "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", - "dev": true, - "requires": { - "readable-stream": "^2.0.1" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -1599,12 +846,6 @@ "@types/node": "*" } }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -1617,15 +858,6 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, - "pause-stream": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", - "dev": true, - "requires": { - "through": "~2.3" - } - }, "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -1638,62 +870,22 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, - "plugin-error": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", - "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", - "dev": true, - "requires": { - "ansi-cyan": "^0.1.1", - "ansi-red": "^0.1.1", - "arr-diff": "^1.0.1", - "arr-union": "^2.0.1", - "extend-shallow": "^1.1.2" - } - }, "prettier": { "version": "1.16.4", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.4.tgz", "integrity": "sha1-c+N+c+AYrS25x2dC4mR+IXkMlxc=", "dev": true }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - }, "psl": { "version": "1.1.31", "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha1-6aqG0BAbWxBcvpOsa3hM1UcnYYQ=", + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", "dev": true }, - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - } - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "q": { @@ -1705,24 +897,15 @@ "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, "querystringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz", - "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", + "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==", "dev": true }, - "queue": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/queue/-/queue-4.5.1.tgz", - "integrity": "sha512-AMD7w5hRXcFSb8s9u38acBZ+309u6GsiibP4/0YacJeaurRshogB7v/ZcVPxP5gD5+zIw6ixRHdutiYUJfwKHw==", - "dev": true, - "requires": { - "inherits": "~2.0.0" - } - }, "read": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", @@ -1743,43 +926,10 @@ "util-deprecate": "^1.0.1" } }, - "remove-bom-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", - "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", - "dev": true, - "requires": { - "is-buffer": "^1.1.5", - "is-utf8": "^0.2.1" - } - }, - "remove-bom-stream": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", - "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", - "dev": true, - "requires": { - "remove-bom-buffer": "^3.0.0", - "safe-buffer": "^5.1.0", - "through2": "^2.0.3" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true - }, "request": { "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha1-nC/KT301tZLv5Xx/ClXoEFIST+8=", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", "dev": true, "requires": { "aws-sign2": "~0.7.0", @@ -1819,40 +969,6 @@ "path-parse": "^1.0.6" } }, - "resolve-options": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", - "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", - "dev": true, - "requires": { - "value-or-function": "^3.0.0" - } - }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - }, - "dependencies": { - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -1862,7 +978,7 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "semver": { @@ -1874,28 +990,19 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "source-map-support": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.10.tgz", - "integrity": "sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ==", + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, - "split": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", - "dev": true, - "requires": { - "through": "2" - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -1905,7 +1012,7 @@ "sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "dev": true, "requires": { "asn1": "~0.2.3", @@ -1919,68 +1026,6 @@ "tweetnacl": "~0.14.0" } }, - "stat-mode": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-0.2.2.tgz", - "integrity": "sha1-5sgLYjEj19gM8TLOU480YokHJQI=", - "dev": true - }, - "stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", - "dev": true, - "requires": { - "duplexer": "~0.1.1" - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "dev": true - }, - "streamfilter": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/streamfilter/-/streamfilter-1.0.7.tgz", - "integrity": "sha512-Gk6KZM+yNA1JpW0KzlZIhjo3EaBJDkYfXtYSbOwNIQ7Zd6006E6+sCFlW1NDvFG/vnXhKmw6TJJgiEQg/8lXfQ==", - "dev": true, - "requires": { - "readable-stream": "^2.0.2" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "streamifier": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/streamifier/-/streamifier-0.1.1.tgz", - "integrity": "sha1-l+mNj6TRBdYqJpHR3AfoINuN/E8=", - "dev": true - }, "string_decoder": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", @@ -2008,69 +1053,6 @@ "has-flag": "^3.0.0" } }, - "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", - "dev": true, - "requires": { - "block-stream": "*", - "fstream": "^1.0.2", - "inherits": "2" - } - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "through2-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", - "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", - "dev": true, - "requires": { - "through2": "~2.0.0", - "xtend": "~4.0.0" - } - }, "tmp": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.29.tgz", @@ -2080,29 +1062,10 @@ "os-tmpdir": "~1.0.1" } }, - "to-absolute-glob": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", - "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", - "dev": true, - "requires": { - "is-absolute": "^1.0.0", - "is-negated-glob": "^1.0.0" - } - }, - "to-through": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", - "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", - "dev": true, - "requires": { - "through2": "^2.0.3" - } - }, "tough-cookie": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha1-U/Nto/R3g7CSWvoG/587FlKA94E=", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "dev": true, "requires": { "psl": "^1.1.24", @@ -2210,32 +1173,16 @@ "integrity": "sha1-nEEagCpAmpH8bPdAgbq6NLJEmaw=", "dev": true }, - "unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", - "dev": true - }, "underscore": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", "integrity": "sha1-BtzjSg5op7q8KbNluOdLiSUgOWE=", "dev": true }, - "unique-stream": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", - "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", - "dev": true, - "requires": { - "json-stable-stringify-without-jsonify": "^1.0.1", - "through2-filter": "^3.0.0" - } - }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "dev": true, "requires": { "punycode": "^2.1.0" @@ -2248,12 +1195,12 @@ "dev": true }, "url-parse": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.4.tgz", - "integrity": "sha1-ysFVbpX6oDA2kf7Fz51aG8NGSPg=", + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", + "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", "dev": true, "requires": { - "querystringify": "^2.0.0", + "querystringify": "^2.1.1", "requires-port": "^1.0.0" } }, @@ -2266,13 +1213,7 @@ "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha1-G0r0lV6zB3xQHCOHL8ZROBFYcTE=", - "dev": true - }, - "value-or-function": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", - "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", "dev": true }, "verror": { @@ -2286,146 +1227,6 @@ "extsprintf": "^1.2.0" } }, - "vinyl": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", - "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", - "dev": true, - "requires": { - "clone": "^0.2.0", - "clone-stats": "^0.0.1" - } - }, - "vinyl-fs": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", - "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", - "dev": true, - "requires": { - "fs-mkdirp-stream": "^1.0.0", - "glob-stream": "^6.1.0", - "graceful-fs": "^4.0.0", - "is-valid-glob": "^1.0.0", - "lazystream": "^1.0.0", - "lead": "^1.0.0", - "object.assign": "^4.0.4", - "pumpify": "^1.3.5", - "readable-stream": "^2.3.3", - "remove-bom-buffer": "^3.0.0", - "remove-bom-stream": "^1.2.0", - "resolve-options": "^1.1.0", - "through2": "^2.0.0", - "to-through": "^2.0.0", - "value-or-function": "^3.0.0", - "vinyl": "^2.0.0", - "vinyl-sourcemap": "^1.1.0" - }, - "dependencies": { - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", - "dev": true, - "requires": { - "clone": "^2.1.1", - "clone-buffer": "^1.0.0", - "clone-stats": "^1.0.0", - "cloneable-readable": "^1.0.0", - "remove-trailing-separator": "^1.0.1", - "replace-ext": "^1.0.0" - } - } - } - }, - "vinyl-source-stream": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-1.1.2.tgz", - "integrity": "sha1-YrU6E1YQqJbpjKlr7jqH8Aio54A=", - "dev": true, - "requires": { - "through2": "^2.0.3", - "vinyl": "^0.4.3" - } - }, - "vinyl-sourcemap": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", - "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", - "dev": true, - "requires": { - "append-buffer": "^1.0.2", - "convert-source-map": "^1.5.0", - "graceful-fs": "^4.1.6", - "normalize-path": "^2.1.1", - "now-and-later": "^2.0.0", - "remove-bom-buffer": "^3.0.0", - "vinyl": "^2.0.0" - }, - "dependencies": { - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", - "dev": true, - "requires": { - "clone": "^2.1.1", - "clone-buffer": "^1.0.0", - "clone-stats": "^1.0.0", - "cloneable-readable": "^1.0.0", - "remove-trailing-separator": "^1.0.1", - "replace-ext": "^1.0.0" - } - } - } - }, "vsce": { "version": "1.58.0", "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.58.0.tgz", @@ -2453,66 +1254,18 @@ } }, "vscode": { - "version": "1.1.30", - "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.30.tgz", - "integrity": "sha512-YDj5w0TGOcS8XLIdekT4q6LlLV6hv1ZvuT2aGT3KJll4gMz6dUPDgo2VVAf0i0E8igbbZthwvmaUGRwW9yPIaw==", + "version": "1.1.34", + "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.34.tgz", + "integrity": "sha512-GuT3tCT2N5Qp26VG4C+iGmWMgg/MuqtY5G5TSOT3U/X6pgjM9LFulJEeqpyf6gdzpI4VyU3ZN/lWPo54UFPuQg==", "dev": true, "requires": { "glob": "^7.1.2", - "gulp-chmod": "^2.0.0", - "gulp-filter": "^5.0.1", - "gulp-gunzip": "1.0.0", - "gulp-remote-src-vscode": "^0.5.1", - "gulp-untar": "^0.0.7", - "gulp-vinyl-zip": "^2.1.2", "mocha": "^4.0.1", "request": "^2.88.0", "semver": "^5.4.1", "source-map-support": "^0.5.0", - "url-parse": "^1.4.3", - "vinyl-fs": "^3.0.3", - "vinyl-source-stream": "^1.1.0" - }, - "dependencies": { - "commander": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", - "dev": true - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true - }, - "mocha": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz", - "integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==", - "dev": true, - "requires": { - "browser-stdout": "1.3.0", - "commander": "2.11.0", - "debug": "3.1.0", - "diff": "3.3.1", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.3", - "he": "1.1.1", - "mkdirp": "0.5.1", - "supports-color": "4.4.0" - } - }, - "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", - "dev": true, - "requires": { - "has-flag": "^2.0.0" - } - } + "url-parse": "^1.4.4", + "vscode-test": "^0.4.1" } }, "vscode-jsonrpc": { @@ -2542,6 +1295,16 @@ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.9.0.tgz", "integrity": "sha512-Qzh3VsU3t0zhKtYl1revyax+4gGHl2ejNzYXeiZYQMF3i0vX4dtPohxGDFoZYfGFQI738aXYbSUQmhLeBckDlQ==" }, + "vscode-test": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-0.4.1.tgz", + "integrity": "sha512-uIi/07uG/gmCbD9Y9bFpNzmk4el82xiclijEdL426A3jOFfvwdqgfmtuWYfxEGo0w6JY9EqVDTGQCXwuInXVTQ==", + "dev": true, + "requires": { + "http-proxy-agent": "^2.1.0", + "https-proxy-agent": "^2.2.1" + } + }, "vso-node-api": { "version": "6.1.2-preview", "resolved": "https://registry.npmjs.org/vso-node-api/-/vso-node-api-6.1.2-preview.tgz", @@ -2560,12 +1323,6 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, "yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", diff --git a/package.json b/package.json index c364a934..313c4771 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "rust", "displayName": "Rust (rls)", "description": "Rust language support - code completion, Intellisense, refactoring, reformatting, errors, snippets. A client for the Rust Language Server, built by the RLS team.", - "version": "0.6.1", + "version": "0.6.2", "publisher": "rust-lang", "icon": "rust-icon.png", "galleryBanner": { @@ -51,7 +51,8 @@ "installDevExtension": "npm install && ./node_modules/.bin/vsce package -o ./out/rls-vscode-dev.vsix && code --install-extension ./out/rls-vscode-dev.vsix" }, "dependencies": { - "vscode-languageclient": "^4.3.0" + "vscode-languageclient": "^4.3.0", + "async-mutex": "0.1.3" }, "devDependencies": { "@types/mocha": "^2.2.43", @@ -61,10 +62,11 @@ "tslint-config-prettier": "^1.18.0", "typescript": "^3.0.0", "vsce": "^1.58.0", - "vscode": "^1.1.30" + "vscode": "^1.1.34" }, "contributes": { - "colors": [{ + "colors": [ + { "id": "rust.typeHintColor", "description": "Specifies the foreground color of a type hint", "defaults": { @@ -83,18 +85,23 @@ } } ], - "languages": [{ - "id": "rust", - "extensions": [ - ".rs" - ], - "configuration": "./language-configuration.json" - }], - "snippets": [{ - "language": "rust", - "path": "./snippets/rust.json" - }], - "commands": [{ + "languages": [ + { + "id": "rust", + "extensions": [ + ".rs" + ], + "configuration": "./language-configuration.json" + } + ], + "snippets": [ + { + "language": "rust", + "path": "./snippets/rust.json" + } + ], + "commands": [ + { "command": "rls.update", "title": "Update the RLS", "description": "Use Rustup to update Rust, the RLS, and required data", @@ -107,47 +114,52 @@ "category": "Rust" } ], - "taskDefinitions": [{ - "type": "cargo", - "properties": { - "subcommand": { - "type": "string" - } - }, - "required": [ - "subcommand" - ] - }], - "problemMatchers": [{ - "name": "rustc", - "owner": "rust", - "fileLocation": [ - "relative", - "${workspaceRoot}" - ], - "pattern": [{ - "regexp": "^(warning|warn|error)(\\[(.*)\\])?: (.*)$", - "severity": 1, - "message": 4, - "code": 3 - }, - { - "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", - "file": 2, - "line": 3, - "column": 4 - }, - { - "regexp": "^.*$" - }, - { - "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", - "file": 2, - "line": 3, - "column": 4 - } - ] - }], + "taskDefinitions": [ + { + "type": "cargo", + "properties": { + "subcommand": { + "type": "string" + } + }, + "required": [ + "subcommand" + ] + } + ], + "problemMatchers": [ + { + "name": "rustc", + "owner": "rust", + "fileLocation": [ + "relative", + "${workspaceRoot}" + ], + "pattern": [ + { + "regexp": "^(warning|warn|error)(\\[(.*)\\])?: (.*)$", + "severity": 1, + "message": 4, + "code": 3 + }, + { + "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", + "file": 2, + "line": 3, + "column": 4 + }, + { + "regexp": "^.*$" + }, + { + "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", + "file": 2, + "line": 3, + "column": 4 + } + ] + } + ], "configuration": { "type": "object", "title": "Rust configuration", @@ -407,4 +419,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/extension.ts b/src/extension.ts index 6b86403a..6b16d617 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,7 +1,6 @@ import * as child_process from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; -import * as vscode from 'vscode'; import { LanguageClient, LanguageClientOptions, @@ -9,6 +8,19 @@ import { ServerOptions, } from 'vscode-languageclient'; +import { + commands, + Disposable, + ExtensionContext, + IndentAction, + languages, + TextDocument, + Uri, + window, + workspace, + WorkspaceFolder, + WorkspaceFoldersChangeEvent, +} from 'vscode'; import { RLSConfiguration } from './configuration'; import { SignatureHelpProvider } from './providers/signatureHelpProvider'; import { Decorator } from './providers/typeAnnotationsProvider'; @@ -30,26 +42,32 @@ interface ProgressParams { done?: boolean; } -export async function activate(context: vscode.ExtensionContext) { +export async function activate(context: ExtensionContext) { context.subscriptions.push(configureLanguage()); - vscode.workspace.onDidOpenTextDocument(doc => - didOpenTextDocument(doc, context), - ); - vscode.workspace.textDocuments.forEach(doc => - didOpenTextDocument(doc, context), - ); - vscode.workspace.onDidChangeWorkspaceFolders(e => + workspace.onDidOpenTextDocument(doc => didOpenTextDocument(doc, context)); + workspace.textDocuments.forEach(doc => didOpenTextDocument(doc, context)); + workspace.onDidChangeWorkspaceFolders(e => didChangeWorkspaceFolders(e, context), ); - vscode.window.onDidChangeVisibleTextEditors(editors => { - const decorator = Decorator.getInstance()!; + window.onDidChangeVisibleTextEditors(editors => { + const decorator = Decorator.getInstance(); + if (decorator === undefined) { + return; + } for (const editor of editors) { decorator.decorate(editor); } }); - vscode.window.onDidChangeActiveTextEditor(editor => { - Decorator.getInstance()!.decorate(editor!); + window.onDidChangeActiveTextEditor(editor => { + if (editor === undefined) { + return; + } + const decorator = Decorator.getInstance(); + if (decorator === undefined) { + return; + } + decorator.decorate(editor); }); } @@ -59,20 +77,20 @@ export async function deactivate() { // Taken from https://github.com/Microsoft/vscode-extension-samples/blob/master/lsp-multi-server-sample/client/src/extension.ts function didOpenTextDocument( - document: vscode.TextDocument, - context: vscode.ExtensionContext, + document: TextDocument, + context: ExtensionContext, ) { if (document.languageId !== 'rust' && document.languageId !== 'toml') { return; } const uri = document.uri; - let folder = vscode.workspace.getWorkspaceFolder(uri); + let folder = workspace.getWorkspaceFolder(uri); if (!folder) { return; } if ( - vscode.workspace + workspace .getConfiguration() .get('rust-client.nestedMultiRootConfigInOutermost', true) ) { @@ -96,8 +114,8 @@ function didOpenTextDocument( let _sortedWorkspaceFolders: string[] | undefined; function sortedWorkspaceFolders(): string[] { - if (!_sortedWorkspaceFolders && vscode.workspace.workspaceFolders) { - _sortedWorkspaceFolders = vscode.workspace.workspaceFolders + if (!_sortedWorkspaceFolders && workspace.workspaceFolders) { + _sortedWorkspaceFolders = workspace.workspaceFolders .map(folder => { let result = folder.uri.toString(); if (result.charAt(result.length - 1) !== '/') { @@ -144,9 +162,7 @@ function sortedWorkspaceFolders(): string[] { // return cur_workspace; // } -function getOuterMostWorkspaceFolder( - folder: vscode.WorkspaceFolder, -): vscode.WorkspaceFolder { +function getOuterMostWorkspaceFolder(folder: WorkspaceFolder): WorkspaceFolder { const sorted = sortedWorkspaceFolders(); for (const element of sorted) { let uri = folder.uri.toString(); @@ -154,17 +170,15 @@ function getOuterMostWorkspaceFolder( uri = uri + '/'; } if (uri.startsWith(element)) { - return ( - vscode.workspace.getWorkspaceFolder(vscode.Uri.parse(element)) || folder - ); + return workspace.getWorkspaceFolder(Uri.parse(element)) || folder; } } return folder; } function didChangeWorkspaceFolders( - e: vscode.WorkspaceFoldersChangeEvent, - context: vscode.ExtensionContext, + e: WorkspaceFoldersChangeEvent, + context: ExtensionContext, ) { _sortedWorkspaceFolders = undefined; @@ -195,7 +209,7 @@ function didChangeWorkspaceFolders( } } -const workspaces: Map = new Map(); +const workspaces: Map = new Map(); // We run one RLS and one corresponding language client per workspace folder // (VSCode workspace, not Cargo workspace). This class contains all the per-client @@ -205,17 +219,16 @@ class ClientWorkspace { // handle possible `rust-client.*` value changes while extension is running private readonly config: RLSConfiguration; private lc: LanguageClient | null = null; - private readonly folder: vscode.WorkspaceFolder; - private disposables: vscode.Disposable[]; - private decorator: Decorator | null = null; + private readonly folder: WorkspaceFolder; + private disposables: Disposable[]; - constructor(folder: vscode.WorkspaceFolder) { + constructor(folder: WorkspaceFolder) { this.config = RLSConfiguration.loadFromWorkspace(folder.uri.fsPath); this.folder = folder; this.disposables = []; } - public async start(context: vscode.ExtensionContext) { + public async start(context: ExtensionContext) { warnOnMissingCargoToml(); startSpinner('RLS', 'Starting'); @@ -244,14 +257,14 @@ class ClientWorkspace { // Changes paths between Windows and Windows Subsystem for Linux if (this.config.useWSL) { clientOptions.uriConverters = { - code2Protocol: (uri: vscode.Uri) => { - const res = vscode.Uri.file(uriWindowsToWsl(uri.fsPath)).toString(); + code2Protocol: (uri: Uri) => { + const res = Uri.file(uriWindowsToWsl(uri.fsPath)).toString(); console.log(`code2Protocol for path ${uri.fsPath} -> ${res}`); return res; }, protocol2Code: (wslUri: string) => { - const urlDecodedPath = vscode.Uri.parse(wslUri).path; - const winPath = vscode.Uri.file(uriWslToWindows(urlDecodedPath)); + const urlDecodedPath = Uri.parse(wslUri).path; + const winPath = Uri.file(uriWslToWindows(urlDecodedPath)); console.log(`protocol2Code for path ${wslUri} -> ${winPath.fsPath}`); return winPath; }, @@ -266,15 +279,15 @@ class ClientWorkspace { clientOptions, ); - this.decorator = new Decorator(this.lc); + Decorator.getInstance(this.lc); this.setupProgressCounter(); this.registerCommands(context); this.disposables.push(activateTaskProvider(this.folder)); this.disposables.push(this.lc.start()); this.disposables.push( - vscode.languages.registerSignatureHelpProvider( - { language: 'rust' }, + languages.registerSignatureHelpProvider( + { language: 'rust', scheme: 'file' }, new SignatureHelpProvider(this.lc), '(', ',', @@ -290,12 +303,12 @@ class ClientWorkspace { this.disposables.forEach(d => d.dispose()); } - private registerCommands(context: vscode.ExtensionContext) { + private registerCommands(context: ExtensionContext) { if (!this.lc) { return; } - const rustupUpdateDisposable = vscode.commands.registerCommand( + const rustupUpdateDisposable = commands.registerCommand( 'rls.update', () => { return rustupUpdate(this.config.rustupConfig()); @@ -303,17 +316,14 @@ class ClientWorkspace { ); this.disposables.push(rustupUpdateDisposable); - const restartServer = vscode.commands.registerCommand( - 'rls.restart', - async () => { - await this.stop(); - return this.start(context); - }, - ); + const restartServer = commands.registerCommand('rls.restart', async () => { + await this.stop(); + return this.start(context); + }); this.disposables.push(restartServer); this.disposables.push( - vscode.commands.registerCommand('rls.run', (cmd: Execution) => + commands.registerCommand('rls.run', (cmd: Execution) => runRlsCommand(this.folder, cmd), ), ); @@ -332,9 +342,10 @@ class ClientWorkspace { progress => { if (progress.done) { runningProgress.delete(progress.id); - if (this.decorator) { - for (const editor of vscode.window.visibleTextEditors) { - this.decorator.decorate(editor); + const decorator = Decorator.getInstance(); + if (decorator !== undefined) { + for (const editor of window.visibleTextEditors) { + decorator.decorate(editor); } } } else { @@ -397,7 +408,7 @@ class ClientWorkspace { sysroot = await this.getSysroot(env); } catch (e) { console.warn('Error reading sysroot (second try)', e); - vscode.window.showWarningMessage(`Error reading sysroot: ${e.message}`); + window.showWarningMessage(`Error reading sysroot: ${e.message}`); return env; } } @@ -459,9 +470,7 @@ class ClientWorkspace { childProcess.on('error', (err: { code?: string; message: string }) => { if (err.code === 'ENOENT') { console.error(`Could not spawn RLS: ${err.message}`); - vscode.window.showWarningMessage( - `Could not spawn RLS: \`${err.message}\``, - ); + window.showWarningMessage(`Could not spawn RLS: \`${err.message}\``); } }); @@ -482,10 +491,10 @@ class ClientWorkspace { } async function warnOnMissingCargoToml() { - const files = await vscode.workspace.findFiles('Cargo.toml'); + const files = await workspace.findFiles('Cargo.toml'); if (files.length < 1) { - vscode.window.showWarningMessage( + window.showWarningMessage( 'A Cargo.toml file must be at the root of the workspace in order to support all features', ); } @@ -497,20 +506,20 @@ async function warnOnMissingCargoToml() { * * [1]: https://github.com/Microsoft/vscode/issues/11514#issuecomment-244707076 */ -function configureLanguage(): vscode.Disposable { - return vscode.languages.setLanguageConfiguration('rust', { +function configureLanguage(): Disposable { + return languages.setLanguageConfiguration('rust', { onEnterRules: [ { // Doc single-line comment // e.g. ///| beforeText: /^\s*\/{3}.*$/, - action: { indentAction: vscode.IndentAction.None, appendText: '/// ' }, + action: { indentAction: IndentAction.None, appendText: '/// ' }, }, { // Parent doc single-line comment // e.g. //!| beforeText: /^\s*\/{2}\!.*$/, - action: { indentAction: vscode.IndentAction.None, appendText: '//! ' }, + action: { indentAction: IndentAction.None, appendText: '//! ' }, }, { // Begins an auto-closed multi-line comment (standard or parent doc) @@ -518,7 +527,7 @@ function configureLanguage(): vscode.Disposable { beforeText: /^\s*\/\*(\*|\!)(?!\/)([^\*]|\*(?!\/))*$/, afterText: /^\s*\*\/$/, action: { - indentAction: vscode.IndentAction.IndentOutdent, + indentAction: IndentAction.IndentOutdent, appendText: ' * ', }, }, @@ -526,19 +535,19 @@ function configureLanguage(): vscode.Disposable { // Begins a multi-line comment (standard or parent doc) // e.g. /** ...| or /*! ...| beforeText: /^\s*\/\*(\*|\!)(?!\/)([^\*]|\*(?!\/))*$/, - action: { indentAction: vscode.IndentAction.None, appendText: ' * ' }, + action: { indentAction: IndentAction.None, appendText: ' * ' }, }, { // Continues a multi-line comment // e.g. * ...| beforeText: /^(\ \ )*\ \*(\ ([^\*]|\*(?!\/))*)?$/, - action: { indentAction: vscode.IndentAction.None, appendText: '* ' }, + action: { indentAction: IndentAction.None, appendText: '* ' }, }, { // Dedents after closing a multi-line comment // e.g. */| beforeText: /^(\ \ )*\ \*\/\s*$/, - action: { indentAction: vscode.IndentAction.None, removeText: 1 }, + action: { indentAction: IndentAction.None, removeText: 1 }, }, ], }); diff --git a/src/providers/typeAnnotationsProvider.ts b/src/providers/typeAnnotationsProvider.ts index 7608ce3f..5f33c5f9 100644 --- a/src/providers/typeAnnotationsProvider.ts +++ b/src/providers/typeAnnotationsProvider.ts @@ -1,4 +1,5 @@ 'use strict'; +import { Mutex } from 'async-mutex'; import * as vscode from 'vscode'; import { HoverRequest, LanguageClient } from 'vscode-languageclient'; @@ -96,66 +97,86 @@ function get_next_position( export class Decorator { private static instance?: Decorator; private lc: LanguageClient; + private mutex: Mutex = new Mutex(); - public constructor(lc: LanguageClient) { + constructor(lc: LanguageClient) { this.lc = lc; - Decorator.instance = this; } - public static getInstance(): Decorator | undefined { + public static getInstance(lc?: LanguageClient): Decorator | undefined { + if (lc !== undefined) { + if (Decorator.instance === undefined) { + Decorator.instance = new Decorator(lc); + } else { + Decorator.instance.mutex.acquire().then(release => { + if (Decorator.instance) { + Decorator.instance.lc = lc; + } + release(); + }); + } + } return Decorator.instance; } - public async decorate(editor: vscode.TextEditor) { + public async decorate(editor: vscode.TextEditor): Promise { if (!editor.document.uri.toString().endsWith('.rs')) { return; } - const text = editor.document.getText(); - const lines = text.split('\n'); - const declarationPositions: vscode.Position[] = []; - for (let i = 0; i < lines.length; i++) { - let line = lines[i].split('//')[0]; - if (line.trim().startsWith('impl')) { - continue; - } - let newPositions: vscode.Position[] = []; - let count = 0; - do { - newPositions = get_next_position(i, line, count); - for (const position of newPositions) { - declarationPositions.push(position); - } - const last = newPositions[newPositions.length - 1]; - if (last) { - line = line.substr(last.character); - count += last.character; + const mutexRelease = await this.mutex.acquire(); + console.log('DECORATING'); + try { + const text = editor.document.getText(); + const lines = text.split('\n'); + const declarationPositions: vscode.Position[] = []; + for (let i = 0; i < lines.length; i++) { + let line = lines[i].split('//')[0].split('#')[0]; + if (line.trim().startsWith('impl')) { + continue; } - } while (newPositions.length > 0); - } - const hints: vscode.DecorationOptions[] = []; - for (const position of declarationPositions) { - const hover = await this.lc.sendRequest( - HoverRequest.type, - this.lc.code2ProtocolConverter.asTextDocumentPositionParams( - editor.document, - position.translate(0, -1), - ), - ); - if (hover) { - let hint = ': '; - const content = hover.contents; + let newPositions: vscode.Position[] = []; + let count = 0; + do { + newPositions = get_next_position(i, line, count); + for (const position of newPositions) { + declarationPositions.push(position); + } + const last = newPositions[newPositions.length - 1]; + if (last) { + line = line.substr(last.character); + count += last.character; + } + } while (newPositions.length > 0); + } + const hints: vscode.DecorationOptions[] = []; + for (const position of declarationPositions) { try { - // @ts-ignore - hint += content[0].value; + const hover = await this.lc.sendRequest( + HoverRequest.type, + this.lc.code2ProtocolConverter.asTextDocumentPositionParams( + editor.document, + position.translate(0, -1), + ), + ); + if (hover) { + const content = hover.contents; + // @ts-ignore + const hint = ': ' + content[0].value; + hints.push({ + range: new vscode.Range(position, position), + renderOptions: { after: { contentText: hint } }, + }); + } } catch (e) { continue; } - hints.push({ - range: new vscode.Range(position, position), - renderOptions: { after: { contentText: hint } }, - }); } + editor.setDecorations(typeHintDecorationType, hints); + console.log('DONE: ' + hints.length + ' decorations provided'); + } catch (e) { + console.log('FAILED: '); + console.log(e); } - editor.setDecorations(typeHintDecorationType, hints); + mutexRelease(); } } From 460a9ee10d577ace1bc5c92059af2c3ec1cb950b Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Fri, 10 May 2019 14:07:12 +0200 Subject: [PATCH 05/13] small changes --- src/extension.ts | 13 +++---------- src/providers/typeAnnotationsProvider.ts | 4 ++-- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 6b16d617..44e0a394 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -50,23 +50,15 @@ export async function activate(context: ExtensionContext) { workspace.onDidChangeWorkspaceFolders(e => didChangeWorkspaceFolders(e, context), ); - window.onDidChangeVisibleTextEditors(editors => { - const decorator = Decorator.getInstance(); - if (decorator === undefined) { - return; - } - for (const editor of editors) { - decorator.decorate(editor); - } - }); window.onDidChangeActiveTextEditor(editor => { - if (editor === undefined) { + if (editor === undefined || editor === null) { return; } const decorator = Decorator.getInstance(); if (decorator === undefined) { return; } + console.log('Attempting to decorate after editor change.'); decorator.decorate(editor); }); } @@ -344,6 +336,7 @@ class ClientWorkspace { runningProgress.delete(progress.id); const decorator = Decorator.getInstance(); if (decorator !== undefined) { + console.log('Starting Decoration after progress.done'); for (const editor of window.visibleTextEditors) { decorator.decorate(editor); } diff --git a/src/providers/typeAnnotationsProvider.ts b/src/providers/typeAnnotationsProvider.ts index 5f33c5f9..587e4a53 100644 --- a/src/providers/typeAnnotationsProvider.ts +++ b/src/providers/typeAnnotationsProvider.ts @@ -120,11 +120,11 @@ export class Decorator { } public async decorate(editor: vscode.TextEditor): Promise { - if (!editor.document.uri.toString().endsWith('.rs')) { + if (editor.document.languageId !== 'rust') { return; } const mutexRelease = await this.mutex.acquire(); - console.log('DECORATING'); + console.log('DECORATING: ' + editor.document.uri.toString()); try { const text = editor.document.getText(); const lines = text.split('\n'); From a50f2dc49822dc3d589bb50618611f044ca0056f Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Fri, 10 May 2019 16:58:47 +0200 Subject: [PATCH 06/13] fixed exceedingly slow parsing of match arms --- src/providers/typeAnnotationsProvider.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/providers/typeAnnotationsProvider.ts b/src/providers/typeAnnotationsProvider.ts index 587e4a53..ef116a00 100644 --- a/src/providers/typeAnnotationsProvider.ts +++ b/src/providers/typeAnnotationsProvider.ts @@ -80,15 +80,17 @@ function get_next_position( } return declarationPositions; } - const matchArm = substring.match(MATCH_CASE); - if (matchArm && matchArm.index) { - for (const character of unpack_arguments(matchArm[0].substr(1))) { - declarationPositions.push( - new vscode.Position( - lineNumber, - currentCharCount + matchArm.index + 1 + character, - ), - ); + if (substring.includes('=>')) { + const matchArm = substring.match(MATCH_CASE); + if (matchArm && matchArm.index) { + for (const character of unpack_arguments(matchArm[0].substr(1))) { + declarationPositions.push( + new vscode.Position( + lineNumber, + currentCharCount + matchArm.index + 1 + character, + ), + ); + } } } return declarationPositions; From 525b8fa3ef68b6325961da28a51f0574fc75f906 Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Fri, 10 May 2019 19:22:30 +0200 Subject: [PATCH 07/13] Removed useless mutex and changed Decoration Style slightly --- package.json | 124 ++++++++++------------- src/providers/typeAnnotationsProvider.ts | 18 +--- 2 files changed, 61 insertions(+), 81 deletions(-) diff --git a/package.json b/package.json index 313c4771..b3c9ba15 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,7 @@ "installDevExtension": "npm install && ./node_modules/.bin/vsce package -o ./out/rls-vscode-dev.vsix && code --install-extension ./out/rls-vscode-dev.vsix" }, "dependencies": { - "vscode-languageclient": "^4.3.0", - "async-mutex": "0.1.3" + "vscode-languageclient": "^4.3.0" }, "devDependencies": { "@types/mocha": "^2.2.43", @@ -65,8 +64,7 @@ "vscode": "^1.1.34" }, "contributes": { - "colors": [ - { + "colors": [{ "id": "rust.typeHintColor", "description": "Specifies the foreground color of a type hint", "defaults": { @@ -85,23 +83,18 @@ } } ], - "languages": [ - { - "id": "rust", - "extensions": [ - ".rs" - ], - "configuration": "./language-configuration.json" - } - ], - "snippets": [ - { - "language": "rust", - "path": "./snippets/rust.json" - } - ], - "commands": [ - { + "languages": [{ + "id": "rust", + "extensions": [ + ".rs" + ], + "configuration": "./language-configuration.json" + }], + "snippets": [{ + "language": "rust", + "path": "./snippets/rust.json" + }], + "commands": [{ "command": "rls.update", "title": "Update the RLS", "description": "Use Rustup to update Rust, the RLS, and required data", @@ -114,52 +107,47 @@ "category": "Rust" } ], - "taskDefinitions": [ - { - "type": "cargo", - "properties": { - "subcommand": { - "type": "string" - } - }, - "required": [ - "subcommand" - ] - } - ], - "problemMatchers": [ - { - "name": "rustc", - "owner": "rust", - "fileLocation": [ - "relative", - "${workspaceRoot}" - ], - "pattern": [ - { - "regexp": "^(warning|warn|error)(\\[(.*)\\])?: (.*)$", - "severity": 1, - "message": 4, - "code": 3 - }, - { - "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", - "file": 2, - "line": 3, - "column": 4 - }, - { - "regexp": "^.*$" - }, - { - "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", - "file": 2, - "line": 3, - "column": 4 - } - ] - } - ], + "taskDefinitions": [{ + "type": "cargo", + "properties": { + "subcommand": { + "type": "string" + } + }, + "required": [ + "subcommand" + ] + }], + "problemMatchers": [{ + "name": "rustc", + "owner": "rust", + "fileLocation": [ + "relative", + "${workspaceRoot}" + ], + "pattern": [{ + "regexp": "^(warning|warn|error)(\\[(.*)\\])?: (.*)$", + "severity": 1, + "message": 4, + "code": 3 + }, + { + "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", + "file": 2, + "line": 3, + "column": 4 + }, + { + "regexp": "^.*$" + }, + { + "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", + "file": 2, + "line": 3, + "column": 4 + } + ] + }], "configuration": { "type": "object", "title": "Rust configuration", @@ -419,4 +407,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/providers/typeAnnotationsProvider.ts b/src/providers/typeAnnotationsProvider.ts index ef116a00..a5331b6a 100644 --- a/src/providers/typeAnnotationsProvider.ts +++ b/src/providers/typeAnnotationsProvider.ts @@ -1,10 +1,8 @@ -'use strict'; -import { Mutex } from 'async-mutex'; import * as vscode from 'vscode'; import { HoverRequest, LanguageClient } from 'vscode-languageclient'; const typeHintDecorationType = vscode.window.createTextEditorDecorationType({ - after: { + before: { color: new vscode.ThemeColor('rust.typeHintColor'), backgroundColor: new vscode.ThemeColor('rust.typeHintBackgroundColor'), }, @@ -99,7 +97,6 @@ function get_next_position( export class Decorator { private static instance?: Decorator; private lc: LanguageClient; - private mutex: Mutex = new Mutex(); constructor(lc: LanguageClient) { this.lc = lc; @@ -110,12 +107,9 @@ export class Decorator { if (Decorator.instance === undefined) { Decorator.instance = new Decorator(lc); } else { - Decorator.instance.mutex.acquire().then(release => { - if (Decorator.instance) { - Decorator.instance.lc = lc; - } - release(); - }); + if (Decorator.instance) { + Decorator.instance.lc = lc; + } } } return Decorator.instance; @@ -125,7 +119,6 @@ export class Decorator { if (editor.document.languageId !== 'rust') { return; } - const mutexRelease = await this.mutex.acquire(); console.log('DECORATING: ' + editor.document.uri.toString()); try { const text = editor.document.getText(); @@ -166,7 +159,7 @@ export class Decorator { const hint = ': ' + content[0].value; hints.push({ range: new vscode.Range(position, position), - renderOptions: { after: { contentText: hint } }, + renderOptions: { before: { contentText: hint } }, }); } } catch (e) { @@ -179,6 +172,5 @@ export class Decorator { console.log('FAILED: '); console.log(e); } - mutexRelease(); } } From abdc7ff00acd4c345c0920527a05c3ac4b71b197 Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Mon, 13 May 2019 09:54:15 +0200 Subject: [PATCH 08/13] add typename shortener. --- src/providers/typeNameShortener.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/providers/typeNameShortener.ts diff --git a/src/providers/typeNameShortener.ts b/src/providers/typeNameShortener.ts new file mode 100644 index 00000000..2c381e85 --- /dev/null +++ b/src/providers/typeNameShortener.ts @@ -0,0 +1,28 @@ + +function splitSingleBracketLevel(str: string, brackets: string='{}', delimiter=','): string[]{ + const result: string[] = []; + const bracket_start = bracket_start[0] + const bracket_end = brackets[brackets.length-1]; + let count = 0; + let latest_delimiter = 0; + for (let i = 0; i < str.length; i++) { + switch (str[i]) { + case bracket_start: + if (count === 0) {latest_delimiter = i+1;} + count++; + break; + case bracket_end: + count--; + case delimiter: + if (count <= 1) { + result.push(str.substring(latest_delimiter, i + 1)) + } + } + } + return result; +} + +export class FullType { + protected name: string; + protected chidren: FullType[]; +} From 29935d8040393eb3800358198de08fea42994cbd Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Mon, 13 May 2019 12:41:58 +0200 Subject: [PATCH 09/13] Typename shortening added --- src/providers/typeAnnotationsProvider.ts | 10 +- src/providers/typeNameShortener.ts | 127 +++++++++++++++++++---- 2 files changed, 110 insertions(+), 27 deletions(-) diff --git a/src/providers/typeAnnotationsProvider.ts b/src/providers/typeAnnotationsProvider.ts index a5331b6a..e0efc05d 100644 --- a/src/providers/typeAnnotationsProvider.ts +++ b/src/providers/typeAnnotationsProvider.ts @@ -1,5 +1,6 @@ import * as vscode from 'vscode'; import { HoverRequest, LanguageClient } from 'vscode-languageclient'; +import { FullType, GreedySimplifier } from './typeNameShortener'; const typeHintDecorationType = vscode.window.createTextEditorDecorationType({ before: { @@ -119,7 +120,6 @@ export class Decorator { if (editor.document.languageId !== 'rust') { return; } - console.log('DECORATING: ' + editor.document.uri.toString()); try { const text = editor.document.getText(); const lines = text.split('\n'); @@ -156,7 +156,9 @@ export class Decorator { if (hover) { const content = hover.contents; // @ts-ignore - const hint = ': ' + content[0].value; + const simplified = content[0].value; + const type = new FullType(simplified); + const hint = ': ' + GreedySimplifier.simplify(type).stringify(); hints.push({ range: new vscode.Range(position, position), renderOptions: { before: { contentText: hint } }, @@ -167,10 +169,8 @@ export class Decorator { } } editor.setDecorations(typeHintDecorationType, hints); - console.log('DONE: ' + hints.length + ' decorations provided'); } catch (e) { - console.log('FAILED: '); - console.log(e); + return; } } } diff --git a/src/providers/typeNameShortener.ts b/src/providers/typeNameShortener.ts index 2c381e85..5c083c6b 100644 --- a/src/providers/typeNameShortener.ts +++ b/src/providers/typeNameShortener.ts @@ -1,28 +1,111 @@ - -function splitSingleBracketLevel(str: string, brackets: string='{}', delimiter=','): string[]{ - const result: string[] = []; - const bracket_start = bracket_start[0] - const bracket_end = brackets[brackets.length-1]; - let count = 0; - let latest_delimiter = 0; - for (let i = 0; i < str.length; i++) { - switch (str[i]) { - case bracket_start: - if (count === 0) {latest_delimiter = i+1;} - count++; - break; - case bracket_end: - count--; - case delimiter: - if (count <= 1) { - result.push(str.substring(latest_delimiter, i + 1)) - } +function splitSingleBracketLevel( + str: string, + brackets: string = '{}', + delimiter = ',', + level = 1, +): string[] { + const result: string[] = []; + const bracketStart = brackets[0]; + const bracketEnd = brackets[brackets.length - 1]; + let count = 0; + let latestDelimiter = 0; + for (let i = 0; i < str.length; i++) { + switch (str[i]) { + case bracketStart: + count++; + if (count === level) { + latestDelimiter = i + 1; + } + break; + case bracketEnd: + count--; + if (count === level - 1) { + result.push(str.substring(latestDelimiter, i)); + latestDelimiter = i + 1; + return result; + } + break; + case delimiter: + if (count === level) { + result.push(str.substring(latestDelimiter, i)); + latestDelimiter = i + 1; } } - return result; + } + const end = str.substring(latestDelimiter); + if (end.length > 0) { + result.push(end); + } + return result; } +class SemiFullType { + public name: string; + public children: FullType[]; + public constructor(name: string, children: FullType[] = []) { + this.name = name; + this.children = children; + } + + public stringify(): string { + return ( + this.name + + (this.children.length === 0 + ? '' + : '<' + this.children.map(child => child.stringify()).join(', ') + '>') + ); + } +} + +// tslint:disable-next-line: max-classes-per-file export class FullType { - protected name: string; - protected chidren: FullType[]; + public parts: SemiFullType[] = []; + + public constructor(parseable: string) { + if (parseable === '') { + return; + } + const typeParts = splitSingleBracketLevel(parseable, '<>', '+', 0); + for (const typePart of typeParts) { + let index: number | undefined = typePart.indexOf('<'); + index = index < 0 ? undefined : index; + const prefix = typePart.substring(0, index); + const args = index !== undefined ? typePart.substring(index) : ''; + const part: SemiFullType = new SemiFullType(prefix.trim()); + const childrenStr = splitSingleBracketLevel(args, '<>'); + for (const childStr of childrenStr) { + part.children.push(new FullType(childStr)); + } + this.parts.push(part); + } + } + + public stringify(): string { + return this.parts.map(part => part.stringify()).join(' + '); + } +} + +// tslint:disable-next-line: max-classes-per-file +export class GreedySimplifier { + protected static prefixRegex: RegExp = /(&(mut)?\s*)/; + + public static simplify(fullType: FullType): FullType { + const returnValue: FullType = new FullType(''); + for (const part of fullType.parts) { + if (part.name.startsWith("'")) { + continue; + } + const prefixOption = part.name.match(GreedySimplifier.prefixRegex); + const prefix = prefixOption !== null ? prefixOption[0] : ''; + const nameSplit = part.name.substring(prefix.length).split('::'); + const semiType: SemiFullType = new SemiFullType( + prefix + nameSplit[nameSplit.length - 1], + ); + for (const subType of part.children) { + semiType.children.push(this.simplify(subType)); + } + returnValue.parts.push(semiType); + } + return returnValue; + } } From ff8da6fb7c936d075f89c51a1239fa848bfe4173 Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Mon, 13 May 2019 16:18:46 +0200 Subject: [PATCH 10/13] Smarter shortening, configuration options added --- package-lock.json | 5 -- package.json | 19 +++++++ src/providers/typeAnnotationsProvider.ts | 31 +++++++++-- src/providers/typeNameShortener.ts | 66 ++++++++++++++++++++---- 4 files changed, 102 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 84613d91..9074f82e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,11 +76,6 @@ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true }, - "async-mutex": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.1.3.tgz", - "integrity": "sha1-Cq0hEjaXlas/F+M3RFVtLs9UdWY=" - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", diff --git a/package.json b/package.json index b3c9ba15..7f26e2a9 100644 --- a/package.json +++ b/package.json @@ -403,6 +403,25 @@ "default": true, "description": "Show additional context in hover tooltips when available. This is often the type local variable declaration.", "scope": "resource" + }, + "rust-type_hints.enable": { + "type": "boolean", + "default": true, + "desciption": "Show type hints", + "scope": "resource" + }, + "rust-type_hints.max_length": { + "type": "integer", + "default": 40, + "desciption": "Maximum length of type hints", + "scope": "resource" + }, + "rust-type_hints.shortening": { + "type": "string", + "enum": ["greedy", "none"], + "default": "greedy", + "desciption": "\"greedy\" will remove all namespace parts from type names, as well as lifetime specifiers, from the hints", + "scope": "resource" } } } diff --git a/src/providers/typeAnnotationsProvider.ts b/src/providers/typeAnnotationsProvider.ts index e0efc05d..0d20cce1 100644 --- a/src/providers/typeAnnotationsProvider.ts +++ b/src/providers/typeAnnotationsProvider.ts @@ -95,6 +95,16 @@ function get_next_position( return declarationPositions; } +const SHORTENER_REGEX = /<[^<]*?(<\.\.\.>)?[^<]*?>/; +const ENABLED = vscode.workspace + .getConfiguration() + .get('rust-type_hints.enabled', true); +const MAX_LENGTH = vscode.workspace + .getConfiguration() + .get('rust-type_hints.max_length', 40); +const SHORTENER = vscode.workspace + .getConfiguration() + .get('rust-type_hints.shortening', 'greedy'); export class Decorator { private static instance?: Decorator; private lc: LanguageClient; @@ -117,7 +127,7 @@ export class Decorator { } public async decorate(editor: vscode.TextEditor): Promise { - if (editor.document.languageId !== 'rust') { + if (editor.document.languageId !== 'rust' || !ENABLED) { return; } try { @@ -158,10 +168,25 @@ export class Decorator { // @ts-ignore const simplified = content[0].value; const type = new FullType(simplified); - const hint = ': ' + GreedySimplifier.simplify(type).stringify(); + let hint = ''; + switch (SHORTENER) { + case 'none': + hint = type.stringify(); + break; + case 'greedy': + hint = GreedySimplifier.simplify(type).stringify(); + break; + } + while (hint.length > MAX_LENGTH) { + const replacement = hint.replace(SHORTENER_REGEX, '<...>'); + if (replacement === hint) { + break; + } + hint = replacement; + } hints.push({ range: new vscode.Range(position, position), - renderOptions: { before: { contentText: hint } }, + renderOptions: { before: { contentText: ': ' + hint } }, }); } } catch (e) { diff --git a/src/providers/typeNameShortener.ts b/src/providers/typeNameShortener.ts index 5c083c6b..a3914a66 100644 --- a/src/providers/typeNameShortener.ts +++ b/src/providers/typeNameShortener.ts @@ -30,6 +30,12 @@ function splitSingleBracketLevel( result.push(str.substring(latestDelimiter, i)); latestDelimiter = i + 1; } + break; + case '[': + count++; + break; + case ']': + count--; } } const end = str.substring(latestDelimiter); @@ -39,20 +45,49 @@ function splitSingleBracketLevel( return result; } +function getPostFix(str: string, brackets = '<>'): string { + let count = 0; + const bracketStart = brackets[0]; + const bracketEnd = brackets[brackets.length - 1]; + for (let i = 0; i < str.length; i++) { + switch (str[i]) { + case bracketStart: + count++; + break; + case bracketEnd: + count--; + if (count === 0) { + return str.substring(i + 1); + } + break; + } + } + return ''; +} + class SemiFullType { - public name: string; + public prefix: string; + public postfix: string; public children: FullType[]; - public constructor(name: string, children: FullType[] = []) { - this.name = name; + public constructor( + prefix: string, + postfix: string, + children: FullType[] = [], + ) { + this.prefix = prefix; + this.postfix = postfix; this.children = children; } public stringify(): string { return ( - this.name + + this.prefix + (this.children.length === 0 ? '' - : '<' + this.children.map(child => child.stringify()).join(', ') + '>') + : '<' + + this.children.map(child => child.stringify()).join(', ') + + '>') + + this.postfix ); } } @@ -71,9 +106,13 @@ export class FullType { index = index < 0 ? undefined : index; const prefix = typePart.substring(0, index); const args = index !== undefined ? typePart.substring(index) : ''; - const part: SemiFullType = new SemiFullType(prefix.trim()); + const postfix = getPostFix(args); + const part: SemiFullType = new SemiFullType(prefix.trim(), postfix); const childrenStr = splitSingleBracketLevel(args, '<>'); - for (const childStr of childrenStr) { + for (let childStr of childrenStr) { + if (childStr.trim().startsWith('[closure@')) { + childStr = '[closure]'; + } part.children.push(new FullType(childStr)); } this.parts.push(part); @@ -92,14 +131,19 @@ export class GreedySimplifier { public static simplify(fullType: FullType): FullType { const returnValue: FullType = new FullType(''); for (const part of fullType.parts) { - if (part.name.startsWith("'")) { + if (part.prefix.startsWith("'")) { continue; } - const prefixOption = part.name.match(GreedySimplifier.prefixRegex); + const prefixOption = part.prefix.match(GreedySimplifier.prefixRegex); const prefix = prefixOption !== null ? prefixOption[0] : ''; - const nameSplit = part.name.substring(prefix.length).split('::'); + const nameSplit = part.prefix.substring(prefix.length).split('::'); const semiType: SemiFullType = new SemiFullType( - prefix + nameSplit[nameSplit.length - 1], + prefix + + (part.prefix.includes(' as ') + ? part.prefix.split(' as ')[0] + ' as ' + : '') + + nameSplit[nameSplit.length - 1], + part.postfix, ); for (const subType of part.children) { semiType.children.push(this.simplify(subType)); From e9df4b7b0b7029afdcf3a85ccfb4a906d7d22c16 Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Wed, 22 May 2019 01:19:14 +0200 Subject: [PATCH 11/13] type hints refreshed better and with more sparsity --- src/extension.ts | 7 +++++++ src/providers/typeAnnotationsProvider.ts | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 44e0a394..57ef54df 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -61,6 +61,13 @@ export async function activate(context: ExtensionContext) { console.log('Attempting to decorate after editor change.'); decorator.decorate(editor); }); + workspace.onDidChangeTextDocument(textDocumentChange => { + for (const editor of window.visibleTextEditors) { + if (editor.document === textDocumentChange.document) { + Decorator.getInstance()!.decorate(editor); + } + } + }); } export async function deactivate() { diff --git a/src/providers/typeAnnotationsProvider.ts b/src/providers/typeAnnotationsProvider.ts index 0d20cce1..7afbe682 100644 --- a/src/providers/typeAnnotationsProvider.ts +++ b/src/providers/typeAnnotationsProvider.ts @@ -10,7 +10,7 @@ const typeHintDecorationType = vscode.window.createTextEditorDecorationType({ }); const MULTIPLE_DECLARATIONS = '(&?(mut\\s+)?\\w+(\\s*:\\s*\\w+)?\\s*,?\\s*)+'; -const SIMPLE_DECLARATION = /(let|for)(\s+mut)?\s+(\w+)[ :=]/; +const SIMPLE_DECLARATION = /((let|for)(\s+mut)?\s+(\w+))\s*[=;]/; const TUPLE_UNPACKING: RegExp = new RegExp( '(let\\s+|for\\s+|if let[^=]+)(\\(' + MULTIPLE_DECLARATIONS + '\\))', ); @@ -28,7 +28,7 @@ function unpack_arguments(line: string): number[] { let count = 0; for (const arg of args) { const inner = arg.match(INNER_DECLARATION); - if (inner && inner.index !== undefined) { + if (!arg.includes(':') && inner && inner.index !== undefined) { result.push(count + inner.index + inner[0].length); } count += arg.length + 1; @@ -46,7 +46,7 @@ function get_next_position( return [ new vscode.Position( lineNumber, - currentCharCount + match.index + match[0].length - 1, + currentCharCount + match.index + match[1].length, ), ]; } @@ -167,6 +167,9 @@ export class Decorator { const content = hover.contents; // @ts-ignore const simplified = content[0].value; + if (!/^(?:\w+::)*\w+(?:<.*>)?$/m.test(simplified)) { + continue; + } const type = new FullType(simplified); let hint = ''; switch (SHORTENER) { From 2d921409eda029889809322eda51597eccd96d0f Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Wed, 22 May 2019 16:43:35 +0200 Subject: [PATCH 12/13] Fix awkward simplifying of lifetime parameters in greedy simplification mode --- src/providers/typeNameShortener.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/providers/typeNameShortener.ts b/src/providers/typeNameShortener.ts index a3914a66..a118d96a 100644 --- a/src/providers/typeNameShortener.ts +++ b/src/providers/typeNameShortener.ts @@ -146,7 +146,10 @@ export class GreedySimplifier { part.postfix, ); for (const subType of part.children) { - semiType.children.push(this.simplify(subType)); + const simplifiedSubType = this.simplify(subType); + if (simplifiedSubType.stringify() !== '') { + semiType.children.push(simplifiedSubType); + } } returnValue.parts.push(semiType); } From d10b5697598d6930c0b43a7d62106b4e75953c51 Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Wed, 22 May 2019 16:43:35 +0200 Subject: [PATCH 13/13] Fix awkward simplifying of lifetime parameters in greedy simplification mode --- src/providers/typeNameShortener.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/providers/typeNameShortener.ts b/src/providers/typeNameShortener.ts index a3914a66..9dfc911c 100644 --- a/src/providers/typeNameShortener.ts +++ b/src/providers/typeNameShortener.ts @@ -146,7 +146,10 @@ export class GreedySimplifier { part.postfix, ); for (const subType of part.children) { - semiType.children.push(this.simplify(subType)); + const simplifiedSubType = this.simplify(subType); + if (simplifiedSubType.parts.length > 0) { + semiType.children.push(simplifiedSubType); + } } returnValue.parts.push(semiType); }