Pure-D / workspace-d

CLI deprecated, API + functionality moved into https://github.com/Pure-D/serve-d
MIT License
75 stars 15 forks source link

Intellisense does not work on non-imported symbols #75

Closed CZDanol closed 7 years ago

CZDanol commented 7 years ago

In module a I have:

module a;
struct S {
 int x;
};

in module b:

module b;
import c;
S s;

and when I have module c:

module c;
import b;

void main() {
  s.x = 5; // intellisense does not pop here
}
WebFreak001 commented 7 years ago

well this would fail to compile. module a is never imported in any of those 2 files, it must be imported in module b for it to work. So if it fails to compile it shouldn't work there and this behavior is also expected from the programmer because it could be 2 separate "projects" there because they have no dependency on each other whatsoever.

CZDanol commented 7 years ago

I have a typo in module b, there should be import c;

WebFreak001 commented 7 years ago

That doesn't change your code?

CZDanol commented 7 years ago

O_o typo again, import a;

CZDanol commented 7 years ago

I will put together a sample project.

WebFreak001 commented 7 years ago

Well in that case it works for me, try using longer struct & field names than one letter, one letter doesn't trigger intellisense on global scope

WebFreak001 commented 7 years ago
// hello.d
module hello;

import foo;

void main() {
    b // includes bar
    bar. // shows world
}
// foo.d
module foo;

import bar;

Bar bar;
// bar.d
module bar;

struct Bar
{
    int world;
}
CZDanol commented 7 years ago

I've experienced this in my real project with real identifiers. Sorry, my bad for not finding the correct error case, will report when I document it properly.

WebFreak001 commented 7 years ago

On which scope? Members of the variable or completing the global variable name?

CZDanol commented 7 years ago

variable members

WebFreak001 commented 7 years ago

Hm then it's a weird bug, try finding a reproducable test case. It could be unicode characters in that file (they sometimes mess up things), it could be because it uses something else (like a module name) instead of the variable, etc.

CZDanol commented 7 years ago

Yes, I am so sorry for annying with not-working-bug-report-cases :/