vscode-swift icon indicating copy to clipboard operation
vscode-swift copied to clipboard

De-duplicate errors from sourcekitd and swiftc in the Problems view

Open ahoppen opened this issue 2 years ago • 6 comments

In the problems pane, it would be nice if we could de-duplicate errors reported by sourcekitd and swiftc. My suggestion for this would be: If sourcekitd reports an error at the same location with the same message as swiftc, hide it.

ahoppen avatar Dec 05 '23 17:12 ahoppen

I would love to be able to do this, but VSCode considers these two class of errors as coming from different sources and will not merge them.

If I had access to the full problems list I could filter the sourcekitd errors, but I haven't found a way to access the problems list. Also the problem with filtering the sourcekitd errors is I would lose the codeActions attached to these errors.

adam-fowler avatar Dec 06 '23 07:12 adam-fowler

And I suppose (sorry if this is a stupid question) you can’t intercept the errors coming from sourcekit-lsp, right to merge them with build issues and then publish them using your own diagnostics provider.

Interestingly, I just checked what clangd + CMake does and it doesn’t show the build errors in the Problems View at all. I don’t think that’s the way to go but I find at an interesting data point nonetheless.

ahoppen avatar Dec 06 '23 17:12 ahoppen

I can't intercept the build errors, but I can intercept the sourcekit-lsp errors. But without knowing what the build errors are I'm not sure what I can do with the sklsp errors.

Yeah not showing build errors would be bad. Sourcekit-LSP only picks up the errors for the files that are open, if I understand correctly

adam-fowler avatar Dec 06 '23 18:12 adam-fowler

Seems related to #750. I can investigate this one as well. I know that TypeScript handles this well. Would be nice to see how they do it.

matthewbastien avatar Apr 19 '24 14:04 matthewbastien

I don't think the Typescript extension displays errors from the compiler. The only errors displayed come from the LSP server.

adam-fowler avatar Apr 19 '24 20:04 adam-fowler

See #759

adam-fowler avatar Apr 20 '24 08:04 adam-fowler