adopt web extensions to webpack 5

This commit is contained in:
Martin Aeschlimann 2021-07-08 21:41:03 +02:00
parent a3e07245ee
commit 7ebe6a6054
No known key found for this signature in database
GPG Key ID: 2609A01E695523E3
51 changed files with 552 additions and 277 deletions

View File

@ -1,79 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
function format(message, args) {
let result;
// if (isPseudo) {
// // FF3B and FF3D is the Unicode zenkaku representation for [ and ]
// message = '\uFF3B' + message.replace(/[aouei]/g, '$&$&') + '\uFF3D';
// }
if (args.length === 0) {
result = message;
}
else {
result = message.replace(/\{(\d+)\}/g, function (match, rest) {
let index = rest[0];
let arg = args[index];
let replacement = match;
if (typeof arg === 'string') {
replacement = arg;
}
else if (typeof arg === 'number' || typeof arg === 'boolean' || arg === void 0 || arg === null) {
replacement = String(arg);
}
return replacement;
});
}
return result;
}
function localize(key, message) {
let args = [];
for (let _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
return format(message, args);
}
function loadMessageBundle(file) {
return localize;
}
let MessageFormat;
(function (MessageFormat) {
MessageFormat["file"] = "file";
MessageFormat["bundle"] = "bundle";
MessageFormat["both"] = "both";
})(MessageFormat = exports.MessageFormat || (exports.MessageFormat = {}));
let BundleFormat;
(function (BundleFormat) {
// the nls.bundle format
BundleFormat["standalone"] = "standalone";
BundleFormat["languagePack"] = "languagePack";
})(BundleFormat = exports.BundleFormat || (exports.BundleFormat = {}));
exports.loadMessageBundle = loadMessageBundle;
function config(opts) {
if (opts) {
if (isString(opts.locale)) {
options.locale = opts.locale.toLowerCase();
options.language = options.locale;
resolvedLanguage = undefined;
resolvedBundles = Object.create(null);
}
if (opts.messageFormat !== undefined) {
options.messageFormat = opts.messageFormat;
}
if (opts.bundleFormat === BundleFormat.standalone && options.languagePackSupport === true) {
options.languagePackSupport = false;
}
}
isPseudo = options.locale === 'pseudo';
return loadMessageBundle;
}
exports.config = config;

View File

@ -21,7 +21,7 @@
},
"dependencies": {
"jsonc-parser": "^2.2.1",
"vscode-nls": "^4.1.1"
"vscode-nls": "^5.0.0"
},
"capabilities": {
"virtualWorkspaces": true,

View File

@ -12,7 +12,7 @@ jsonc-parser@^2.2.1:
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.2.1.tgz#db73cd59d78cce28723199466b2a03d1be1df2bc"
integrity sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w==
vscode-nls@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.1.tgz#f9916b64e4947b20322defb1e676a495861f133c"
integrity sha512-4R+2UoUUU/LdnMnFjePxfLqNhBS8lrAFyX7pjb2ud/lqDkrUavFUTcG7wR0HBZFakae0Q6KLBFjMS6W93F403A==
vscode-nls@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.0.0.tgz#99f0da0bd9ea7cda44e565a74c54b1f2bc257840"
integrity sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==

View File

@ -18,6 +18,7 @@ module.exports = withBrowserDefaults({
output: {
filename: 'cssServerMain.js',
path: path.join(__dirname, 'dist', 'browser'),
libraryTarget: 'var'
libraryTarget: 'var',
library: 'serverExportVar'
}
});

View File

@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { createConnection, BrowserMessageReader, BrowserMessageWriter } from 'vscode-languageserver/browser';
import { startServer } from '../cssServer';
import { createConnection, BrowserMessageReader, BrowserMessageWriter, Disposable } from 'vscode-languageserver/browser';
import { RuntimeEnvironment, startServer } from '../cssServer';
declare let self: any;
@ -13,4 +13,17 @@ const messageWriter = new BrowserMessageWriter(self);
const connection = createConnection(messageReader, messageWriter);
startServer(connection, {});
const runtime: RuntimeEnvironment = {
timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable {
const handle = setTimeout(callback, 0, ...args);
return { dispose: () => clearTimeout(handle) };
},
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable {
const handle = setTimeout(callback, ms, ...args);
return { dispose: () => clearTimeout(handle) };
}
}
};
startServer(connection, runtime);

View File

