mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-11 10:46:28 -05:00
fix tests
This commit is contained in:
@@ -38471,7 +38471,7 @@ namespace ts {
|
||||
/**
|
||||
* @param member Existing member node to be checked.
|
||||
* Note: `member` cannot be a synthetic node.
|
||||
*/
|
||||
*/
|
||||
function checkExistingMemberForOverrideModifier(
|
||||
node: ClassLikeDeclaration,
|
||||
staticType: ObjectType,
|
||||
|
||||
@@ -2290,10 +2290,6 @@ namespace FourSlash {
|
||||
if (this.testType === FourSlashTestType.Server) {
|
||||
(this.languageService as ts.server.SessionClient).setFormattingOptions(this.formatCodeSettings);
|
||||
}
|
||||
else {
|
||||
throw Error(`'setFormatOptions' is not implemented for test type ${formatTestType(this.testType)}.
|
||||
Try setting options via compiler options.`);
|
||||
}
|
||||
return oldFormatCodeOptions;
|
||||
}
|
||||
|
||||
@@ -4608,17 +4604,4 @@ Try setting options via compiler options.`);
|
||||
});
|
||||
return emTarget;
|
||||
}
|
||||
|
||||
function formatTestType(testType: FourSlashTestType): string {
|
||||
switch (testType) {
|
||||
case FourSlashTestType.Native:
|
||||
return "Native";
|
||||
case FourSlashTestType.Shims:
|
||||
return "Shims";
|
||||
case FourSlashTestType.ShimsWithPreprocess:
|
||||
return "ShimsWithPreprocess";
|
||||
case FourSlashTestType.Server:
|
||||
return "Server";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -697,19 +697,10 @@ namespace ts.Completions {
|
||||
}
|
||||
}
|
||||
|
||||
if (isClassLikeMemberCompletion(symbol, location)) {
|
||||
if (preferences.includeCompletionsWithInsertText && isClassLikeMemberCompletion(symbol, location)) {
|
||||
({ insertText, isSnippet } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken));
|
||||
}
|
||||
|
||||
if (insertText !== undefined && !preferences.includeCompletionsWithInsertText) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (originIsExport(origin) || originIsResolvedExport(origin)) {
|
||||
data = originToCompletionEntryData(origin);
|
||||
hasAction = !importCompletionNode;
|
||||
}
|
||||
|
||||
const kind = SymbolDisplay.getSymbolKind(typeChecker, symbol, location);
|
||||
if (kind === ScriptElementKind.jsxAttribute && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
|
||||
let useBraces = preferences.jsxAttributeCompletionStyle === "braces";
|
||||
@@ -741,6 +732,15 @@ namespace ts.Completions {
|
||||
}
|
||||
}
|
||||
|
||||
if (insertText !== undefined && !preferences.includeCompletionsWithInsertText) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (originIsExport(origin) || originIsResolvedExport(origin)) {
|
||||
data = originToCompletionEntryData(origin);
|
||||
hasAction = !importCompletionNode;
|
||||
}
|
||||
|
||||
// TODO(drosen): Right now we just permit *all* semantic meanings when calling
|
||||
// 'getSymbolKind' which is permissible given that it is backwards compatible; but
|
||||
// really we should consider passing the meaning for the node so that we don't report
|
||||
@@ -786,7 +786,7 @@ namespace ts.Completions {
|
||||
`class C {
|
||||
m|
|
||||
}`
|
||||
`location` is an identifier declaration,
|
||||
`location` is an identifier,
|
||||
`location.parent` is a class element declaration,
|
||||
and `location.parent.parent` is a class-like declaration.
|
||||
In
|
||||
@@ -798,9 +798,21 @@ namespace ts.Completions {
|
||||
and `location.parent` is a class-like declaration.
|
||||
*/
|
||||
return !!(symbol.flags & memberFlags) &&
|
||||
(isClassLike(location) ||
|
||||
(location.parent && location.parent.parent && isClassElement(location.parent) && isClassLike(location.parent.parent)) ||
|
||||
(location.parent && isSyntaxList(location) && isClassLike(location.parent)));
|
||||
(
|
||||
isClassLike(location) ||
|
||||
(
|
||||
location.parent &&
|
||||
location.parent.parent &&
|
||||
isClassElement(location.parent) &&
|
||||
location === location.parent.name &&
|
||||
isClassLike(location.parent.parent)
|
||||
) ||
|
||||
(
|
||||
location.parent &&
|
||||
isSyntaxList(location) &&
|
||||
isClassLike(location.parent)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function getEntryForMemberCompletion(
|
||||
@@ -965,7 +977,7 @@ namespace ts.Completions {
|
||||
function addSnippets(nodes: Node[]): void {
|
||||
let order = 1;
|
||||
for (const node of nodes) {
|
||||
addSnippetsWorker(node, undefined);
|
||||
addSnippetsWorker(node, /*parent*/ undefined);
|
||||
}
|
||||
|
||||
function addSnippetsWorker(node: Node, parent: Node | undefined) {
|
||||
|
||||
Reference in New Issue
Block a user