Show error on missing Rascal dependency - #2861
Conversation
0b22f22 to
0efba40
Compare
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2861 +/- ##
=======================================
- Coverage 46% 46% -1%
+ Complexity 6766 6756 -10
=======================================
Files 841 841
Lines 67065 67071 +6
Branches 10020 10022 +2
=======================================
- Hits 30880 30866 -14
- Misses 33817 33833 +16
- Partials 2368 2372 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I'm a bit on the fence on this change. Since it requires all scenarios to have a pom.xml, which we don't always have, and normally we have a reasonable fallback there. And what if some this code is used during construction of a REPL, than rascal should flow from the classpath of the REPL. So I'm not sure if we should make this an error at this level? What are for example the effects of this change for:
|
In this case, since path configs are only meant for source projects, I think a path config should not be built at all. So this error should not show.
Since this will result in an empty class path, it will raise the error. We could of course check if a POM exists and only show it in that case. Or we lower the level of the diagnostic to a warning, since indeed, we have reasonable default values for Rascal and Rascal LSP in case they are missing from the POM. |
In But more importantly, we're already running rascal (namely our jar) so why are we giving an error/warning that there is no rascal defined?
The more I think about this PR, the more I think, this should be a rascal-lsp warning/error, as that is the place we're building these path configs for "other" projects that our current JVM is running in. |
| } | ||
| else { | ||
| if (mavenClasspath.stream().filter(PathConfig::isRascal).findFirst().isEmpty()) { | ||
| messages.append(Messages.error("Dependency on 'org.rascalmpl:rascal' is required", getPomXmlLocation(manifestRoot))); |
There was a problem hiding this comment.
This should be a warning because for backward compatibility we support projects that do not have the dependency.



Show errors while requesting a path config for projects Rascal projects without a dependency on Rascal.
Prerequisite for proper functioning of
stdscheme rascal-language-servers#1159