-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library resolution does not work for use
#3
Comments
@Lenbok Is it work if included file is in same directory? |
Yes, it does seem to work for finding definitions in files that are in the same directory, or found in subdirectories relative to the current file. |
So the problem is that the directory of the libraries cannot be found correctly, I will check it. |
BTW, I was trying to see in the code where to put some debugging (not that I am familiar with rust), but the naming of the library location functions are inconsistent with the terminology in the descriptions at https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Libraries:
It's a minor thing, but it helps to be consistent when describing bugs etc. |
That is a good suggestion, and I don't have a Linux development environment, may not be able to fix this soon, if you can fix it, please submit a PR. |
@Lenbok I don't know why it doesn't work on Linux, I added the log to print the search paths to std out, you can try again to see if your library path is included. |
I had to change your log_to_console function to send to stderr, since emacs only logs that (I guess stdout is just used for those servers using stdio), but I see it does have my library path:
My built-in library folder contains libraries such as:
Is it also possible to log when the server tries to search within the library path? |
Yes, my include statement includes the library name. I added logging at 1146 to print |
Ahhh, I narrowed it down, Line 1062 in ba27b42
to: match node.kind() {
"use_statement" | "include_statement" => {
code.get_include_url(&node).map(|inc| {
include_vec.push(inc);
});
}
_ => (),
} (remember, I don't know rust, I just copied the matching structure that was in the next section). And now my modules are being found! If you want I can open a PR, or you can just make the fix yourself. Now that is solved, the other thing I noticed was that in dzhu's implementation, autocomplete candidates contain several extra candidates, both prefix matches and fuzzy matches (e.g. typing |
use
Yes, I did not return all symbols. |
@Lenbok I changed the server's behavior, just return all symbols. |
Nice job, thanks! |
As reported on Reddit, for me this openscad language server does not resolve modules that are contained in libraries, whereas dzhu's language server does find my libraries just fine.
I am running on linux, my libraries are installed in the built-in location
$HOME/.local/share/OpenSCAD/libraries/
I do not normally use OPENSCADPATH, however, I also tried setting this and it could still not resolve the modules in libraries.
The text was updated successfully, but these errors were encountered: