commit
70c78a2a10
2
dsymbol
2
dsymbol
|
@ -1 +1 @@
|
||||||
Subproject commit 6aca66ef031cca3687df8f022e8c04a33fa7c263
|
Subproject commit 4ac656541a719c27cf549fddcb1e85cf702ce804
|
|
@ -819,6 +819,22 @@ void setCompletions(T)(ref AutocompleteResponse response,
|
||||||
Scope* completionScope, T tokens, size_t cursorPosition,
|
Scope* completionScope, T tokens, size_t cursorPosition,
|
||||||
CompletionType completionType, bool isBracket = false, string partial = null)
|
CompletionType completionType, bool isBracket = false, string partial = null)
|
||||||
{
|
{
|
||||||
|
static void addSymToResponse(DSymbol* s, ref AutocompleteResponse r, string p)
|
||||||
|
{
|
||||||
|
foreach (sym; s.opSlice())
|
||||||
|
{
|
||||||
|
if (sym.name !is null && sym.name.length > 0 && sym.kind != CompletionKind.importSymbol
|
||||||
|
&& (p is null ? true : sym.name.toUpper().startsWith(p.toUpper()))
|
||||||
|
&& !r.completions.canFind(sym.name))
|
||||||
|
{
|
||||||
|
r.completionKinds ~= sym.kind;
|
||||||
|
r.completions ~= sym.name.dup;
|
||||||
|
}
|
||||||
|
if (sym.kind == CompletionKind.importSymbol && !sym.skipOver && sym.type !is null)
|
||||||
|
addSymToResponse(sym.type, r, p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Handle the simple case where we get all symbols in scope and filter it
|
// Handle the simple case where we get all symbols in scope and filter it
|
||||||
// based on the currently entered text.
|
// based on the currently entered text.
|
||||||
if (partial !is null && tokens.length == 0)
|
if (partial !is null && tokens.length == 0)
|
||||||
|
@ -854,16 +870,7 @@ void setCompletions(T)(ref AutocompleteResponse response,
|
||||||
if (symbols.length == 0)
|
if (symbols.length == 0)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
foreach (sym; symbols[0].opSlice())
|
addSymToResponse(symbols[0], response, partial);
|
||||||
{
|
|
||||||
if (sym.name !is null && sym.name.length > 0 && sym.kind != CompletionKind.importSymbol
|
|
||||||
&& (partial is null ? true : sym.name.toUpper().startsWith(partial.toUpper()))
|
|
||||||
&& !response.completions.canFind(sym.name))
|
|
||||||
{
|
|
||||||
response.completionKinds ~= sym.kind;
|
|
||||||
response.completions ~= sym.name.dup;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
response.completionType = CompletionType.identifiers;
|
response.completionType = CompletionType.identifiers;
|
||||||
}
|
}
|
||||||
else if (completionType == CompletionType.calltips)
|
else if (completionType == CompletionType.calltips)
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
module a;
|
||||||
|
public import b;
|
||||||
|
string FOO;
|
|
@ -0,0 +1,6 @@
|
||||||
|
module b;
|
||||||
|
string BAR;
|
||||||
|
|
||||||
|
struct S {
|
||||||
|
int x;
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
identifiers
|
||||||
|
BAR v
|
||||||
|
FOO v
|
||||||
|
S s
|
|
@ -0,0 +1,3 @@
|
||||||
|
module main;
|
||||||
|
import mod = a;
|
||||||
|
mod.
|
|
@ -0,0 +1,5 @@
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
|
|
||||||
|
../../bin/dcd-client file.d -c33 > actual.txt
|
||||||
|
diff actual.txt expected.txt
|
Loading…
Reference in New Issue