This commit is contained in:
Hackerpilot 2016-02-25 13:00:30 -08:00
parent 6a88b65854
commit 8795b2697e
4 changed files with 15 additions and 4 deletions

View File

@ -599,7 +599,8 @@ body
{ {
auto a = DSymbol(sy.name); auto a = DSymbol(sy.name);
if (!builtinSymbols.contains(&a) && sy.name !is null && !h.contains(sy.name) if (!builtinSymbols.contains(&a) && sy.name !is null && !h.contains(sy.name)
&& sy.name != CONSTRUCTOR_SYMBOL_NAME) && !sy.skipOver && sy.name != CONSTRUCTOR_SYMBOL_NAME
&& isPublicCompletionKind(sy.kind))
{ {
response.completionKinds ~= sy.kind; response.completionKinds ~= sy.kind;
response.completions ~= sy.name; response.completions ~= sy.name;
@ -607,10 +608,10 @@ body
} }
} }
foreach (s; symbols.opSlice()) foreach (s; symbols.opSlice().filter!(a => !a.skipOver))
{ {
if (s.kind == CompletionKind.importSymbol && s.type !is null) if (s.kind == CompletionKind.importSymbol && s.type !is null)
foreach (sy; s.type.opSlice()) foreach (sy; s.type.opSlice().filter!(a => !a.skipOver))
addSymbolToResponses(sy); addSymbolToResponses(sy);
else else
addSymbolToResponses(s); addSymbolToResponses(s);
@ -938,7 +939,7 @@ void setCompletions(T)(ref AutocompleteResponse response,
return; return;
foreach (sym; s.opSlice()) foreach (sym; s.opSlice())
{ {
if (sym.name !is null && sym.name.length > 0 && sym.kind != CompletionKind.importSymbol if (sym.name !is null && sym.name.length > 0 && isPublicCompletionKind(sym.kind)
&& (p is null ? true : sym.name.toUpper().startsWith(p.toUpper())) && (p is null ? true : sym.name.toUpper().startsWith(p.toUpper()))
&& !r.completions.canFind(sym.name) && !r.completions.canFind(sym.name)
&& sym.name[0] != '*') && sym.name[0] != '*')

View File

@ -0,0 +1,4 @@
identifiers
BAR v
FOO v
S s

1
tests/tc030/file.d Normal file
View File

@ -0,0 +1 @@
import a :

5
tests/tc030/run.sh Executable file
View File

@ -0,0 +1,5 @@
set -e
set -u
../../bin/dcd-client $1 file.d -c11 > actual1.txt
diff actual1.txt expected1.txt