dlang-vscode icon indicating copy to clipboard operation
dlang-vscode copied to clipboard

Import alias turns off autocomplete

Open yisonPylkita opened this issue 7 years ago • 2 comments

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();
}

yisonPylkita avatar Jul 03 '16 10:07 yisonPylkita

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.

LaurentTreguier avatar Jul 03 '16 11:07 LaurentTreguier

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
}

yisonPylkita avatar Jul 03 '16 11:07 yisonPylkita