Fix #228
This commit is contained in:
parent
083c0c7c67
commit
c1d75abbfd
|
@ -18,3 +18,5 @@ githash.txt
|
|||
|
||||
# Test results
|
||||
tests/tc*/actual*.txt
|
||||
stderr.txt
|
||||
stdout.txt
|
||||
|
|
2
dsymbol
2
dsymbol
|
@ -1 +1 @@
|
|||
Subproject commit d6d4cc070f7a18912568048657ee513b30038725
|
||||
Subproject commit c4f0652bde7164b892dbdb0ce5f7b42eaf288d50
|
10
makefile
10
makefile
|
@ -61,15 +61,9 @@ SERVER_SRC := \
|
|||
libdparse/src/std/d/entities.d\
|
||||
libdparse/src/std/d/lexer.d\
|
||||
libdparse/src/std/d/parser.d\
|
||||
libdparse/src/std/lexer.d\
|
||||
libdparse/src/std/d/formatter.d\
|
||||
containers/src/std/experimental/allocator/mallocator.d\
|
||||
containers/src/std/experimental/allocator/package.d\
|
||||
containers/src/std/experimental/allocator/common.d\
|
||||
containers/src/std/experimental/allocator/gc_allocator.d\
|
||||
containers/src/std/experimental/allocator/building_blocks/allocator_list.d\
|
||||
containers/src/std/experimental/allocator/building_blocks/stats_collector.d\
|
||||
containers/src/std/experimental/allocator/typed.d\
|
||||
libdparse/src/std/lexer.d\
|
||||
$(shell find containers/src/std/experimental/allocator/ -name "*.d")\
|
||||
containers/src/memory/allocators.d\
|
||||
containers/src/memory/appender.d\
|
||||
containers/src/containers/dynamicarray.d\
|
||||
|
|
|
@ -736,7 +736,8 @@ DSymbol*[] getSymbolsByTokenChain(T)(Scope* completionScope,
|
|||
case tok!"identifier":
|
||||
// Use function return type instead of the function itself
|
||||
if (symbols[0].qualifier == SymbolQualifier.func
|
||||
|| symbols[0].kind == CompletionKind.functionName)
|
||||
|| symbols[0].kind == CompletionKind.functionName
|
||||
|| symbols[0].kind == CompletionKind.aliasName)
|
||||
{
|
||||
symbols = symbols[0].type is null ? [] :[symbols[0].type];
|
||||
if (symbols.length == 0)
|
||||
|
@ -853,24 +854,23 @@ void setCompletions(T)(ref AutocompleteResponse response,
|
|||
|
||||
if (completionType == CompletionType.identifiers)
|
||||
{
|
||||
if (symbols[0].qualifier == SymbolQualifier.func
|
||||
|| symbols[0].kind == CompletionKind.functionName)
|
||||
while (symbols[0].qualifier == SymbolQualifier.func
|
||||
|| symbols[0].kind == CompletionKind.functionName
|
||||
|| symbols[0].kind == CompletionKind.importSymbol
|
||||
|| symbols[0].kind == CompletionKind.aliasName)
|
||||
{
|
||||
symbols = symbols[0].type is null ? [] : [symbols[0].type];
|
||||
if (symbols.length == 0)
|
||||
return;
|
||||
}
|
||||
if (symbols[0].kind != CompletionKind.importSymbol)
|
||||
foreach (sym; symbols[0].opSlice())
|
||||
{
|
||||
foreach (sym; symbols[0].opSlice())
|
||||
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))
|
||||
{
|
||||
if (sym.name !is null && sym.name.length > 0 && sym.name[0] != '*'
|
||||
&& (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.completionKinds ~= sym.kind;
|
||||
response.completions ~= sym.name.dup;
|
||||
}
|
||||
}
|
||||
response.completionType = CompletionType.identifiers;
|
||||
|
@ -1206,6 +1206,8 @@ bool shouldSwapWithType(CompletionType completionType, CompletionKind kind,
|
|||
immutable bool isInteresting =
|
||||
kind == CompletionKind.variableName
|
||||
|| kind == CompletionKind.memberVariableName
|
||||
|| kind == CompletionKind.importSymbol
|
||||
|| kind == CompletionKind.aliasName
|
||||
|| kind == CompletionKind.enumMember
|
||||
|| kind == CompletionKind.functionName;
|
||||
return isInteresting && (completionType == CompletionType.identifiers
|
||||
|
|
|
@ -14,7 +14,7 @@ sleep 1s;
|
|||
|
||||
# Start up the server
|
||||
echo "Starting server..."
|
||||
../bin/dcd-server --ignoreConfig -I $IMPORTS 2>/dev/null > /dev/null &
|
||||
../bin/dcd-server --ignoreConfig -I $IMPORTS 2>stderr.txt > stdout.txt &
|
||||
sleep 1s;
|
||||
|
||||
# Run tests
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
identifiers
|
||||
Point s
|
||||
|
|
|
@ -6,9 +6,3 @@ unittest
|
|||
{
|
||||
p.
|
||||
}
|
||||
|
||||
unittest
|
||||
{
|
||||
p.Point p1;
|
||||
p1.
|
||||
}
|
||||
|
|
|
@ -3,6 +3,3 @@ set -u
|
|||
|
||||
dcd-client file.d -c48 > actual1.txt
|
||||
diff actual1.txt expected1.txt
|
||||
|
||||
dcd-client file.d -c80 > actual2.txt
|
||||
diff actual2.txt expected2.txt
|
||||
|
|
Loading…
Reference in New Issue