Skip to content

Commit 29dba75

Browse files
vushuWebFreak001
authored andcommitted
UFCS using new completion kind F
1 parent 642a0e0 commit 29dba75

File tree

8 files changed

+19
-14
lines changed

8 files changed

+19
-14
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ tab character, followed by a completion kind
132132
* m - member variable name
133133
* k - keyword, built-in version, scope statement
134134
* f - function or method
135+
* F - UFCS function
135136
* g - enum name
136137
* e - enum member
137138
* P - package name

dsymbol/src/dsymbol/conversion/second.d

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ void secondPass(SemanticSymbol* currentSymbol, Scope* moduleScope, ref ModuleCac
4747
case variableName:
4848
case memberVariableName:
4949
case functionName:
50+
case ufcsName:
5051
case aliasName:
5152
// type may not be null in the case of a renamed import
5253
if (currentSymbol.acSymbol.type is null)

dsymbol/src/dsymbol/symbol.d

+3
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ enum CompletionKind : char
7575
/// function or method
7676
functionName = 'f',
7777

78+
/// UFCS function
79+
ufcsName = 'F',
80+
7881
/// enum name
7982
enumName = 'g',
8083

src/dcd/server/autocomplete/ufcs.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void lookupUFCS(Scope* completionScope, DSymbol* beforeDotSymbol, size_t cursorP
2323

2424
AutocompleteResponse.Completion createCompletionForUFCS(const DSymbol* symbol)
2525
{
26-
return AutocompleteResponse.Completion(symbol.name, symbol.kind, "(UFCS) " ~ symbol.callTip, symbol
26+
return AutocompleteResponse.Completion(symbol.name, CompletionKind.ufcsName, symbol.callTip, symbol
2727
.symbolFile, symbol
2828
.location, symbol
2929
.doc);

tests/tc006/expected1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
identifiers
22
alignof k
3-
doStuff f
3+
doStuff F
44
init k
55
mangleof k
66
max k

tests/tc006/expected3.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
identifiers
22
alignof k
3-
doStuff f
3+
doStuff F
44
init k
55
mangleof k
66
max k

tests/tc_erroneous_body_content/expected2.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
identifiers
22
a v
33
alignof k
4-
foo f
4+
foo F
55
init k
66
mangleof k
77
sizeof k
+10-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
identifiers
22
alignof k
33
fooHey f
4-
hasArgname f
4+
hasArgname F
55
init k
66
mangleof k
77
sizeof k
88
stringof k
99
tupleof k
10-
u f
11-
ufcsBar f
12-
ufcsBarRef f
13-
ufcsBarRefConst f
14-
ufcsBarRefConstWrapped f
15-
ufcsBarRefImmuttableWrapped f
16-
ufcsBarReturnScope f
17-
ufcsBarScope f
18-
ufcsHello f
10+
u F
11+
ufcsBar F
12+
ufcsBarRef F
13+
ufcsBarRefConst F
14+
ufcsBarRefConstWrapped F
15+
ufcsBarRefImmuttableWrapped F
16+
ufcsBarReturnScope F
17+
ufcsBarScope F
18+
ufcsHello F

0 commit comments

Comments
 (0)