-
Notifications
You must be signed in to change notification settings - Fork 13
Resolve modulepath imports from local file #93
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
base: main
Are you sure you want to change the base?
Conversation
|
I'm interested in seeing similar support for arbitrary schemes in the long run to provide better editor support when using external/custom readers. I'm curious about the core team's thoughts here. |
|
Thanks for this PR! Modulepath support needs to be a little more involved; mainly:
Feel free to explore this! But otherwise, we can look into adding support for this. |
I've implemented this. Clients now need a way to set this configuration individually per project.
I believe the cli would have to support this first, right? As far as I can tell resources (from the |
Sorry, I probably wasn't clear enough! Relative paths are imported according to enclosing module URI. So, given this: // enclosing module is: "modulepath:/foo.pkl"
import "/bar/baz.pkl"The import is resolved to So, in the LSP, we should determine if a module came from the modulepath. If so, any relative imports there should target the modulepath. |
|
Oh, thank you for clariying I will be unavailable for the next two weeks, apologies for the inconvenience. |
This fixes a deadlock that arises when computing diagnostics. This also generally reduces lock contention (the getCachedValues() API now requires a lock to be provided).
This aims to resolve #91.
This is a rudementary implementation to figure out, what direction this feature should go.
It looks for a
.pkl-module-pathfile in the workspacefolders, reads it, and interpretes ever line that is neither blank nor starts with a#(to allow comments) as amodulepathentry.Currently this happens every time an import is resolved. Hence Invalid and non-existent entries are ignored at the moment to not flood the logs. A better way would probably be to use the
CachedValuesManagerwith adependencyeither to theFsFileor an lsp event signaling its creation. Alternatively it could load it just once at startup.Also, is a
.pkl-module-pathfile appropriate or should it be more general for lsp settings?