Require imports to be specified without file extension#1130
Require imports to be specified without file extension#1130mergify[bot] merged 11 commits intomasterfrom
Conversation
|
Still need to fix the language server to properly handle these paths |
Hmm, that defeats a bit the purpose of having a nice-looking I think we should do one of these:
If we expect that imports will have some guessing around them anyways eventually (e.g. multiple search paths, or “use @rossberg, opinions? |
|
I'm fine with either of the options you list, though for simplicity, would probably pick 1/2 over 3. Regarding which one path takes precedent, what do other systems do? |
|
According to https://stackoverflow.com/a/4092446/946226 python (which I kinda took as inspiration here) does 2; directory before file. |
|
If we have both |
|
That's a good point for returning the full path. Otoh, the point of printing the dependencies is that the build tool (dfx) can possibly generate the missing files. That seems like an unresolvable dilemma. Maybe we need two modes? Or print both import URL and (if present) file it resolves to? |
|
I've run into problems with breaking the IDE's file resolution here, so I'm working on unifying that with pipeline first and then I'll get back to this PR. |
If we can resolve the file, we don't need dfx to generate any files for us. I think we can output the full path if |
d1906f5 to
2fbd635
Compare
|
In terms of gas, no changes are observed in 1 tests. |
|
Allright, tests seem to be passing again and the IDE now uses the same file resolution as the pipeline. I've implemented the "file exists" based resolution for directory paths, the easiest way to tell if this is what you'd imagined is probably to look at the PTAL |
|
Edit: The error that you provide is nicely self-explanatory. I'll shut up. What about out-of tree code (at externals?) Can we provide a warning when |
Fixes #1127
The one subtle change in here is that previously
import M "path"andimport M "path/"would resolve toimport M "path/lib.mo"whereas now it's required toimport M "path/", because otherwise it'll try to resolvepath.mo