Merge pull request #508 from BBasile/issue-504

fix #504 - Completion for partial identifier matching to a basic type doesn't work
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
This commit is contained in:
The Dlang Bot 2018-07-11 14:09:18 +02:00 committed by GitHub
commit e5dc9960a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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