UFCS using new completion kind F

This commit is contained in:
davu 2022-10-17 01:18:11 +02:00 committed by Jan Jurzitza
parent 642a0e0a14
commit 29dba75ce9
8 changed files with 19 additions and 14 deletions

View File

@ -132,6 +132,7 @@ tab character, followed by a completion kind
* m - member variable name * m - member variable name
* k - keyword, built-in version, scope statement * k - keyword, built-in version, scope statement
* f - function or method * f - function or method
* F - UFCS function
* g - enum name * g - enum name
* e - enum member * e - enum member
* P - package name * P - package name

View File

@ -47,6 +47,7 @@ void secondPass(SemanticSymbol* currentSymbol, Scope* moduleScope, ref ModuleCac
case variableName: case variableName:
case memberVariableName: case memberVariableName:
case functionName: case functionName:
case ufcsName:
case aliasName: case aliasName:
// type may not be null in the case of a renamed import // type may not be null in the case of a renamed import
if (currentSymbol.acSymbol.type is null) if (currentSymbol.acSymbol.type is null)

View File

@ -75,6 +75,9 @@ enum CompletionKind : char
/// function or method /// function or method
functionName = 'f', functionName = 'f',
/// UFCS function
ufcsName = 'F',
/// enum name /// enum name
enumName = 'g', enumName = 'g',

View File

@ -23,7 +23,7 @@ void lookupUFCS(Scope* completionScope, DSymbol* beforeDotSymbol, size_t cursorP
AutocompleteResponse.Completion createCompletionForUFCS(const DSymbol* symbol) AutocompleteResponse.Completion createCompletionForUFCS(const DSymbol* symbol)
{ {
return AutocompleteResponse.Completion(symbol.name, symbol.kind, "(UFCS) " ~ symbol.callTip, symbol return AutocompleteResponse.Completion(symbol.name, CompletionKind.ufcsName, symbol.callTip, symbol
.symbolFile, symbol .symbolFile, symbol
.location, symbol .location, symbol
.doc); .doc);

View File

@ -1,6 +1,6 @@
identifiers identifiers
alignof k alignof k
doStuff f doStuff F
init k init k
mangleof k mangleof k
max k max k

View File

@ -1,6 +1,6 @@
identifiers identifiers
alignof k alignof k
doStuff f doStuff F
init k init k
mangleof k mangleof k
max k max k

View File

@ -1,7 +1,7 @@
identifiers identifiers
a v a v
alignof k alignof k
foo f foo F
init k init k
mangleof k mangleof k
sizeof k sizeof k

View File

@ -1,18 +1,18 @@
identifiers identifiers
alignof k alignof k
fooHey f fooHey f
hasArgname f hasArgname F
init k init k
mangleof k mangleof k
sizeof k sizeof k
stringof k stringof k
tupleof k tupleof k
u f u F
ufcsBar f ufcsBar F
ufcsBarRef f ufcsBarRef F
ufcsBarRefConst f ufcsBarRefConst F
ufcsBarRefConstWrapped f ufcsBarRefConstWrapped F
ufcsBarRefImmuttableWrapped f ufcsBarRefImmuttableWrapped F
ufcsBarReturnScope f ufcsBarReturnScope F
ufcsBarScope f ufcsBarScope F
ufcsHello f ufcsHello F