Merge from master

This commit is contained in:
Raj Musuku
2019-02-21 17:56:04 -08:00
parent 5a146e34fa
commit 666ae11639
11482 changed files with 119352 additions and 255574 deletions

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
import * as ts from 'typescript';
import { PackageDocument } from './packageDocumentHelper';
@@ -22,10 +20,10 @@ export function activate(context: vscode.ExtensionContext) {
const _linkProvider = new class implements vscode.DocumentLinkProvider {
private _cachedResult: { key: string; links: vscode.DocumentLink[] };
private _cachedResult: { key: string; links: vscode.DocumentLink[] } | undefined;
private _linkPattern = /[^!]\[.*?\]\(#(.*?)\)/g;
async provideDocumentLinks(document: vscode.TextDocument, token: vscode.CancellationToken): Promise<vscode.DocumentLink[]> {
async provideDocumentLinks(document: vscode.TextDocument, _token: vscode.CancellationToken): Promise<vscode.DocumentLink[]> {
const key = `${document.uri.toString()}@${document.version}`;
if (!this._cachedResult || this._cachedResult.key !== key) {
const links = await this._computeDocumentLinks(document);
@@ -41,7 +39,7 @@ const _linkProvider = new class implements vscode.DocumentLinkProvider {
const lookUp = await ast.createNamedNodeLookUp(text);
this._linkPattern.lastIndex = 0;
let match: RegExpMatchArray;
let match: RegExpMatchArray | null = null;
while ((match = this._linkPattern.exec(text))) {
const offset = lookUp(match[1]);