usethesource / rascal-language-servers

An LSP server for Rascal which includes an easy-to-use LSP generator for languages implemented in Rascal, and an interactive terminal REPL.
BSD 2-Clause "Simplified" License
10 stars 7 forks source link

Module reloader does not work across project boundaries #336

Closed DavyLandman closed 9 months ago

DavyLandman commented 9 months ago

Describe the bug

Cross project dependencies work, but the module reloading feature doesn't see updates for modules from a different project.

To Reproduce

project A has module A. project B has module B that imports A. If you open a repl for B, it works nicely. but if you change A, and run something in the REPL, the automatic module reloading is not triggered. only when you explicitly re-import A, does the REPL see the changes.

Expected behavior The module reloader picks up the changes of the other project. Since it can see the changes after doing a re-import. My hunch is that the file watch is giving path changes for a different URI than we expect.

Desktop (please complete the following information):

DavyLandman commented 9 months ago

I think it's because the src= of the dependency is a project uri, while it's own path is a file uri.

 srcs=[
    |project://a/src/main/rascal|,
    |file:///D:/swat.engineering/test/B/src/main/rascal|
  ]
DavyLandman commented 9 months ago

yes, that's it, since project uri's are logicals, they are resolved to a file location. so the watch events that are published are for file:// instead of the original project uris.