Skip to content

Implement filtering of duplicate errors in SilFrontend#778

Merged
marcoeilers merged 2 commits into
masterfrom
meilers_filter_only_stdout
Mar 8, 2024
Merged

Implement filtering of duplicate errors in SilFrontend#778
marcoeilers merged 2 commits into
masterfrom
meilers_filter_only_stdout

Conversation

@marcoeilers

Copy link
Copy Markdown
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

fpoli commented Mar 8, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
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

fpoli commented Mar 8, 2024

Copy link
Copy Markdown
Member

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

fpoli commented Mar 8, 2024

Copy link
Copy Markdown
Member

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 enabled auto-merge March 8, 2024 17:30
@marcoeilers marcoeilers merged commit bd03b3f into master Mar 8, 2024
@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