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:
commit
e5dc9960a3
|
@ -59,7 +59,8 @@ public AutocompleteResponse complete(const AutocompleteRequest request,
|
||||||
request.cursorPosition, stringCache, tokenArray);
|
request.cursorPosition, stringCache, tokenArray);
|
||||||
|
|
||||||
// allows to get completion on keyword, typically "is"
|
// 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]);
|
Token* fakeIdent = cast(Token*) (&beforeTokens[$-1]);
|
||||||
fakeIdent.text = str(fakeIdent.type);
|
fakeIdent.text = str(fakeIdent.type);
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
identifiers
|
||||||
|
internal v
|
|
@ -0,0 +1 @@
|
||||||
|
struct Member{int internal;}void main(){Member member;member.int }
|
|
@ -6,3 +6,6 @@ diff actual1.txt expected1.txt
|
||||||
|
|
||||||
../../bin/dcd-client $1 file2.d -c42 > actual2.txt
|
../../bin/dcd-client $1 file2.d -c42 > actual2.txt
|
||||||
diff actual2.txt expected1.txt
|
diff actual2.txt expected1.txt
|
||||||
|
|
||||||
|
../../bin/dcd-client $1 file3.d -c64 > actual3.txt
|
||||||
|
diff actual3.txt expected3.txt
|
||||||
|
|
Loading…
Reference in New Issue