DCD icon indicating copy to clipboard operation
DCD copied to clipboard

variable declared with auto + import alias get no completion

Open LaurentTreguier opened this issue 8 years ago • 5 comments

When using auto and an import alias to instanciate a struct or a class, the variable won't get completions from DCD.

import std.stdio;

alias io = std.stdio;

void main() {
    auto f1 = File();
    io.File f2;
    auto f3 = io.File();

    f1. // this one will get suggestions
    f2. // this one too

    f3. // that one won't get any suggestion
    io. // and neither will this one
}

I obtained this behavior on Visual Studio Code and Coedit, with DCD 0.8.0 and 0.9.0-alpha4. Is it because of the combination of auto and an alias that would make for some obscure problem ?

LaurentTreguier avatar Jul 10 '16 21:07 LaurentTreguier

Hello!

It works for me in half of the cases. It completes f1 and f2, but no f3 and io. I've shared screenshots. Take a look https://www.dropbox.com/sh/vvguecn4oodgnzw/AAAUsEyZlA9F4hewyv514bega?dl=0

ANtlord avatar Jul 20 '16 03:07 ANtlord

@ANtlord it's exactly the same as me then, I had forgotten to include io.

LaurentTreguier avatar Jul 20 '16 05:07 LaurentTreguier

@LaurentTreguier Sorry, it seems, I'm inexact from the morning.

ANtlord avatar Jul 20 '16 08:07 ANtlord

@ANtlord no problem. Mornings happen :)

LaurentTreguier avatar Jul 20 '16 08:07 LaurentTreguier

Similar problem, I guess:

import my.module;
alias myalias = my.module;

...
myalias. // <- it doesn't show public functions (tagged as @property in my case)
...

EDIT: my.module.myfun... suggests myfunction myfun... suggests myfunction

trikko avatar Aug 31 '17 10:08 trikko