fix #504 - Completion for partial identifier matching to a basic type doesn't work

This commit is contained in:
Basile Burg 2018-07-11 13:59:22 +02:00
parent 07fe276053
commit 5398d88114
4 changed files with 8 additions and 1 deletions

View File

@ -59,7 +59,8 @@ public AutocompleteResponse complete(const AutocompleteRequest request,
request.cursorPosition, stringCache, tokenArray);
// allows to get completion on keyword, typically "is"
if (beforeTokens.length && isKeyword(beforeTokens[$-1].type))
if (beforeTokens.length &&
(isKeyword(beforeTokens[$-1].type) || isBasicType(beforeTokens[$-1].type)))
{
Token* fakeIdent = cast(Token*) (&beforeTokens[$-1]);
fakeIdent.text = str(fakeIdent.type);

View File

@ -0,0 +1,2 @@
identifiers
internal v

View File

@ -0,0 +1 @@
struct Member{int internal;}void main(){Member member;member.int }

View File

@ -6,3 +6,6 @@ diff actual1.txt expected1.txt
../../bin/dcd-client $1 file2.d -c42 > actual2.txt
diff actual2.txt expected1.txt
../../bin/dcd-client $1 file3.d -c64 > actual3.txt
diff actual3.txt expected3.txt