mattiascibien / dlang-vscode

Support for the D Programming Language for Visual Studio Code
MIT License
38 stars 10 forks source link

Import alias turns off autocomplete #9

Open yisonPylkita opened 8 years ago

yisonPylkita commented 8 years ago

With this code autocomplete works fine:

import deimos.ncurses;

void main()
{
    deimos.ncurses.initscr();
}

But with this not:

import deimos.ncurses;
alias NC = deimos.ncurses;

void main()
{
    NC.initscr();
}
LaurentTreguier commented 8 years ago

I'll try to look into this, but it may be an issue of DCD itself. It looks like there was such an issue before, but it is supposed to be resolved... The dcd-client process is launched correctly and exits cleany without any error when trying to complete NC.. I think DCD has a problem with the fact that deimos.ncurses does not refer to a file but a directory with a package.d file that publicly imports the real module.

yisonPylkita commented 8 years ago

I have modified code for better testing. Error can be reproduced with this:

test.d

module test;
import std.stdio;

class Test {
    public void foo(){
        writeln("In ", __FUNCTION__);
    }
}

app.d

import std.stdio;
import test;
alias TEST = test;

void main()
{
    /// Autocompletion does not work for TEST 
    auto s = new TEST.Test();
    s.foo(); /// Autocompletion does not work for s
}