This commit is contained in:
Hackerpilot 2017-03-08 15:59:47 -08:00
parent 974882fd74
commit 5832c0a538
4 changed files with 21 additions and 2 deletions

View File

@ -778,10 +778,10 @@ DSymbol*[] getSymbolsByTokenChain(T)(Scope* completionScope,
// If the `symbols` array contains functions, and one of them returns
// void and the others do not, this is a property function. For the
// purposes of chaining auto-complete we want to ignore the one that
// returns void.
// returns void. This is a no-op if we are getting doc comments.
void filterProperties() @nogc @safe
{
if (symbols.length == 0)
if (symbols.length == 0 || completionType == CompletionType.ddoc)
return;
if (symbols[0].kind == CompletionKind.functionName
|| symbols[0].qualifier == SymbolQualifier.func)

1
tests/tc047/expected.txt Normal file
View File

@ -0,0 +1 @@
Sets or gets prop

13
tests/tc047/file.d Normal file
View File

@ -0,0 +1,13 @@
struct Foo
{
/// Sets or gets prop
void prop(int t);
/// ditto
int prop();
}
void main(string[] args)
{
Foo f;
f.prop
}

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

@ -0,0 +1,5 @@
set -e
set -u
../../bin/dcd-client $1 file.d -d -c136 > actual.txt
diff actual.txt expected.txt