d-language-server / dls

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

crash on folders ending with ".d" #16

Closed qwertzui11 closed 6 years ago

qwertzui11 commented 6 years ago

System: Ubuntu 18.10, KDE, Version 1.11.7

log (d.init.logFile)

[2018-Nov-15 09:46:05.089] Initializing server
[2018-Nov-15 09:46:05.089] Importing directories: ["/usr/include/dmd/druntime/import", "/usr/include/dmd/phobos"]
[2018-Nov-15 09:46:06.077] Importing custom project: <some-project-dir>
[2018-Nov-15 09:46:06.077] Importing directories: ["<some-project-dir>"]
[2018-Nov-15 09:46:06.113] Fetching diagnostics for <some-project-dir>/image/etc/ppp/ip-up.d
[2018-Nov-15 09:46:06.113] -32603: std.file.FileException@std/file.d(383): <some-project-dir>/image/etc/ppp/ip-up.d: Is a directory
----------------
??:? [0x741230]
??:? [0x74a41a]
??:? [0x7317fd]
??:? [0x43bee4]
??:? [0x6e3b08]
??:? [0x42a4fa]
??:? [0x42a48d]
??:? [0x48aaa8]
??:? [0x48a562]
??:? [0x48a80c]
??:? [0x48a634]
??:? [0x4965ea]
??:? [0x4a69d1]
??:? [0x49afbc]
??:? [0x49a94b]
??:? [0x404c29]
??:? [0x404845]
??:? [0x73145f]
??:? [0x731355]
??:? __libc_start_main [0x7f56317fa09a]
??:? [0x404768]
[2018-Nov-15 09:46:06.120] Shutting down server
[2018-Nov-15 09:46:06.144] Exiting server

Under Linux some folders end with *.d for directory. Eg resolf.conf.d. It seems to me, that these folders get interpreted as d-files, which leads to an exception. I assume the same issue should occur for all other operating systems.

If you want me to, I can do a pull request.

Thanks for that great language server! It just works and I like it a lot. Markus

LaurentTreguier commented 6 years ago

It's exactly that; I can't believe I didn't think of directories ending in .d. Will be patched in version 0.16.4

qwertzui11 commented 6 years ago

awesome. thank you!

qwertzui11 commented 6 years ago

I can confirm that it works now. Thank you! :heart_eyes: