mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 19:18:32 -05:00
Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)
* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 * fix config changes * fix strictnull checks
This commit is contained in:
@@ -6,8 +6,7 @@
|
||||
import { ITextMateService } from 'vs/workbench/services/textMate/common/textMateService';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { AbstractTextMateService } from 'vs/workbench/services/textMate/browser/abstractTextMateService';
|
||||
import * as vscodeTextmate from 'vscode-textmate';
|
||||
import * as onigasm from 'onigasm-umd';
|
||||
import { IOnigLib } from 'vscode-textmate';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
@@ -34,21 +33,25 @@ export class TextMateService extends AbstractTextMateService {
|
||||
return import('vscode-textmate');
|
||||
}
|
||||
|
||||
protected _loadOnigLib(): Promise<vscodeTextmate.IOnigLib> | undefined {
|
||||
protected _loadOnigLib(): Promise<IOnigLib> | undefined {
|
||||
return loadOnigasm();
|
||||
}
|
||||
}
|
||||
|
||||
let onigasmPromise: Promise<vscodeTextmate.IOnigLib> | null = null;
|
||||
async function loadOnigasm(): Promise<vscodeTextmate.IOnigLib> {
|
||||
let onigasmPromise: Promise<IOnigLib> | null = null;
|
||||
async function loadOnigasm(): Promise<IOnigLib> {
|
||||
if (!onigasmPromise) {
|
||||
onigasmPromise = doLoadOnigasm();
|
||||
}
|
||||
return onigasmPromise;
|
||||
}
|
||||
|
||||
async function doLoadOnigasm(): Promise<vscodeTextmate.IOnigLib> {
|
||||
const wasmBytes = await loadOnigasmWASM();
|
||||
async function doLoadOnigasm(): Promise<IOnigLib> {
|
||||
const [wasmBytes, onigasm] = await Promise.all([
|
||||
loadOnigasmWASM(),
|
||||
import('onigasm-umd')
|
||||
]);
|
||||
|
||||
await onigasm.loadWASM(wasmBytes);
|
||||
return {
|
||||
createOnigScanner(patterns: string[]) { return new onigasm.OnigScanner(patterns); },
|
||||
|
||||
Reference in New Issue
Block a user