mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
[html] jquery completions no longer work. Fixes #58299
This commit is contained in:
@@ -18,10 +18,13 @@ import * as ts from 'typescript';
|
||||
import { join } from 'path';
|
||||
|
||||
const FILE_NAME = 'vscode://javascript/1'; // the same 'file' is used for all contents
|
||||
const JQUERY_D_TS = join(__dirname, '../../lib/jquery.d.ts');
|
||||
|
||||
const JS_WORD_REGEX = /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g;
|
||||
|
||||
let jquery_d_ts = join(__dirname, '../lib/jquery.d.ts'); // when packaged
|
||||
if (!ts.sys.fileExists(jquery_d_ts)) {
|
||||
jquery_d_ts = join(__dirname, '../../lib/jquery.d.ts'); // from source
|
||||
}
|
||||
|
||||
export function getJavaScriptMode(documentRegions: LanguageModelCache<HTMLDocumentRegions>, workspace: Workspace): LanguageMode {
|
||||
let jsDocuments = getLanguageModelCache<TextDocument>(10, 60, document => documentRegions.get(document).getEmbeddedDocument('javascript'));
|
||||
|
||||
@@ -36,7 +39,7 @@ export function getJavaScriptMode(documentRegions: LanguageModelCache<HTMLDocume
|
||||
}
|
||||
const host: ts.LanguageServiceHost = {
|
||||
getCompilationSettings: () => compilerOptions,
|
||||
getScriptFileNames: () => [FILE_NAME, JQUERY_D_TS],
|
||||
getScriptFileNames: () => [FILE_NAME, jquery_d_ts],
|
||||
getScriptKind: () => ts.ScriptKind.JS,
|
||||
getScriptVersion: (fileName: string) => {
|
||||
if (fileName === FILE_NAME) {
|
||||
|
||||
Reference in New Issue
Block a user