Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No completion for if condition made of variable declaration #484

Closed
ghost opened this issue May 13, 2018 · 1 comment
Closed

No completion for if condition made of variable declaration #484

ghost opened this issue May 13, 2018 · 1 comment
Labels
Milestone

Comments

@ghost
Copy link

ghost commented May 13, 2018

class Foo
{
    int i;
}

void main()
{
    Object o;
    if (Foo foo = cast(Foo) o)
    {
        foo.|
    }
}

or just

void main()
{
    if (int i = 1)
    {
        i.|
    }
}

It's because it's not a standard declaration so maybe the DSymbol visitor needs a special case for this (or at least fixes)

@ghost ghost added the bug label May 13, 2018
@ghost ghost added this to the v0.9.7 milestone May 13, 2018
@ghost
Copy link
Author

ghost commented May 13, 2018

This can be fixed in dparse by parsing a VariableDeclaration instead of the special tule, with a few tweaks (allow no semicolon after decl). It's also maybe necessary to push a scope in dsymbol.

dlang-bot added a commit that referenced this issue May 14, 2018
fix #484 - no completion for variable declared in the `IfCondition`s
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants