Skip to content

Conversation

@alexanderpann
Copy link
Contributor

This is a follow-up of #184 where a forgot to adapt the saved messages and I also fixed a few linters where the error reporting was missing information. With this new change, you can also navigate in the checker results to files, nodes, models and modules. Files can now be returned as a result in linters.

@alexanderpann alexanderpann force-pushed the bugfix/linter_error_reporting branch from a9239d0 to d14ec37 Compare September 23, 2024 09:36
@danielratiu
Copy link
Member

danielratiu commented Sep 23, 2024

if I do not have generated the linter, the result is an exception due to the "Result.location" being null


java.lang.NullPointerException: Cannot invoke "Object.toString()" because the return value of "org.mpsqa.lint.generic.util.Result.location()" is null
at org.mpsqa.lint.generic.typesystem.ViolationsReporterUtils.reportViolations(ViolationsReporterUtils.java:28)
at org.mpsqa.lint.generic.typesystem.check_checkableScript_NonTypesystemRule.applyRule(check_checkableScript_NonTypesystemRule.java:39)
at jetbrains.mps.newTypesystem.context.typechecking.IncrementalTypechecking.applyRuleToNode(IncrementalTypechecking.java:157)
at jetbrains.mps.newTypesystem.context.component.NonTypeSystemComponent.lambda$applyNonTypesystemRulesToNode$2(NonTypeSystemComponent.java:345)
at jetbrains.mps.newTypesystem.context.typechecking.IncrementalTypechecking.runApplyRulesTo(IncrementalTypechecking.java:166)
at jetbrains.mps.newTypesystem.context.component.NonTypeSystemComponent.applyNonTypesystemRulesToNode(NonTypeSystemComponent.java:320)
at jetbrains.mps.newTypesystem.context.component.NonTypeSystemComponent.applyRulesToRoot(NonTypeSystemComponent.java:308)
at jetbrains.mps.newTypesystem.context.component.NonTypeSystemComponent.lambda$applyNonTypeSystemRulesToRoot$1(NonTypeSystemComponent.java:293)
at jetbrains.mps.languageScope.LanguageScopeExecutor.execWithModelScope(LanguageScopeExecutor.java:63)
at jetbrains.mps.languageScope.LanguageScopeExecutor.execWithModelScope(LanguageScopeExecutor.java:43)
at jetbrains.mps.newTypesystem.context.component.NonTypeSystemComponent.applyNonTypeSystemRulesToRoot(NonTypeSystemComponent.java:293)
at jetbrains.mps.newTypesystem.context.typechecking.IncrementalTypechecking.applyNonTypesystemRulesToRoot(IncrementalTypechecking.java:227)
at jetbrains.mps.newTypesystem.context.typechecking.BaseTypechecking.applyNonTypesystemRulesToRoot(BaseTypechecking.java:142)
at jetbrains.mps.newTypesystem.context.typechecking.BaseTypechecking.applyNonTypesystemRulesToRoot(BaseTypechecking.java:135)
at jetbrains.mps.typesystemEngine.checker.NonTypesystemChecker.lambda$getErrors$1(NonTypesystemChecker.java:57)

<<<<<<<<<<<<<

In general, couldn't we use another default `value for location besides "null"? the code (many places in ResultEntry behavior) is quite heavily accessing resultLocation and might cause NPEs ...

image

@alexanderpann
Copy link
Contributor Author

alexanderpann commented Sep 23, 2024

I only saw two potential cases where it could be null, so I just added two null checks. In ResultEntry, we need try catch blocks anyway, so NullPointers are not an issue there.

danielratiu and others added 2 commits September 24, 2024 07:54
…ure" - evaluation is not skipped and no whitelists are used (i.e. everything is GREEN)
@ratiud
Copy link
Contributor

ratiud commented Sep 24, 2024

looks good now - thank you!

@alexanderpann alexanderpann merged commit 27d4741 into maintenance/MPS-2022.3 Sep 24, 2024
@alexanderpann alexanderpann deleted the bugfix/linter_error_reporting branch September 24, 2024 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants