diff --git a/README.md b/README.md index 612741b..d56595a 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,7 @@ tab character, followed by a completion kind * m - member variable name * k - keyword, built-in version, scope statement * f - function or method +* F - UFCS function * g - enum name * e - enum member * P - package name diff --git a/dsymbol/src/dsymbol/conversion/second.d b/dsymbol/src/dsymbol/conversion/second.d index bd56763..933bfef 100644 --- a/dsymbol/src/dsymbol/conversion/second.d +++ b/dsymbol/src/dsymbol/conversion/second.d @@ -47,6 +47,7 @@ void secondPass(SemanticSymbol* currentSymbol, Scope* moduleScope, ref ModuleCac case variableName: case memberVariableName: case functionName: + case ufcsName: case aliasName: // type may not be null in the case of a renamed import if (currentSymbol.acSymbol.type is null) diff --git a/dsymbol/src/dsymbol/symbol.d b/dsymbol/src/dsymbol/symbol.d index 44263e1..6f56e0f 100644 --- a/dsymbol/src/dsymbol/symbol.d +++ b/dsymbol/src/dsymbol/symbol.d @@ -75,6 +75,9 @@ enum CompletionKind : char /// function or method functionName = 'f', + /// UFCS function + ufcsName = 'F', + /// enum name enumName = 'g', diff --git a/src/dcd/server/autocomplete/ufcs.d b/src/dcd/server/autocomplete/ufcs.d index f48893e..8a38911 100644 --- a/src/dcd/server/autocomplete/ufcs.d +++ b/src/dcd/server/autocomplete/ufcs.d @@ -23,7 +23,7 @@ void lookupUFCS(Scope* completionScope, DSymbol* beforeDotSymbol, size_t cursorP 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 .location, symbol .doc); diff --git a/tests/tc006/expected1.txt b/tests/tc006/expected1.txt index 672fb58..940999a 100644 --- a/tests/tc006/expected1.txt +++ b/tests/tc006/expected1.txt @@ -1,6 +1,6 @@ identifiers alignof k -doStuff f +doStuff F init k mangleof k max k diff --git a/tests/tc006/expected3.txt b/tests/tc006/expected3.txt index 672fb58..940999a 100644 --- a/tests/tc006/expected3.txt +++ b/tests/tc006/expected3.txt @@ -1,6 +1,6 @@ identifiers alignof k -doStuff f +doStuff F init k mangleof k max k diff --git a/tests/tc_erroneous_body_content/expected2.txt b/tests/tc_erroneous_body_content/expected2.txt index 43fa6fe..fb8d7dd 100644 --- a/tests/tc_erroneous_body_content/expected2.txt +++ b/tests/tc_erroneous_body_content/expected2.txt @@ -1,7 +1,7 @@ identifiers a v alignof k -foo f +foo F init k mangleof k sizeof k diff --git a/tests/tc_ufcs_completions/expected.txt b/tests/tc_ufcs_completions/expected.txt index f18c531..01eae0a 100644 --- a/tests/tc_ufcs_completions/expected.txt +++ b/tests/tc_ufcs_completions/expected.txt @@ -1,18 +1,18 @@ identifiers alignof k fooHey f -hasArgname f +hasArgname F init k mangleof k sizeof k stringof k tupleof k -u f -ufcsBar f -ufcsBarRef f -ufcsBarRefConst f -ufcsBarRefConstWrapped f -ufcsBarRefImmuttableWrapped f -ufcsBarReturnScope f -ufcsBarScope f -ufcsHello f +u F +ufcsBar F +ufcsBarRef F +ufcsBarRefConst F +ufcsBarRefConstWrapped F +ufcsBarRefImmuttableWrapped F +ufcsBarReturnScope F +ufcsBarScope F +ufcsHello F