@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import {
Connection, TextDocuments, InitializeParams, InitializeResult, ServerCapabilities, ConfigurationRequest, WorkspaceFolder, TextDocumentSyncKind, NotificationType
Connection, TextDocuments, InitializeParams, InitializeResult, ServerCapabilities, ConfigurationRequest, WorkspaceFolder, TextDocumentSyncKind, NotificationType, Disposable
} from 'vscode-languageserver';
import { URI } from 'vscode-uri';
import { getCSSLanguageService, getSCSSLanguageService, getLESSLanguageService, LanguageSettings, LanguageService, Stylesheet, TextDocument, Position } from 'vscode-css-languageservice';
@ -25,8 +25,12 @@ export interface Settings {
}
export interface RuntimeEnvironment {
file?: RequestService;
http?: RequestService
readonly file?: RequestService;
readonly http?: RequestService;
readonly timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable;
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
}
}
export function startServer(connection: Connection, runtime: RuntimeEnvironment) {
@ -150,7 +154,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
documents.all().forEach(triggerValidation);
}
const pendingValidationRequests: { [uri: string]: NodeJS.Timer } = {};
const pendingValidationRequests: { [uri: string]: Disposable } = {};
const validationDelayMs = 500;
// The content of a text document has changed. This event is emitted
@ -168,14 +172,14 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
function cleanPendingValidation(textDocument: TextDocument): void {
const request = pendingValidationRequests[textDocument.uri];
if (request) {
clearTimeout(request);
request.dispose();
delete pendingValidationRequests[textDocument.uri];
}
}
function triggerValidation(textDocument: TextDocument): void {
cleanPendingValidation(textDocument);
pendingValidationRequests[textDocument.uri] = setTimeout(() => {
pendingValidationRequests[textDocument.uri] = runtime.timer.setTimeout(() => {
delete pendingValidationRequests[textDocument.uri];
validateTextDocument(textDocument);
}, validationDelayMs);
@ -203,7 +207,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
}
connection.onCompletion((textDocumentPosition, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(textDocumentPosition.textDocument.uri);
if (document) {
const [settings,] = await Promise.all([getDocumentSettings(document), dataProvidersReady]);
@ -216,7 +220,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onHover((textDocumentPosition, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(textDocumentPosition.textDocument.uri);
if (document) {
const [settings,] = await Promise.all([getDocumentSettings(document), dataProvidersReady]);
@ -228,7 +232,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onDocumentSymbol((documentSymbolParams, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(documentSymbolParams.textDocument.uri);
if (document) {
await dataProvidersReady;
@ -240,7 +244,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onDefinition((documentDefinitionParams, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(documentDefinitionParams.textDocument.uri);
if (document) {
await dataProvidersReady;
@ -252,7 +256,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onDocumentHighlight((documentHighlightParams, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(documentHighlightParams.textDocument.uri);
if (document) {
await dataProvidersReady;
@ -265,7 +269,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
connection.onDocumentLinks(async (documentLinkParams, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(documentLinkParams.textDocument.uri);
if (document) {
await dataProvidersReady;
@ -279,7 +283,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
connection.onReferences((referenceParams, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(referenceParams.textDocument.uri);
if (document) {
await dataProvidersReady;
@ -291,7 +295,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onCodeAction((codeActionParams, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(codeActionParams.textDocument.uri);
if (document) {
await dataProvidersReady;
@ -303,7 +307,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onDocumentColor((params, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(params.textDocument.uri);
if (document) {
await dataProvidersReady;
@ -315,7 +319,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onColorPresentation((params, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(params.textDocument.uri);
if (document) {
await dataProvidersReady;
@ -327,7 +331,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onRenameRequest((renameParameters, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(renameParameters.textDocument.uri);
if (document) {
await dataProvidersReady;
@ -339,7 +343,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onFoldingRanges((params, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(params.textDocument.uri);
if (document) {
await dataProvidersReady;
@ -350,7 +354,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onSelectionRanges((params, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(params.textDocument.uri);
const positions: Position[] = params.positions;

View File

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { TextDocument } from 'vscode-languageserver';
import { TextDocument } from 'vscode-css-languageservice';
export interface LanguageModelCache<T> {
get(document: TextDocument): T;
@ -79,4 +79,4 @@ export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTime
}
}
};
}
}

View File

@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { createConnection, Connection } from 'vscode-languageserver/node';
import { createConnection, Connection, Disposable } from 'vscode-languageserver/node';
import { formatError } from '../utils/runner';
import { startServer } from '../cssServer';
import { RuntimeEnvironment, startServer } from '../cssServer';
import { getNodeFSRequestService } from './nodeFs';
// Create a connection for the server.
@ -18,4 +18,18 @@ process.on('unhandledRejection', (e: any) => {
connection.console.error(formatError(`Unhandled exception`, e));
});
startServer(connection, { file: getNodeFSRequestService() });
const runtime: RuntimeEnvironment = {
timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable {
const handle = setImmediate(callback, ...args);
return { dispose: () => clearImmediate(handle) };
},
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable {
const handle = setTimeout(callback, ms, ...args);
return { dispose: () => clearTimeout(handle) };
}
},
file: getNodeFSRequestService()
};
startServer(connection, runtime);

View File

@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { ResponseError, CancellationToken, LSPErrorCodes } from 'vscode-languageserver';
import { RuntimeEnvironment } from '../cssServer';
export function formatError(message: string, err: any): string {
if (err instanceof Error) {
@ -17,9 +18,9 @@ export function formatError(message: string, err: any): string {
return message;
}
export function runSafeAsync<T>(func: () => Thenable<T>, errorVal: T, errorMessage: string, token: CancellationToken): Thenable<T | ResponseError<any>> {
export function runSafeAsync<T>(runtime: RuntimeEnvironment, func: () => Thenable<T>, errorVal: T, errorMessage: string, token: CancellationToken): Thenable<T | ResponseError<any>> {
return new Promise<T | ResponseError<any>>((resolve) => {
setImmediate(() => {
runtime.timer.setImmediate(() => {
if (token.isCancellationRequested) {
resolve(cancelValue());
}

View File

@ -30,7 +30,7 @@
"jsonc-parser": "^2.2.1",
"markdown-it": "^12.0.4",
"parse5": "^3.0.2",
"vscode-nls": "^4.1.1"
"vscode-nls": "^5.0.0"
},
"contributes": {
"jsonValidation": [

View File

@ -18,4 +18,5 @@ function registerPackageDocumentCompletions(): vscode.Disposable {
return new PackageDocument(document).provideCompletionItems(position, token);
}
});
}

View File

@ -72,7 +72,7 @@ uc.micro@^1.0.5:
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac"
integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==
vscode-nls@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.1.tgz#f9916b64e4947b20322defb1e676a495861f133c"
integrity sha512-4R+2UoUUU/LdnMnFjePxfLqNhBS8lrAFyX7pjb2ud/lqDkrUavFUTcG7wR0HBZFakae0Q6KLBFjMS6W93F403A==
vscode-nls@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.0.0.tgz#99f0da0bd9ea7cda44e565a74c54b1f2bc257840"
integrity sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==

View File

@ -88,7 +88,7 @@
"node-fetch": "2.6.1",
"uuid": "8.1.0",
"vscode-extension-telemetry": "0.1.7",
"vscode-nls": "^4.1.2",
"vscode-nls": "^5.0.0",
"vscode-tas-client": "^0.1.22"
},
"devDependencies": {

View File

@ -175,10 +175,10 @@ vscode-extension-telemetry@0.1.7:
dependencies:
applicationinsights "1.7.4"
vscode-nls@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.2.tgz#ca8bf8bb82a0987b32801f9fddfdd2fb9fd3c167"
integrity sha512-7bOHxPsfyuCqmP+hZXscLhiHwe7CSuFE4hyhbs22xPIhQ4jv99FcR4eBzfYYVLP356HNFpdvz63FFb/xw6T4Iw==
vscode-nls@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.0.0.tgz#99f0da0bd9ea7cda44e565a74c54b1f2bc257840"
integrity sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==
vscode-tas-client@^0.1.22:
version "0.1.22"

View File

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ExtensionContext, Uri } from 'vscode';
import { Disposable, ExtensionContext, Uri } from 'vscode';
import { LanguageClientOptions } from 'vscode-languageclient';
import { startClient, LanguageClientConstructor } from '../htmlClient';
import { LanguageClient } from 'vscode-languageclient/browser';
@ -24,7 +24,14 @@ export function activate(context: ExtensionContext) {
return new LanguageClient(id, name, clientOptions, worker);
};
startClient(context, newLanguageClient, { TextDecoder });
const timer = {
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable {
const handle = setTimeout(callback, ms, ...args);
return { dispose: () => clearTimeout(handle) };
}
};
startClient(context, newLanguageClient, { TextDecoder, timer });
} catch (e) {
console.log(e);

View File

@ -58,6 +58,9 @@ export interface Runtime {
TextDecoder: { new(encoding?: string): { decode(buffer: ArrayBuffer): string; } };
fs?: RequestService;
telemetry?: TelemetryReporter;
readonly timer: {
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
}
}
export function startClient(context: ExtensionContext, newLanguageClient: LanguageClientConstructor, runtime: Runtime) {
@ -126,7 +129,7 @@ export function startClient(context: ExtensionContext, newLanguageClient: Langua
let param = client.code2ProtocolConverter.asTextDocumentPositionParams(document, position);
return client.sendRequest(TagCloseRequest.type, param);
};
disposable = activateTagClosing(tagRequestor, { html: true, handlebars: true }, 'html.autoClosingTags');
disposable = activateTagClosing(tagRequestor, { html: true, handlebars: true }, 'html.autoClosingTags', runtime);
toDispose.push(disposable);
disposable = client.onTelemetry(e => {

View File

@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { getNodeFSRequestService } from './nodeFs';
import { ExtensionContext } from 'vscode';
import { Disposable, ExtensionContext } from 'vscode';
import { startClient, LanguageClientConstructor } from '../htmlClient';
import { ServerOptions, TransportKind, LanguageClientOptions, LanguageClient } from 'vscode-languageclient/node';
import { TextDecoder } from 'util';
@ -37,7 +37,14 @@ export function activate(context: ExtensionContext) {
return new LanguageClient(id, name, serverOptions, clientOptions);
};
startClient(context, newLanguageClient, { fs: getNodeFSRequestService(), TextDecoder, telemetry });
const timer = {
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable {
const handle = setTimeout(callback, ms, ...args);
return { dispose: () => clearTimeout(handle) };
}
};
startClient(context, newLanguageClient, { fs: getNodeFSRequestService(), TextDecoder, telemetry, timer });
}
interface IPackageInfo {

View File

@ -4,8 +4,9 @@
*--------------------------------------------------------------------------------------------*/
import { window, workspace, Disposable, TextDocumentContentChangeEvent, TextDocument, Position, SnippetString } from 'vscode';
import { Runtime } from './htmlClient';
export function activateTagClosing(tagProvider: (document: TextDocument, position: Position) => Thenable<string>, supportedLanguages: { [id: string]: boolean }, configName: string): Disposable {
export function activateTagClosing(tagProvider: (document: TextDocument, position: Position) => Thenable<string>, supportedLanguages: { [id: string]: boolean }, configName: string, runtime: Runtime): Disposable {
let disposables: Disposable[] = [];
workspace.onDidChangeTextDocument(event => onDidChangeTextDocument(event.document, event.contentChanges), null, disposables);
@ -14,7 +15,13 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
updateEnabledState();
window.onDidChangeActiveTextEditor(updateEnabledState, null, disposables);
let timeout: NodeJS.Timer | undefined = undefined;
let timeout: Disposable | undefined = undefined;
disposables.push({
dispose: () => {
timeout?.dispose();
}
});
function updateEnabledState() {
isEnabled = false;
@ -40,8 +47,8 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
if (document !== activeDocument || changes.length === 0) {
return;
}
if (typeof timeout !== 'undefined') {
clearTimeout(timeout);
if (timeout) {
timeout.dispose();
}
let lastChange = changes[changes.length - 1];
let lastCharacter = lastChange.text[lastChange.text.length - 1];
@ -50,7 +57,7 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
}
let rangeStart = lastChange.range.start;
let version = document.version;
timeout = setTimeout(() => {
timeout = runtime.timer.setTimeout(() => {
let position = new Position(rangeStart.line, rangeStart.character + lastChange.text.length);
tagProvider(document, position).then(text => {
if (text && isEnabled) {
@ -72,4 +79,4 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
}, 100);
}
return Disposable.from(...disposables);
}
}

View File

@ -18,7 +18,8 @@ const serverConfig = withBrowserDefaults({
output: {
filename: 'htmlServerMain.js',
path: path.join(__dirname, 'dist', 'browser'),
libraryTarget: 'var'
libraryTarget: 'var',
library: 'serverExportVar'
},
optimization: {
splitChunks: {
@ -26,7 +27,7 @@ const serverConfig = withBrowserDefaults({
}
}
});
serverConfig.module.noParse = /typescript[\/\\]lib[\/\\]typescript\.js/;
serverConfig.module.noParse = /typescript[\/\\]lib[\/\\]typescript\.js/;
serverConfig.module.rules.push({
test: /javascriptLibs.ts$/,
use: [

View File

@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { createConnection, BrowserMessageReader, BrowserMessageWriter } from 'vscode-languageserver/browser';
import { startServer } from '../htmlServer';
import { createConnection, BrowserMessageReader, BrowserMessageWriter, Disposable } from 'vscode-languageserver/browser';
import { RuntimeEnvironment, startServer } from '../htmlServer';
declare let self: any;
@ -13,4 +13,17 @@ const messageWriter = new BrowserMessageWriter(self);
const connection = createConnection(messageReader, messageWriter);
startServer(connection, {});
const runtime: RuntimeEnvironment = {
timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable {
const handle = setTimeout(callback, 0, ...args);
return { dispose: () => clearTimeout(handle) };
},
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable {
const handle = setTimeout(callback, ms, ...args);
return { dispose: () => clearTimeout(handle) };
}
}
};
startServer(connection, runtime);

View File

@ -50,6 +50,10 @@ export interface RuntimeEnvironment {
file?: RequestService;
http?: RequestService
configureHttpRequests?(proxy: string, strictSSL: boolean): void;
readonly timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable;
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
}
}
export function startServer(connection: Connection, runtime: RuntimeEnvironment) {
@ -215,7 +219,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
}
});
const pendingValidationRequests: { [uri: string]: NodeJS.Timer } = {};
const pendingValidationRequests: { [uri: string]: Disposable } = {};
const validationDelayMs = 500;
// The content of a text document has changed. This event is emitted
@ -233,14 +237,14 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
function cleanPendingValidation(textDocument: TextDocument): void {
const request = pendingValidationRequests[textDocument.uri];
if (request) {
clearTimeout(request);
request.dispose();
delete pendingValidationRequests[textDocument.uri];
}
}
function triggerValidation(textDocument: TextDocument): void {
cleanPendingValidation(textDocument);
pendingValidationRequests[textDocument.uri] = setTimeout(() => {
pendingValidationRequests[textDocument.uri] = runtime.timer.setTimeout(() => {
delete pendingValidationRequests[textDocument.uri];
validateTextDocument(textDocument);
}, validationDelayMs);
@ -277,7 +281,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
}
connection.onCompletion(async (textDocumentPosition, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(textDocumentPosition.textDocument.uri);
if (!document) {
return null;
@ -305,7 +309,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onCompletionResolve((item, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const data = item.data;
if (data && data.languageId && data.uri) {
const mode = languageModes.getMode(data.languageId);
@ -319,7 +323,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onHover((textDocumentPosition, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(textDocumentPosition.textDocument.uri);
if (document) {
const mode = languageModes.getModeAtPosition(document, textDocumentPosition.position);
@ -334,7 +338,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onDocumentHighlight((documentHighlightParams, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(documentHighlightParams.textDocument.uri);
if (document) {
const mode = languageModes.getModeAtPosition(document, documentHighlightParams.position);
@ -347,7 +351,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onDefinition((definitionParams, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(definitionParams.textDocument.uri);
if (document) {
const mode = languageModes.getModeAtPosition(document, definitionParams.position);
@ -360,7 +364,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onReferences((referenceParams, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(referenceParams.textDocument.uri);
if (document) {
const mode = languageModes.getModeAtPosition(document, referenceParams.position);
@ -373,7 +377,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onSignatureHelp((signatureHelpParms, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(signatureHelpParms.textDocument.uri);
if (document) {
const mode = languageModes.getModeAtPosition(document, signatureHelpParms.position);
@ -401,15 +405,15 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
}
connection.onDocumentRangeFormatting((formatParams, token) => {
return runSafe(() => onFormat(formatParams.textDocument, formatParams.range, formatParams.options), [], `Error while formatting range for ${formatParams.textDocument.uri}`, token);
return runSafe(runtime, () => onFormat(formatParams.textDocument, formatParams.range, formatParams.options), [], `Error while formatting range for ${formatParams.textDocument.uri}`, token);
});
connection.onDocumentFormatting((formatParams, token) => {
return runSafe(() => onFormat(formatParams.textDocument, undefined, formatParams.options), [], `Error while formatting ${formatParams.textDocument.uri}`, token);
return runSafe(runtime, () => onFormat(formatParams.textDocument, undefined, formatParams.options), [], `Error while formatting ${formatParams.textDocument.uri}`, token);
});
connection.onDocumentLinks((documentLinkParam, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(documentLinkParam.textDocument.uri);
const links: DocumentLink[] = [];
if (document) {
@ -425,7 +429,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onDocumentSymbol((documentSymbolParms, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(documentSymbolParms.textDocument.uri);
const symbols: SymbolInformation[] = [];
if (document) {
@ -440,7 +444,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onRequest(DocumentColorRequest.type, (params, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const infos: ColorInformation[] = [];
const document = documents.get(params.textDocument.uri);
if (document) {
@ -455,7 +459,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onRequest(ColorPresentationRequest.type, (params, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(params.textDocument.uri);
if (document) {
const mode = languageModes.getModeAtPosition(document, params.range.start);
@ -468,7 +472,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onRequest(TagCloseRequest.type, (params, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(params.textDocument.uri);
if (document) {
const pos = params.position;
@ -484,7 +488,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onFoldingRanges((params, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(params.textDocument.uri);
if (document) {
return getFoldingRanges(languageModes, document, foldingRangeLimit, token);
@ -494,7 +498,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onSelectionRanges((params, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(params.textDocument.uri);
if (document) {
return getSelectionRanges(languageModes, document, params.positions);
@ -504,7 +508,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onRenameRequest((params, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(params.textDocument.uri);
const position: Position = params.position;
@ -520,7 +524,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.languages.onLinkedEditingRange((params, token) => {
return <any> /* todo remove when microsoft/vscode-languageserver-node#700 fixed */ runSafe(async () => {
return <any> /* todo remove when microsoft/vscode-languageserver-node#700 fixed */ runSafe(runtime, async () => {
const document = documents.get(params.textDocument.uri);
if (document) {
const pos = params.position;
@ -547,7 +551,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
}
connection.onRequest(SemanticTokenRequest.type, (params, token) => {
return runSafe(async () => {
return runSafe(runtime, async () => {
const document = documents.get(params.textDocument.uri);
if (document) {
return getSemanticTokenProvider().getSemanticTokens(document, params.ranges);
@ -557,7 +561,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onRequest(SemanticTokenLegendRequest.type, token => {
return runSafe(async () => {
return runSafe(runtime, async () => {
return getSemanticTokenProvider().legend;
}, null, `Error while computing semantic tokens legend`, token);
});

View File

@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { createConnection, Connection } from 'vscode-languageserver/node';
import { createConnection, Connection, Disposable } from 'vscode-languageserver/node';
import { formatError } from '../utils/runner';
import { startServer } from '../htmlServer';
import { RuntimeEnvironment, startServer } from '../htmlServer';
import { getNodeFSRequestService } from './nodeFs';
@ -19,5 +19,18 @@ process.on('unhandledRejection', (e: any) => {
connection.console.error(formatError(`Unhandled exception`, e));
});
const runtime: RuntimeEnvironment = {
timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable {
const handle = setImmediate(callback, ...args);
return { dispose: () => clearImmediate(handle) };
},
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable {
const handle = setTimeout(callback, ms, ...args);
return { dispose: () => clearTimeout(handle) };
}
},
file: getNodeFSRequestService()
};
startServer(connection, { file: getNodeFSRequestService() });
startServer(connection, runtime);

View File

@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { ResponseError, CancellationToken, LSPErrorCodes } from 'vscode-languageserver';
import { RuntimeEnvironment } from '../htmlServer';
export function formatError(message: string, err: any): string {
if (err instanceof Error) {
@ -17,9 +18,9 @@ export function formatError(message: string, err: any): string {
return message;
}
export function runSafe<T>(func: () => Thenable<T>, errorVal: T, errorMessage: string, token: CancellationToken): Thenable<T | ResponseError<any>> {
export function runSafe<T>(runtime: RuntimeEnvironment, func: () => Thenable<T>, errorVal: T, errorMessage: string, token: CancellationToken): Thenable<T | ResponseError<any>> {
return new Promise<T | ResponseError<any>>((resolve) => {
setImmediate(() => {
runtime.timer.setImmediate(() => {
if (token.isCancellationRequested) {
resolve(cancelValue());
}

View File

@ -82,7 +82,7 @@
},
"dependencies": {
"vscode-extension-telemetry": "0.1.7",
"vscode-nls": "^4.0.0"
"vscode-nls": "^5.0.0"
},
"repository": {
"type": "git",

View File

@ -90,7 +90,7 @@ vscode-extension-telemetry@0.1.7:
dependencies:
applicationinsights "1.7.4"
vscode-nls@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.0.0.tgz#4001c8a6caba5cedb23a9c5ce1090395c0e44002"
integrity sha512-qCfdzcH+0LgQnBpZA53bA32kzp9rpq/f66Som577ObeuDlFIrtbEJ+A/+CCxjIh4G8dpJYNCKIsxpRAHIfsbNw==
vscode-nls@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.0.0.tgz#99f0da0bd9ea7cda44e565a74c54b1f2bc257840"
integrity sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==

View File

@ -19,10 +19,12 @@ const config = withDefaults({
output: {
filename: 'jsonClientMain.js',
path: path.join(__dirname, 'client', 'dist', 'node')
}
},
plugins: [
...withDefaults.getNodePlugins(__dirname),
new webpack.IgnorePlugin({ contextRegExp: /vertx/})
]
});
// add plugin, don't replace inherited
config.plugins.push(new webpack.IgnorePlugin(/vertx/)); // request-light dependency
module.exports = config;

View File

@ -18,6 +18,7 @@ module.exports = withBrowserDefaults({
output: {
filename: 'jsonServerMain.js',
path: path.join(__dirname, 'dist', 'browser'),
libraryTarget: 'var'
libraryTarget: 'var',
library: 'serverExportVar'
}
});

View File

@ -19,10 +19,11 @@ const config = withDefaults({
output: {
filename: 'jsonServerMain.js',
path: path.join(__dirname, 'dist', 'node'),
}
},
plugins: [
...withDefaults.getNodePlugins(__dirname), // add plugin, don't replace inherited
new webpack.IgnorePlugin({ contextRegExp: /vertx/})
]
});
// add plugin, don't replace inherited
config.plugins.push(new webpack.IgnorePlugin({ resourceRegExp: /vertx/ })); // request-light dependency
module.exports = config;

View File

@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { createConnection, BrowserMessageReader, BrowserMessageWriter } from 'vscode-languageserver/browser';
import { startServer } from '../jsonServer';
import { createConnection, BrowserMessageReader, BrowserMessageWriter, Disposable } from 'vscode-languageserver/browser';
import { RuntimeEnvironment, startServer } from '../jsonServer';
declare let self: any;
@ -13,4 +13,17 @@ const messageWriter = new BrowserMessageWriter(self);
const connection = createConnection(messageReader, messageWriter);
startServer(connection, {});
const runtime: RuntimeEnvironment = {
timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable {
const handle = setTimeout(callback, 0, ...args);
return { dispose: () => clearTimeout(handle) };
},
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable {
const handle = setTimeout(callback, ms, ...args);
return { dispose: () => clearTimeout(handle) };
}
}
};
startServer(connection, runtime);

View File

@ -48,6 +48,10 @@ export interface RuntimeEnvironment {
file?: RequestService;
http?: RequestService
configureHttpRequests?(proxy: string, strictSSL: boolean): void;
readonly timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable;
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
}
}
export function startServer(connection: Connection, runtime: RuntimeEnvironment) {
@ -171,13 +175,19 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
const limitExceededWarnings = function () {
const pendingWarnings: { [uri: string]: { features: { [name: string]: string }; timeout?: NodeJS.Timeout; } } = {};
const pendingWarnings: { [uri: string]: { features: { [name: string]: string }; timeout?: Disposable; } } = {};
const showLimitedNotification = (uri: string, resultLimit: number) => {
const warning = pendingWarnings[uri];
connection.sendNotification(ResultLimitReachedNotification.type, `${basename(uri)}: For performance reasons, ${Object.keys(warning.features).join(' and ')} have been limited to ${resultLimit} items.`);
warning.timeout = undefined;
};
return {
cancel(uri: string) {
const warning = pendingWarnings[uri];
if (warning && warning.timeout) {
clearTimeout(warning.timeout);
warning.timeout.dispose();
delete pendingWarnings[uri];
}
},
@ -191,13 +201,11 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
return;
}
warning.features[name] = name;
warning.timeout.refresh();
warning.timeout.dispose();
warning.timeout = runtime.timer.setTimeout(() => showLimitedNotification(uri, resultLimit), 2000);
} else {
warning = { features: { [name]: name } };
warning.timeout = setTimeout(() => {
connection.sendNotification(ResultLimitReachedNotification.type, `${basename(uri)}: For performance reasons, ${Object.keys(warning.features).join(' and ')} have been limited to ${resultLimit} items.`);
warning.timeout = undefined;
}, 2000);
warning.timeout = runtime.timer.setTimeout(() => showLimitedNotification(uri, resultLimit), 2000);
pendingWarnings[uri] = warning;
}
};
@ -316,20 +324,20 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
connection.sendDiagnostics({ uri: event.document.uri, diagnostics: [] });
});
const pendingValidationRequests: { [uri: string]: NodeJS.Timer; } = {};
const pendingValidationRequests: { [uri: string]: Disposable; } = {};
const validationDelayMs = 300;
function cleanPendingValidation(textDocument: TextDocument): void {
const request = pendingValidationRequests[textDocument.uri];
if (request) {
clearTimeout(request);
request.dispose();
delete pendingValidationRequests[textDocument.uri];
}
}
function triggerValidation(textDocument: TextDocument): void {
cleanPendingValidation(textDocument);
pendingValidationRequests[textDocument.uri] = setTimeout(() => {
pendingValidationRequests[textDocument.uri] = runtime.timer.setTimeout(() => {
delete pendingValidationRequests[textDocument.uri];
validateTextDocument(textDocument);
}, validationDelayMs);
@ -351,7 +359,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
const documentSettings: DocumentLanguageSettings = textDocument.languageId === 'jsonc' ? { comments: 'ignore', trailingCommas: 'warning' } : { comments: 'error', trailingCommas: 'error' };
languageService.doValidation(textDocument, jsonDocument, documentSettings).then(diagnostics => {
setImmediate(() => {
runtime.timer.setImmediate(() => {
const currDocument = documents.get(textDocument.uri);
if (currDocument && currDocument.version === version) {
respond(diagnostics); // Send the computed diagnostics to VSCode.
@ -388,7 +396,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
}
connection.onCompletion((textDocumentPosition, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(textDocumentPosition.textDocument.uri);
if (document) {
const jsonDocument = getJSONDocument(document);
@ -399,7 +407,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onHover((textDocumentPositionParams, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(textDocumentPositionParams.textDocument.uri);
if (document) {
const jsonDocument = getJSONDocument(document);
@ -410,7 +418,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onDocumentSymbol((documentSymbolParams, token) => {
return runSafe(() => {
return runSafe(runtime, () => {
const document = documents.get(documentSymbolParams.textDocument.uri);
if (document) {
const jsonDocument = getJSONDocument(document);
@ -439,15 +447,15 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
}
connection.onDocumentRangeFormatting((formatParams, token) => {
return runSafe(() => onFormat(formatParams.textDocument, formatParams.range, formatParams.options), [], `Error while formatting range for ${formatParams.textDocument.uri}`, token);
return runSafe(runtime, () => onFormat(formatParams.textDocument, formatParams.range, formatParams.options), [], `Error while formatting range for ${formatParams.textDocument.uri}`, token);
});
connection.onDocumentFormatting((formatParams, token) => {
return runSafe(() => onFormat(formatParams.textDocument, undefined, formatParams.options), [], `Error while formatting ${formatParams.textDocument.uri}`, token);
return runSafe(runtime, () => onFormat(formatParams.textDocument, undefined, formatParams.options), [], `Error while formatting ${formatParams.textDocument.uri}`, token);
});
connection.onDocumentColor((params, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(params.textDocument.uri);
if (document) {
const onResultLimitExceeded = limitExceededWarnings.onResultLimitExceeded(document.uri, resultLimit, 'document colors');
@ -459,7 +467,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onColorPresentation((params, token) => {
return runSafe(() => {
return runSafe(runtime, () => {
const document = documents.get(params.textDocument.uri);
if (document) {
const jsonDocument = getJSONDocument(document);
@ -470,7 +478,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onFoldingRanges((params, token) => {
return runSafe(() => {
return runSafe(runtime, () => {
const document = documents.get(params.textDocument.uri);
if (document) {
const onRangeLimitExceeded = limitExceededWarnings.onResultLimitExceeded(document.uri, foldingRangeLimit, 'folding ranges');
@ -482,7 +490,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
connection.onSelectionRanges((params, token) => {
return runSafe(() => {
return runSafe(runtime, () => {
const document = documents.get(params.textDocument.uri);
if (document) {
const jsonDocument = getJSONDocument(document);
@ -493,7 +501,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
});
connection.onDocumentLinks((params, token) => {
return runSafeAsync(async () => {
return runSafeAsync(runtime, async () => {
const document = documents.get(params.textDocument.uri);
if (document) {
const jsonDocument = getJSONDocument(document);

View File

@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { createConnection, Connection } from 'vscode-languageserver/node';
import { createConnection, Connection, Disposable } from 'vscode-languageserver/node';
import { formatError } from '../utils/runner';
import { startServer } from '../jsonServer';
import { RuntimeEnvironment, startServer } from '../jsonServer';
import { RequestService } from '../requests';
import { xhr, XHRResponse, configure as configureHttpRequests, getErrorStatusDescription } from 'request-light';
@ -51,5 +51,22 @@ function getFileRequestService(): RequestService {
};
}
const runtime: RuntimeEnvironment = {
timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable {
const handle = setImmediate(callback, ...args);
return { dispose: () => clearImmediate(handle) };
},
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable {
const handle = setTimeout(callback, ms, ...args);
return { dispose: () => clearTimeout(handle) };
}
},
file: getFileRequestService(),
http: getHTTPRequestService(),
configureHttpRequests
};
startServer(connection, { file: getFileRequestService(), http: getHTTPRequestService(), configureHttpRequests });
startServer(connection, runtime);

View File

@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { CancellationToken, ResponseError, LSPErrorCodes } from 'vscode-languageserver';
import { RuntimeEnvironment } from '../jsonServer';
export function formatError(message: string, err: any): string {
if (err instanceof Error) {
@ -17,9 +18,9 @@ export function formatError(message: string, err: any): string {
return message;
}
export function runSafeAsync<T>(func: () => Thenable<T>, errorVal: T, errorMessage: string, token: CancellationToken): Thenable<T | ResponseError<any>> {
export function runSafeAsync<T>(runtime: RuntimeEnvironment, func: () => Thenable<T>, errorVal: T, errorMessage: string, token: CancellationToken): Thenable<T | ResponseError<any>> {
return new Promise<T | ResponseError<any>>((resolve) => {
setImmediate(() => {
runtime.timer.setImmediate(() => {
if (token.isCancellationRequested) {
resolve(cancelValue());
}
@ -38,9 +39,9 @@ export function runSafeAsync<T>(func: () => Thenable<T>, errorVal: T, errorMessa
});
}
export function runSafe<T, E>(func: () => T, errorVal: T, errorMessage: string, token: CancellationToken): Thenable<T | ResponseError<E>> {
export function runSafe<T, E>(runtime: RuntimeEnvironment, func: () => T, errorVal: T, errorMessage: string, token: CancellationToken): Thenable<T | ResponseError<E>> {
return new Promise<T | ResponseError<E>>((resolve) => {
setImmediate(() => {
runtime.timer.setImmediate(() => {
if (token.isCancellationRequested) {
resolve(cancelValue());
} else {

View File

@ -356,7 +356,7 @@
"markdown-it": "^12.0.3",
"markdown-it-front-matter": "^0.2.1",
"vscode-extension-telemetry": "0.1.7",
"vscode-nls": "^4.0.0"
"vscode-nls": "^5.0.0"
},
"devDependencies": {
"@types/highlight.js": "10.1.0",

View File

@ -152,7 +152,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
}
this._register(_contributionProvider.onContributionsChanged(() => {
setImmediate(() => this.refresh());
setTimeout(() => this.refresh(), 0);
}));
this._register(vscode.workspace.onDidChangeTextDocument(event => {

View File

@ -182,7 +182,7 @@ vscode-extension-telemetry@0.1.7:
dependencies:
applicationinsights "1.7.4"
vscode-nls@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.0.0.tgz#4001c8a6caba5cedb23a9c5ce1090395c0e44002"
integrity sha512-qCfdzcH+0LgQnBpZA53bA32kzp9rpq/f66Som577ObeuDlFIrtbEJ+A/+CCxjIh4G8dpJYNCKIsxpRAHIfsbNw==
vscode-nls@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.0.0.tgz#99f0da0bd9ea7cda44e565a74c54b1f2bc257840"
integrity sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==

View File

@ -156,7 +156,7 @@
}
},
"dependencies": {
"vscode-nls": "^4.0.0"
"vscode-nls": "^5.0.0"
},
"devDependencies": {
"@types/node": "14.x"

View File

@ -7,7 +7,7 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.43.tgz#26bcbb0595b305400e8ceaf9a127a7f905ae49c8"
integrity sha512-3pwDJjp1PWacPTpH0LcfhgjvurQvrZFBrC6xxjaUEZ7ifUtT32jtjPxEMMblpqd2Mvx+k8haqQJLQxolyGN/cQ==
vscode-nls@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.0.0.tgz#4001c8a6caba5cedb23a9c5ce1090395c0e44002"
integrity sha512-qCfdzcH+0LgQnBpZA53bA32kzp9rpq/f66Som577ObeuDlFIrtbEJ+A/+CCxjIh4G8dpJYNCKIsxpRAHIfsbNw==
vscode-nls@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.0.0.tgz#99f0da0bd9ea7cda44e565a74c54b1f2bc257840"
integrity sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==

View File

@ -60,7 +60,7 @@
"stream": "0.0.2",
"uuid": "^8.2.0",
"vscode-extension-telemetry": "0.1.7",
"vscode-nls": "^4.1.1"
"vscode-nls": "^5.0.0"
},
"repository": {
"type": "git",

View File

@ -229,7 +229,7 @@ vscode-extension-telemetry@0.1.7:
dependencies:
applicationinsights "1.7.4"
vscode-nls@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.1.tgz#f9916b64e4947b20322defb1e676a495861f133c"
integrity sha512-4R+2UoUUU/LdnMnFjePxfLqNhBS8lrAFyX7pjb2ud/lqDkrUavFUTcG7wR0HBZFakae0Q6KLBFjMS6W93F403A==
vscode-nls@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.0.0.tgz#99f0da0bd9ea7cda44e565a74c54b1f2bc257840"
integrity sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==

View File

@ -9,7 +9,7 @@
const withBrowserDefaults = require('../shared.webpack.config').browser;
module.exports = withBrowserDefaults({
const config = withBrowserDefaults({
context: __dirname,
entry: {
extension: './src/npmBrowserMain.ts'
@ -17,8 +17,11 @@ module.exports = withBrowserDefaults({
output: {
filename: 'npmBrowserMain.js'
},
node: {
'child_process': 'empty',
'which': 'empty'
resolve: {
fallback: {
'child_process': false
}
}
});
module.exports = config;

View File

@ -23,7 +23,7 @@
"jsonc-parser": "^2.2.1",
"minimatch": "^3.0.4",
"request-light": "^0.4.0",
"vscode-nls": "^4.1.1",
"vscode-nls": "^5.0.0",
"which": "^2.0.2",
"which-pm": "^2.0.0"
},

View File

@ -250,16 +250,16 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"
vscode-nls@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.1.tgz#f9916b64e4947b20322defb1e676a495861f133c"
integrity sha512-4R+2UoUUU/LdnMnFjePxfLqNhBS8lrAFyX7pjb2ud/lqDkrUavFUTcG7wR0HBZFakae0Q6KLBFjMS6W93F403A==
vscode-nls@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.2.tgz#ca8bf8bb82a0987b32801f9fddfdd2fb9fd3c167"
integrity sha512-7bOHxPsfyuCqmP+hZXscLhiHwe7CSuFE4hyhbs22xPIhQ4jv99FcR4eBzfYYVLP356HNFpdvz63FFb/xw6T4Iw==
vscode-nls@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.0.0.tgz#99f0da0bd9ea7cda44e565a74c54b1f2bc257840"
integrity sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==
which-pm@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/which-pm/-/which-pm-2.0.0.tgz#8245609ecfe64bf751d0eef2f376d83bf1ddb7ae"

View File

@ -16,12 +16,6 @@ const { NLSBundlePlugin } = require('vscode-nls-dev/lib/webpack-bundler');
const { DefinePlugin } = require('webpack');
function withNodeDefaults(/**@type WebpackConfig*/extConfig) {
// Need to find the top-most `package.json` file
const folderName = path.relative(__dirname, extConfig.context).split(/[\\\/]/)[0];
const pkgPath = path.join(__dirname, folderName, 'package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
const id = `${pkg.publisher}.${pkg.name}`;
/** @type WebpackConfig */
let defaultConfig = {
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
@ -70,19 +64,28 @@ function withNodeDefaults(/**@type WebpackConfig*/extConfig) {
},
// yes, really source maps
devtool: 'source-map',
plugins: [
new CopyWebpackPlugin({
patterns: [
{ from: 'src', to: '.', globOptions: { ignore: ['**/test/**', '**/*.ts'] }, noErrorOnMissing: true }
]
}),
new NLSBundlePlugin(id)
],
plugins: getDefaultNodePlugins(extConfig.context),
};
return merge(defaultConfig, extConfig);
}
function getDefaultNodePlugins(context) {
// Need to find the top-most `package.json` file
const folderName = path.relative(__dirname, context).split(/[\\\/]/)[0];
const pkgPath = path.join(__dirname, folderName, 'package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
const id = `${pkg.publisher}.${pkg.name}`;
return [
new CopyWebpackPlugin({
patterns: [
{ from: 'src', to: '.', globOptions: { ignore: ['**/test/**', '**/*.ts'] }, noErrorOnMissing: true }
]
}),
new NLSBundlePlugin(id)
];
}
function withBrowserDefaults(/**@type WebpackConfig*/extConfig) {
/** @type WebpackConfig */
@ -93,8 +96,11 @@ function withBrowserDefaults(/**@type WebpackConfig*/extConfig) {
mainFields: ['module', 'main'],
extensions: ['.ts', '.js'], // support ts-files and js-files
alias: {
'vscode-nls': path.resolve(__dirname, '../build/polyfills/vscode-nls.js'),
'vscode-extension-telemetry': path.resolve(__dirname, '../build/polyfills/vscode-extension-telemetry.js')
},
fallback: {
'path': require.resolve('path-browserify'),
'util': require.resolve('util')
}
},
module: {
@ -130,21 +136,31 @@ function withBrowserDefaults(/**@type WebpackConfig*/extConfig) {
},
// yes, really source maps
devtool: 'source-map',
plugins: [
new CopyWebpackPlugin({
patterns: [
{ from: 'src', to: '.', globOptions: { ignore: ['**/test/**', '**/*.ts'] }, noErrorOnMissing: true }
]
}),
new DefinePlugin({ WEBWORKER: JSON.stringify(true) })
]
plugins: getDefaultBrowserPlugins()
};
return merge(defaultConfig, extConfig);
}
function getDefaultBrowserPlugins() {
return [
new CopyWebpackPlugin({
patterns: [
{ from: 'src', to: '.', globOptions: { ignore: ['**/test/**', '**/*.ts'] }, noErrorOnMissing: true }
]
}),
new DefinePlugin({
'process.env': JSON.stringify({}),
'process.env.BROWSER_ENV': JSON.stringify('true')
})
];
}
module.exports = withNodeDefaults;
module.exports.node = withNodeDefaults;
module.exports.browser = withBrowserDefaults;
module.exports.getNodePlugins = getDefaultNodePlugins;
module.exports.getBrowserPlugins = getDefaultBrowserPlugins;

View File

@ -67,7 +67,7 @@
},
"dependencies": {
"vscode-extension-telemetry": "0.1.7",
"vscode-nls": "^4.0.0"
"vscode-nls": "^5.0.0"
},
"devDependencies": {
"@types/node": "14.x",

View File

@ -100,7 +100,7 @@ vscode-extension-telemetry@0.1.7:
dependencies:
applicationinsights "1.7.4"
vscode-nls@^4.0.0:
version "4.1.2"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.2.tgz#ca8bf8bb82a0987b32801f9fddfdd2fb9fd3c167"
integrity sha512-7bOHxPsfyuCqmP+hZXscLhiHwe7CSuFE4hyhbs22xPIhQ4jv99FcR4eBzfYYVLP356HNFpdvz63FFb/xw6T4Iw==
vscode-nls@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.0.0.tgz#99f0da0bd9ea7cda44e565a74c54b1f2bc257840"
integrity sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==

View File

@ -7,10 +7,11 @@
'use strict';
const CopyPlugin = require('copy-webpack-plugin');
const { lchmod } = require('graceful-fs');
const Terser = require('terser');
const withBrowserDefaults = require('../shared.webpack.config').browser;
const defaultConnfig = require('../shared.webpack.config');
const withBrowserDefaults = defaultConnfig.browser;
const getBrowserPlugins = defaultConnfig.getBrowserPlugins;
const languages = [
'zh-tw',
@ -33,7 +34,14 @@ module.exports = withBrowserDefaults({
entry: {
extension: './src/extension.browser.ts',
},
resolve: {
fallback: {
os: false
}
},
plugins: [
...getBrowserPlugins(), // add plugins, don't replace inherited
// @ts-ignore
new CopyPlugin({
patterns: [
@ -62,7 +70,7 @@ module.exports = withBrowserDefaults({
from: '../node_modules/typescript/lib/tsserver.js',
to: 'typescript/tsserver.web.js',
transform: (content) => {
return Terser.minify(content.toString()).code;
return Terser.minify(content.toString()).then(output => output.code);
},
transformPath: (targetPath) => {

View File

@ -35,7 +35,7 @@
"semver": "5.5.1",
"typescript-vscode-sh-plugin": "^0.7.3",
"vscode-extension-telemetry": "0.1.7",
"vscode-nls": "^4.1.1"
"vscode-nls": "^5.0.0"
},
"devDependencies": {
"@types/node": "14.x",

View File

@ -138,7 +138,8 @@ export class TypeScriptServiceConfiguration {
const pathPrefixes = ['~' + path.sep];
for (const pathPrefix of pathPrefixes) {
if (inspectValue.startsWith(pathPrefix)) {
return path.join(os.homedir(), inspectValue.slice(pathPrefix.length));
const homedir = typeof os.homedir === 'function' ? os.homedir() : ''; // no os.homedir in the browser #128222
return path.join(homedir, inspectValue.slice(pathPrefix.length));
}
}
return inspectValue;

View File

@ -110,7 +110,7 @@ vscode-extension-telemetry@0.1.7:
dependencies:
applicationinsights "1.7.4"
vscode-nls@^4.1.1:
version "4.1.2"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.2.tgz#ca8bf8bb82a0987b32801f9fddfdd2fb9fd3c167"
integrity sha512-7bOHxPsfyuCqmP+hZXscLhiHwe7CSuFE4hyhbs22xPIhQ4jv99FcR4eBzfYYVLP356HNFpdvz63FFb/xw6T4Iw==
vscode-nls@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.0.0.tgz#99f0da0bd9ea7cda44e565a74c54b1f2bc257840"
integrity sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==

View File

@ -178,6 +178,7 @@
"opn": "^6.0.0",
"optimist": "0.3.5",
"p-all": "^1.0.0",
"path-browserify": "^1.0.1",
"playwright": "1.12.3",
"pump": "^1.0.1",
"queue": "3.0.6",
@ -191,6 +192,7 @@
"style-loader": "^1.0.0",
"ts-loader": "^9.2.3",
"tsec": "0.1.4",
"util": "^0.12.4",
"typescript": "^4.4.0-dev.20210607",
"typescript-formatter": "7.1.0",
"underscore": "^1.12.1",

195
yarn.lock
View File

@ -1557,6 +1557,11 @@ atob@^2.1.2:
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
available-typed-arrays@^1.0.2:
version "1.0.4"
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.4.tgz#9e0ae84ecff20caae6a94a1c3bc39b955649b7a9"
integrity sha512-SA5mXJWrId1TaQjfxUYghbqQ/hYioKmLJvPJyDuYRtXXenFNMjj4hSSt1Cf1xsuXSXrtxrVC5Ot4eU6cOtBDdA==
aws-sign2@~0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
@ -1975,6 +1980,14 @@ call-bind@^1.0.0:
function-bind "^1.1.1"
get-intrinsic "^1.0.0"
call-bind@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==
dependencies:
function-bind "^1.1.1"
get-intrinsic "^1.0.2"
caller-callsite@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134"
@ -3378,6 +3391,28 @@ es-abstract@^1.18.0-next.1:
string.prototype.trimend "^1.0.1"
string.prototype.trimstart "^1.0.1"
es-abstract@^1.18.0-next.2:
version "1.18.3"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.3.tgz#25c4c3380a27aa203c44b2b685bba94da31b63e0"
integrity sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==
dependencies:
call-bind "^1.0.2"
es-to-primitive "^1.2.1"
function-bind "^1.1.1"
get-intrinsic "^1.1.1"
has "^1.0.3"
has-symbols "^1.0.2"
is-callable "^1.2.3"
is-negative-zero "^2.0.1"
is-regex "^1.1.3"
is-string "^1.0.6"
object-inspect "^1.10.3"
object-keys "^1.1.1"
object.assign "^4.1.2"
string.prototype.trimend "^1.0.4"
string.prototype.trimstart "^1.0.4"
unbox-primitive "^1.0.1"
es-module-lexer@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.6.0.tgz#e72ab05b7412e62b9be37c37a09bdb6000d706f0"
@ -4189,6 +4224,11 @@ for-own@^1.0.0:
dependencies:
for-in "^1.0.1"
foreach@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k=
forever-agent@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
@ -4356,6 +4396,15 @@ get-intrinsic@^1.0.0:
has "^1.0.3"
has-symbols "^1.0.1"
get-intrinsic@^1.0.2, get-intrinsic@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6"
integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==
dependencies:
function-bind "^1.1.1"
has "^1.0.3"
has-symbols "^1.0.1"
get-stream@^4.0.0, get-stream@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
@ -4941,6 +4990,11 @@ has-ansi@^2.0.0:
dependencies:
ansi-regex "^2.0.0"
has-bigints@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113"
integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==
has-flag@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
@ -4956,6 +5010,11 @@ has-symbols@^1.0.1:
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8"
integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==
has-symbols@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423"
integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==
has-unicode@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
@ -5374,6 +5433,13 @@ is-accessor-descriptor@^1.0.0:
dependencies:
kind-of "^6.0.0"
is-arguments@^1.0.4:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9"
integrity sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==
dependencies:
call-bind "^1.0.0"
is-arrayish@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
@ -5384,6 +5450,11 @@ is-arrayish@^0.3.1:
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03"
integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==
is-bigint@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a"
integrity sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==
is-binary-path@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898"
@ -5398,6 +5469,13 @@ is-binary-path@~2.1.0:
dependencies:
binary-extensions "^2.0.0"
is-boolean-object@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.1.tgz#3c0878f035cb821228d350d2e1e36719716a3de8"
integrity sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==
dependencies:
call-bind "^1.0.2"
is-buffer@^1.1.5, is-buffer@~1.1.1:
version "1.1.6"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
@ -5408,6 +5486,11 @@ is-callable@^1.1.4, is-callable@^1.2.2:
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9"
integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==
is-callable@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e"
integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==
is-ci@^1.0.9:
version "1.2.1"
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c"
@ -5534,6 +5617,11 @@ is-fullwidth-code-point@^3.0.0:
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
is-generator-function@^1.0.7:
version "1.0.9"
resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.9.tgz#e5f82c2323673e7fcad3d12858c83c4039f6399c"
integrity sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A==
is-glob@^2.0.0, is-glob@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863"
@ -5560,11 +5648,16 @@ is-negated-glob@^1.0.0:
resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2"
integrity sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=
is-negative-zero@^2.0.0:
is-negative-zero@^2.0.0, is-negative-zero@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24"
integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==
is-number-object@^1.0.4:
version "1.0.5"
resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.5.tgz#6edfaeed7950cff19afedce9fbfca9ee6dd289eb"
integrity sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==
is-number@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
@ -5638,6 +5731,14 @@ is-regex@^1.1.1:
dependencies:
has-symbols "^1.0.1"
is-regex@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f"
integrity sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==
dependencies:
call-bind "^1.0.2"
has-symbols "^1.0.2"
is-relative@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d"
@ -5660,6 +5761,11 @@ is-stream@^2.0.0:
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3"
integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==
is-string@^1.0.5, is-string@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f"
integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==
is-symbol@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937"
@ -5667,6 +5773,24 @@ is-symbol@^1.0.2:
dependencies:
has-symbols "^1.0.1"
is-symbol@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c"
integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==
dependencies:
has-symbols "^1.0.2"
is-typed-array@^1.1.3:
version "1.1.5"
resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.5.tgz#f32e6e096455e329eb7b423862456aa213f0eb4e"
integrity sha512-S+GRDgJlR3PyEbsX/Fobd9cqpZBuvUS+8asRqYDMLCb2qMzt1oz5m5oxQCxOgUDxiWsOVNi4yaF+/uvdlHlYug==
dependencies:
available-typed-arrays "^1.0.2"
call-bind "^1.0.2"
es-abstract "^1.18.0-next.2"
foreach "^2.0.5"
has-symbols "^1.0.1"
is-typedarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
@ -7050,6 +7174,11 @@ object-copy@^0.1.0:
define-property "^0.2.5"
kind-of "^3.0.3"
object-inspect@^1.10.3:
version "1.10.3"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.3.tgz#c2aa7d2d09f50c99375704f7a0adf24c5782d369"
integrity sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==
object-inspect@^1.8.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a"
@ -7072,7 +7201,7 @@ object-visit@^1.0.0:
dependencies:
isobject "^3.0.0"
object.assign@^4.0.4, object.assign@^4.1.0, object.assign@^4.1.1:
object.assign@^4.0.4, object.assign@^4.1.0, object.assign@^4.1.1, object.assign@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940"
integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==
@ -9338,6 +9467,14 @@ string.prototype.trimend@^1.0.1:
call-bind "^1.0.0"
define-properties "^1.1.3"
string.prototype.trimend@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80"
integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==
dependencies:
call-bind "^1.0.2"
define-properties "^1.1.3"
string.prototype.trimstart@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz#9b4cb590e123bb36564401d59824298de50fd5aa"
@ -9346,6 +9483,14 @@ string.prototype.trimstart@^1.0.1:
call-bind "^1.0.0"
define-properties "^1.1.3"
string.prototype.trimstart@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed"
integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==
dependencies:
call-bind "^1.0.2"
define-properties "^1.1.3"
string_decoder@^1.0.0, string_decoder@^1.1.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
@ -9998,6 +10143,16 @@ typical@^4.0.0:
resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4"
integrity sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==
unbox-primitive@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471"
integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==
dependencies:
function-bind "^1.1.1"
has-bigints "^1.0.1"
has-symbols "^1.0.2"
which-boxed-primitive "^1.0.2"
unc-path-regex@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa"
@ -10165,6 +10320,18 @@ util@^0.11.0:
dependencies:
inherits "2.0.3"
util@^0.12.4:
version "0.12.4"
resolved "https://registry.yarnpkg.com/util/-/util-0.12.4.tgz#66121a31420df8f01ca0c464be15dfa1d1850253"
integrity sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw==
dependencies:
inherits "^2.0.3"
is-arguments "^1.0.4"
is-generator-function "^1.0.7"
is-typed-array "^1.1.3"
safe-buffer "^5.1.2"
which-typed-array "^1.1.2"
uuid@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04"
@ -10609,6 +10776,17 @@ when@^3.7.7:
resolved "https://registry.yarnpkg.com/when/-/when-3.7.8.tgz#c7130b6a7ea04693e842cdc9e7a1f2aa39a39f82"
integrity sha1-xxMLan6gRpPoQs3J56Hyqjmjn4I=
which-boxed-primitive@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6"
integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==
dependencies:
is-bigint "^1.0.1"
is-boolean-object "^1.1.0"
is-number-object "^1.0.4"
is-string "^1.0.5"
is-symbol "^1.0.3"
which-module@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f"
@ -10619,6 +10797,19 @@ which-module@^2.0.0:
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=
which-typed-array@^1.1.2:
version "1.1.4"
resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.4.tgz#8fcb7d3ee5adf2d771066fba7cf37e32fe8711ff"
integrity sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA==
dependencies:
available-typed-arrays "^1.0.2"
call-bind "^1.0.0"
es-abstract "^1.18.0-next.1"
foreach "^2.0.5"
function-bind "^1.1.1"
has-symbols "^1.0.1"
is-typed-array "^1.1.3"
which@2.0.2, which@^2.0.1:
version "2.0.2"
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"