Skip to content
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

Epoch error reporting #967

Merged
merged 7 commits into from
Feb 25, 2022
Merged

Epoch error reporting #967

merged 7 commits into from
Feb 25, 2022

Conversation

edwardalee
Copy link
Collaborator

This fixes #966 . It modifies MANIFEST.MF, which makes me nervous.

Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised to see that it has been reporting errors on the path (not the file). I think @petervdonovan should review. Adding the dependency is fine, but we should use the right version (see suggestion).

org.lflang/META-INF/MANIFEST.MF Show resolved Hide resolved
@petervdonovan
Copy link
Collaborator

petervdonovan commented Feb 16, 2022

I'm surprised to see that it has been reporting error on the path (not the file).

It looks like this change happened during refactoring only 2 weeks ago (commit b57c402), so maybe it is not that surprising that the problem was only found recently.

What I do find strange is that, directory/file confusion aside, I am not sure that the idea behind the change introduced in b57c402 was correct. Before b57c402, we reported errors on the resource that had just been validated. Now, the error is reported on the root file of the code generation process.

@lhstrh
Copy link
Member

lhstrh commented Feb 16, 2022

I'm surprised to see that it has been reporting error on the path (not the file).

It looks like this change happened during refactoring only 2 weeks ago (commit b57c402), so maybe it is not that surprising that the problem was only found recently.

What I do find strange is that, directory/file confusion aside, I am not sure that the idea behind the change introduced in b57c402 was correct. Before b57c402, we reported errors on the resource that had just been validated. Now, the error is reported on the root file of the code generation process.

Ah, you're right -- very good detective work! I recall b57c402. Looks like we should just revert the changes on line 231. We should probably answer the FIXME that was in that code, however. If the code is correct, we should probably put it in a static method of FileConfig for convenient reuse.

edwardalee and others added 2 commits February 16, 2022 07:41
Update version of eclipse.core.runtime.

Co-authored-by: Marten Lohstroh <[email protected]>
@edwardalee
Copy link
Collaborator Author

I'm surprised to see that it has been reporting errors on the path (not the file). I think @petervdonovan should review. Adding the dependency is fine, but we should use the right version (see suggestion).

I committed your suggestion, and it cause CI to fail with this error:

Error:  Cannot resolve project dependencies:
[97](https://github.com/lf-lang/lingua-franca/runs/5218982626?check_suite_focus=true#step:8:97)
Error:    Software being installed: org.lflang 0.1.0.qualifier
[98](https://github.com/lf-lang/lingua-franca/runs/5218982626?check_suite_focus=true#step:8:98)
Error:    Missing requirement: org.lflang 0.1.0.qualifier requires 'osgi.bundle; org.eclipse.core.runtime 3.24.0' but it could not be found
[99](https://github.com/lf-lang/lingua-franca/runs/5218982626?check_suite_focus=true#step:8:99)

So we should revert this commit.

@lhstrh
Copy link
Member

lhstrh commented Feb 16, 2022

Let me downgrade the dependency in Gradle/Maven and see if that works...

Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I haven't had a chance to check it with Epoch, so please check with the latest changes before merging.

@lhstrh
Copy link
Member

lhstrh commented Feb 18, 2022

@a-sr: this PR is now in a state where there is a remaining problem that we don't seem able to fix.

If an error marker is added through validation triggered by the Compile button, then the marker will not be removed if the error is fixed (even if the document is saved) until the Compile action is invoked again. It appears that validator instances only remove markers that they have added, leaving markers added by others untouched. I attempted removing the markers explicitly in LFValidator.checkModel() but the available eResource is apparently not an iResource and can therefore not be cast to an iFile (which has the deleteMarkers() method). Any help with this would be greatly appreciated!

@lhstrh lhstrh added this to the 0.1.0 milestone Feb 25, 2022
@edwardalee edwardalee merged commit 742d0c3 into master Feb 25, 2022
@edwardalee edwardalee deleted the epoch-error-reporting branch February 25, 2022 19:53
@cmnrd
Copy link
Collaborator

cmnrd commented Feb 28, 2022

The EclipseErrorReporter has a method clearMarkers which should clear all the error markers.

As far as I know, this method is called in doGenerate of GeneratorBase. Probably it should be called instead by some hook that is invoked on file save.

@lhstrh lhstrh added the bug Something isn't working label Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Epoch fails to highlight errors on codegen
4 participants