d-language-server / dls

A Language Server implementation for D
http://dls.dub.pm
106 stars 15 forks source link

Can't Go to Declaration for Local Module #19

Closed ghost closed 5 years ago

ghost commented 5 years ago

Try to go into "one/a.d" put the cursor somewhere inside "BType" and press F12 (for vscode). It won't find be able to find the symbol. Goto definition works for the std library. Checked the ModuleCache and the two files are in it. Was working in an older version, not sure when it stopped.

test.zip

LaurentTreguier commented 5 years ago

This is weird, it does find the definition when I test it... What OS are you using ? (just tested on Windows, going to try on Linux as well)

LaurentTreguier commented 5 years ago

Ah, managed to reproduce it, it happens when the folder isn't opened directly, but added to a workspace. I think it's because I'm not handling relative paths, and expecting absolute ones only.

LaurentTreguier commented 5 years ago

It should be fixed with next dls release and vscode extension.

ghost commented 5 years ago

Was on windows, I had the folder open with vscode. I did try both relative and absolute paths but the problem still persisted. I also added some debug logging and the files were being added to the module cache correctly.

I'm using the insiders version of vscode, not sure if that would make a difference. I'll try a few different things when I get home.

LaurentTreguier commented 5 years ago

If the problem is still there, maybe the next minor version, with the latest DCD and dsymbol, could fix it. I'll probably release it tomorrow.

ghost commented 5 years ago

Alright I updated DLS to use DCD 0.10.2 and seems to be working with an absolute path at least.

LaurentTreguier commented 5 years ago

With DLS v0.21.0 it should use DCD v0.10.2, and automatically convert relative paths to absolute ones.

ghost commented 5 years ago

Sweet, thanks pushing it out so quickly!