Duh!! Static is allowed in JS.
This commit is contained in:
parent
f829f958a2
commit
ad740f226e
2 changed files with 40 additions and 191 deletions
|
@ -4552,11 +4552,45 @@ namespace FourSlashInterface {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getInJsKeywords(keywords: ReadonlyArray<ExpectedCompletionEntryObject>): ReadonlyArray<ExpectedCompletionEntryObject> {
|
||||||
|
return keywords.filter(keyword => {
|
||||||
|
switch (keyword.name) {
|
||||||
|
case "enum":
|
||||||
|
case "interface":
|
||||||
|
case "private":
|
||||||
|
case "protected":
|
||||||
|
case "public":
|
||||||
|
case "abstract":
|
||||||
|
case "any":
|
||||||
|
case "boolean":
|
||||||
|
case "declare":
|
||||||
|
case "infer":
|
||||||
|
case "is":
|
||||||
|
case "keyof":
|
||||||
|
case "module":
|
||||||
|
case "namespace":
|
||||||
|
case "never":
|
||||||
|
case "readonly":
|
||||||
|
case "number":
|
||||||
|
case "object":
|
||||||
|
case "string":
|
||||||
|
case "symbol":
|
||||||
|
case "type":
|
||||||
|
case "unique":
|
||||||
|
case "unknown":
|
||||||
|
case "global":
|
||||||
|
case "bigint":
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export const classElementKeywords: ReadonlyArray<ExpectedCompletionEntryObject> =
|
export const classElementKeywords: ReadonlyArray<ExpectedCompletionEntryObject> =
|
||||||
["private", "protected", "public", "static", "abstract", "async", "constructor", "get", "readonly", "set"].map(keywordEntry);
|
["private", "protected", "public", "static", "abstract", "async", "constructor", "get", "readonly", "set"].map(keywordEntry);
|
||||||
|
|
||||||
export const classElementInJsKeywords: ReadonlyArray<ExpectedCompletionEntryObject> =
|
export const classElementInJsKeywords = getInJsKeywords(classElementKeywords);
|
||||||
["async", "constructor", "get", "set"].map(keywordEntry);
|
|
||||||
|
|
||||||
export const constructorParameterKeywords: ReadonlyArray<ExpectedCompletionEntryObject> =
|
export const constructorParameterKeywords: ReadonlyArray<ExpectedCompletionEntryObject> =
|
||||||
["private", "protected", "public", "readonly"].map((name): ExpectedCompletionEntryObject => ({ name, kind: "keyword" }));
|
["private", "protected", "public", "readonly"].map((name): ExpectedCompletionEntryObject => ({ name, kind: "keyword" }));
|
||||||
|
@ -4695,58 +4729,7 @@ namespace FourSlashInterface {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export const statementInJsKeywords: ReadonlyArray<ExpectedCompletionEntryObject> = [
|
export const statementInJsKeywords = getInJsKeywords(statementKeywords);
|
||||||
"break",
|
|
||||||
"case",
|
|
||||||
"catch",
|
|
||||||
"class",
|
|
||||||
"const",
|
|
||||||
"continue",
|
|
||||||
"debugger",
|
|
||||||
"default",
|
|
||||||
"delete",
|
|
||||||
"do",
|
|
||||||
"else",
|
|
||||||
"enum",
|
|
||||||
"export",
|
|
||||||
"extends",
|
|
||||||
"false",
|
|
||||||
"finally",
|
|
||||||
"for",
|
|
||||||
"function",
|
|
||||||
"if",
|
|
||||||
"import",
|
|
||||||
"in",
|
|
||||||
"instanceof",
|
|
||||||
"new",
|
|
||||||
"null",
|
|
||||||
"return",
|
|
||||||
"super",
|
|
||||||
"switch",
|
|
||||||
"this",
|
|
||||||
"throw",
|
|
||||||
"true",
|
|
||||||
"try",
|
|
||||||
"typeof",
|
|
||||||
"var",
|
|
||||||
"void",
|
|
||||||
"while",
|
|
||||||
"with",
|
|
||||||
"implements",
|
|
||||||
"interface",
|
|
||||||
"let",
|
|
||||||
"package",
|
|
||||||
"yield",
|
|
||||||
"as",
|
|
||||||
"async",
|
|
||||||
"await",
|
|
||||||
"constructor",
|
|
||||||
"get",
|
|
||||||
"require",
|
|
||||||
"set",
|
|
||||||
"from",
|
|
||||||
"of",
|
|
||||||
].map(keywordEntry);
|
|
||||||
|
|
||||||
export const globalsVars: ReadonlyArray<ExpectedCompletionEntryObject> = [
|
export const globalsVars: ReadonlyArray<ExpectedCompletionEntryObject> = [
|
||||||
functionEntry("eval"),
|
functionEntry("eval"),
|
||||||
|
@ -4849,49 +4832,7 @@ namespace FourSlashInterface {
|
||||||
...globalKeywordsInsideFunction,
|
...globalKeywordsInsideFunction,
|
||||||
];
|
];
|
||||||
|
|
||||||
const globalInJsKeywordsInsideFunction: ReadonlyArray<ExpectedCompletionEntryObject> = [
|
const globalInJsKeywordsInsideFunction = getInJsKeywords(globalKeywordsInsideFunction);
|
||||||
"break",
|
|
||||||
"case",
|
|
||||||
"catch",
|
|
||||||
"class",
|
|
||||||
"const",
|
|
||||||
"continue",
|
|
||||||
"debugger",
|
|
||||||
"default",
|
|
||||||
"delete",
|
|
||||||
"do",
|
|
||||||
"else",
|
|
||||||
"export",
|
|
||||||
"extends",
|
|
||||||
"false",
|
|
||||||
"finally",
|
|
||||||
"for",
|
|
||||||
"function",
|
|
||||||
"if",
|
|
||||||
"import",
|
|
||||||
"in",
|
|
||||||
"instanceof",
|
|
||||||
"new",
|
|
||||||
"null",
|
|
||||||
"return",
|
|
||||||
"super",
|
|
||||||
"switch",
|
|
||||||
"this",
|
|
||||||
"throw",
|
|
||||||
"true",
|
|
||||||
"try",
|
|
||||||
"typeof",
|
|
||||||
"var",
|
|
||||||
"void",
|
|
||||||
"while",
|
|
||||||
"with",
|
|
||||||
"implements",
|
|
||||||
"let",
|
|
||||||
"package",
|
|
||||||
"yield",
|
|
||||||
"async",
|
|
||||||
"await",
|
|
||||||
].map(keywordEntry);
|
|
||||||
|
|
||||||
// TODO: many of these are inappropriate to always provide
|
// TODO: many of these are inappropriate to always provide
|
||||||
export const globalsInJsInsideFunction = (plus: ReadonlyArray<ExpectedCompletionEntry>): ReadonlyArray<ExpectedCompletionEntry> => [
|
export const globalsInJsInsideFunction = (plus: ReadonlyArray<ExpectedCompletionEntry>): ReadonlyArray<ExpectedCompletionEntry> => [
|
||||||
|
@ -4981,56 +4922,7 @@ namespace FourSlashInterface {
|
||||||
"of",
|
"of",
|
||||||
].map(keywordEntry);
|
].map(keywordEntry);
|
||||||
|
|
||||||
export const globalInJsKeywords: ReadonlyArray<ExpectedCompletionEntryObject> = [
|
export const globalInJsKeywords = getInJsKeywords(globalKeywords);
|
||||||
"break",
|
|
||||||
"case",
|
|
||||||
"catch",
|
|
||||||
"class",
|
|
||||||
"const",
|
|
||||||
"continue",
|
|
||||||
"debugger",
|
|
||||||
"default",
|
|
||||||
"delete",
|
|
||||||
"do",
|
|
||||||
"else",
|
|
||||||
"export",
|
|
||||||
"extends",
|
|
||||||
"false",
|
|
||||||
"finally",
|
|
||||||
"for",
|
|
||||||
"function",
|
|
||||||
"if",
|
|
||||||
"import",
|
|
||||||
"in",
|
|
||||||
"instanceof",
|
|
||||||
"new",
|
|
||||||
"null",
|
|
||||||
"return",
|
|
||||||
"super",
|
|
||||||
"switch",
|
|
||||||
"this",
|
|
||||||
"throw",
|
|
||||||
"true",
|
|
||||||
"try",
|
|
||||||
"typeof",
|
|
||||||
"var",
|
|
||||||
"void",
|
|
||||||
"while",
|
|
||||||
"with",
|
|
||||||
"implements",
|
|
||||||
"let",
|
|
||||||
"package",
|
|
||||||
"yield",
|
|
||||||
"as",
|
|
||||||
"async",
|
|
||||||
"await",
|
|
||||||
"constructor",
|
|
||||||
"get",
|
|
||||||
"require",
|
|
||||||
"set",
|
|
||||||
"from",
|
|
||||||
"of",
|
|
||||||
].map(keywordEntry);
|
|
||||||
|
|
||||||
export const insideMethodKeywords: ReadonlyArray<ExpectedCompletionEntryObject> = [
|
export const insideMethodKeywords: ReadonlyArray<ExpectedCompletionEntryObject> = [
|
||||||
"break",
|
"break",
|
||||||
|
@ -5078,49 +4970,7 @@ namespace FourSlashInterface {
|
||||||
"await",
|
"await",
|
||||||
].map(keywordEntry);
|
].map(keywordEntry);
|
||||||
|
|
||||||
export const insideMethodInJsKeywords: ReadonlyArray<ExpectedCompletionEntryObject> = [
|
export const insideMethodInJsKeywords = getInJsKeywords(insideMethodKeywords);
|
||||||
"break",
|
|
||||||
"case",
|
|
||||||
"catch",
|
|
||||||
"class",
|
|
||||||
"const",
|
|
||||||
"continue",
|
|
||||||
"debugger",
|
|
||||||
"default",
|
|
||||||
"delete",
|
|
||||||
"do",
|
|
||||||
"else",
|
|
||||||
"export",
|
|
||||||
"extends",
|
|
||||||
"false",
|
|
||||||
"finally",
|
|
||||||
"for",
|
|
||||||
"function",
|
|
||||||
"if",
|
|
||||||
"import",
|
|
||||||
"in",
|
|
||||||
"instanceof",
|
|
||||||
"new",
|
|
||||||
"null",
|
|
||||||
"return",
|
|
||||||
"super",
|
|
||||||
"switch",
|
|
||||||
"this",
|
|
||||||
"throw",
|
|
||||||
"true",
|
|
||||||
"try",
|
|
||||||
"typeof",
|
|
||||||
"var",
|
|
||||||
"void",
|
|
||||||
"while",
|
|
||||||
"with",
|
|
||||||
"implements",
|
|
||||||
"let",
|
|
||||||
"package",
|
|
||||||
"yield",
|
|
||||||
"async",
|
|
||||||
"await",
|
|
||||||
].map(keywordEntry);
|
|
||||||
|
|
||||||
export const globalKeywordsPlusUndefined: ReadonlyArray<ExpectedCompletionEntryObject> = (() => {
|
export const globalKeywordsPlusUndefined: ReadonlyArray<ExpectedCompletionEntryObject> = (() => {
|
||||||
const i = ts.findIndex(globalKeywords, x => x.name === "unique");
|
const i = ts.findIndex(globalKeywords, x => x.name === "unique");
|
||||||
|
|
|
@ -2002,7 +2002,6 @@ namespace ts.Completions {
|
||||||
case SyntaxKind.ProtectedKeyword:
|
case SyntaxKind.ProtectedKeyword:
|
||||||
case SyntaxKind.PublicKeyword:
|
case SyntaxKind.PublicKeyword:
|
||||||
case SyntaxKind.ReadonlyKeyword:
|
case SyntaxKind.ReadonlyKeyword:
|
||||||
case SyntaxKind.StaticKeyword:
|
|
||||||
case SyntaxKind.StringKeyword:
|
case SyntaxKind.StringKeyword:
|
||||||
case SyntaxKind.SymbolKeyword:
|
case SyntaxKind.SymbolKeyword:
|
||||||
case SyntaxKind.TypeKeyword:
|
case SyntaxKind.TypeKeyword:
|
||||||
|
|
Loading…
Reference in a new issue