zeroc-ice / vscode-slice

Slice syntax highlighter for Visual Studio Code
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

Avoid Reporting Errors for Built-in Slice Files? #49

Open InsertCreativityHere opened 5 months ago

InsertCreativityHere commented 5 months ago

While testing in icerpc-slice, I set include-built-in-slice-files to true. This of course caused redefinition errors everywhere (since those built in files are icerpc-slice), which is what I expected. But... not every file was marked as a redefinition. And every time I opened a file, the erroneous files changes randomly.

What's happening is that half the redefinition errors are reported for the users Slice file, and half are reported for the files we bundle with the extension.

Is there any point to publishing errors for the bundled files? Or should we just filter these errors out when going to report? Assuming that we haven't screwed everything up (which I think is a safe assumption).

ReeceHumphreys commented 5 months ago

It seems that the root issue lies in the inconsistent order in which files are passed to the slice compiler. This leads to redefinitions being written in the bundled files if they're processed first, or in the user's files if those are prioritized. Ideally, we should only report definition errors in the user's slice files.

We should never be pushing diagnostics to the bundled files as that's just pointless.