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

Implement filtering of duplicate errors in SilFrontend #778

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

marcoeilers
Copy link
Contributor

The intention is to avoid reporting two errors via stdout that have the exact same message and position, which provides no value to the user.
Currently, Silicon implements this itself, but Carbon does not. This PR adds an implementation in Silver to replace the one in Silicon (and in the process ensure that the filtering only happens when outputting to stdout, since the filtering can cause issues for frontends, see viperproject/silicon#735).

…sn't happen when Viper is run from frontends
@fpoli
Copy link
Member

fpoli commented Mar 8, 2024

How does the backend know that the errors are going to be reported via stdout? Is the assumption that SilFrontend will only be used for command-line error reporting?

@marcoeilers
Copy link
Contributor Author

SilFrontend is basically always used, but the finish method where the filtering now happens is only called from execute, which is not called when the frontend API is used.

@fpoli
Copy link
Member

fpoli commented Mar 8, 2024

Thanks! Could it be worth adding a comment to finish and/or execute reminding that it should not be used by frontends because of this filtering?

@fpoli
Copy link
Member

fpoli commented Mar 8, 2024

Thanks! Could it be worth adding a comment to finish and/or execute reminding that it should not be used by frontends because of this filtering?

I just realized that execute already mentions the command-line use case. It might also make sense on finish given that it's not private.

@marcoeilers marcoeilers merged commit bd03b3f into master Mar 8, 2024
5 checks passed
@marcoeilers marcoeilers deleted the meilers_filter_only_stdout branch March 8, 2024 17:50
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.

2 participants