prioritize exclude class or right of dot
This commit is contained in:
parent
615cfaa891
commit
3d7bda0ad6
|
@ -985,7 +985,6 @@ namespace ts.Completions {
|
|||
symbol.declarations.some(d => d.kind !== SyntaxKind.SourceFile && d.kind !== SyntaxKind.ModuleDeclaration && d.kind !== SyntaxKind.EnumDeclaration)) {
|
||||
addTypeProperties(typeChecker.getTypeOfSymbolAtLocation(symbol, node));
|
||||
}
|
||||
setSortTextToOptionalMember();
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -995,13 +994,11 @@ namespace ts.Completions {
|
|||
if (isMetaProperty(node) && (node.keywordToken === SyntaxKind.NewKeyword || node.keywordToken === SyntaxKind.ImportKeyword)) {
|
||||
const completion = (node.keywordToken === SyntaxKind.NewKeyword) ? "target" : "meta";
|
||||
symbols.push(typeChecker.createSymbol(SymbolFlags.Property, escapeLeadingUnderscores(completion)));
|
||||
setSortTextToOptionalMember();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isTypeLocation) {
|
||||
addTypeProperties(typeChecker.getTypeAtLocation(node));
|
||||
setSortTextToOptionalMember();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1581,7 +1578,6 @@ namespace ts.Completions {
|
|||
return type && typeChecker.getPropertiesOfType(classElementModifierFlags & ModifierFlags.Static ? typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl) : type);
|
||||
});
|
||||
symbols = filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags);
|
||||
setSortTextToOptionalMember();
|
||||
}
|
||||
|
||||
return GlobalsSearch.Success;
|
||||
|
@ -2026,7 +2022,7 @@ namespace ts.Completions {
|
|||
}
|
||||
const filteredSymbols = symbols.filter(a => !seenNames.get(a.escapedName));
|
||||
|
||||
setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, symbols);
|
||||
setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, filteredSymbols);
|
||||
|
||||
return filteredSymbols;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
verify.completions({
|
||||
marker: "a",
|
||||
exact: [
|
||||
{ name: "a", kind: "property", kindModifiers: "optional", sortText: completion.SortText.OptionalMember },
|
||||
{ name: "method", kind: "method", kindModifiers: "optional", sortText: completion.SortText.OptionalMember },
|
||||
{ name: "a", kind: "property", kindModifiers: "optional" },
|
||||
{ name: "method", kind: "method", kindModifiers: "optional" },
|
||||
],
|
||||
});
|
||||
|
|
|
@ -5,7 +5,4 @@
|
|||
////declare const x: { m?(): void };
|
||||
////x./**/
|
||||
|
||||
verify.completions({
|
||||
marker: "",
|
||||
exact: { name: 'm', kind: 'method', kindModifiers: 'declare,optional', sortText: completion.SortText.OptionalMember }
|
||||
});
|
||||
verify.completions({ marker: "", exact: "m" });
|
|
@ -18,19 +18,6 @@
|
|||
//// /*a*/
|
||||
//// }
|
||||
|
||||
//// class A implements I {
|
||||
//// /*b*/
|
||||
//// }
|
||||
|
||||
const keywordEntries = ['private', 'protected', 'public', 'static', 'abstract', 'async', 'constructor', 'get', 'readonly', 'set'].map(keyword => {
|
||||
return {
|
||||
name: keyword,
|
||||
kind: 'keyword',
|
||||
kindModifiers: '',
|
||||
sortText: completion.SortText.GlobalsOrKeywords
|
||||
}
|
||||
});
|
||||
|
||||
verify.completions(
|
||||
{
|
||||
marker: ['a'],
|
||||
|
@ -40,16 +27,5 @@ verify.completions(
|
|||
{ name: 'c', kindModifiers: 'optional', sortText: completion.SortText.OptionalMember, kind: 'property' },
|
||||
{ name: 'd', sortText: completion.SortText.LocationPriority, kind: 'property' }
|
||||
]
|
||||
},
|
||||
{
|
||||
marker: ['b'],
|
||||
isNewIdentifierLocation: true,
|
||||
exact:[
|
||||
{ name: 'B', kindModifiers: 'optional', sortText: completion.SortText.OptionalMember, kind: 'property' },
|
||||
{ name: 'a', sortText: completion.SortText.LocationPriority, kind: 'property' },
|
||||
{ name: 'c', kindModifiers: 'optional', sortText: completion.SortText.OptionalMember, kind: 'property' },
|
||||
{ name: 'd', sortText: completion.SortText.LocationPriority, kind: 'property' },
|
||||
...keywordEntries
|
||||
]
|
||||
}
|
||||
);
|
Loading…
Reference in a new issue