Closed award999 closed 4 weeks ago
@swift-server-bot test this please
@swift-server-bot test this please
One issue that might come up as well, the compiler sometimes generates info diagnostics (related to an error) you don't get from SKLSP. Will be a bit weird if we remove an error because SKLSP says it is fixed, but the related info diagnostic is not removed because it came from the build.
An easy way to replicate this is have a protocol and a struct that conforms to this protocol. Add a new requirement to the protocol and compile your project. You get an info diagnostic Protocol requires ...
. When you add the requirement to your struct this info diagnostic is not removed.
The info diagnostics are already problematic as they are not associated with the error that created them. Ideally we would be able to create a hierarchy of diagnostics where the info diagnostic was a child of the actual error diagnostic instead of a flat list. Don't think that is possible in VSCode though
EDIT: Just noticed Diagnostic
has a relatedInformation
field. Is this something we could use for informational diagnostics, if we can associate them with an error.
One issue that might come up as well, the compiler sometimes generates info diagnostics (related to an error) you don't get from SKLSP. Will be a bit weird if we remove an error because SKLSP says it is fixed, but the related info diagnostic is not removed because it came from the build.
An easy way to replicate this is have a protocol and a struct that conforms to this protocol. Add a new requirement to the protocol and compile your project. You get an info diagnostic
Protocol requires ...
. When you add the requirement to your struct this info diagnostic is not removed.The info diagnostics are already problematic as they are not associated with the error that created them. Ideally we would be able to create a hierarchy of diagnostics where the info diagnostic was a child of the actual error diagnostic instead of a flat list. Don't think that is possible in VSCode though
EDIT: Just noticed
Diagnostic
has arelatedInformation
field. Is this something we could use for informational diagnostics, if we can associate them with an error.
Ya I stumbled across yesterday that a "note" always is attached to the preceding warning or error. Will put that patch up soon, and ya will be adding it into the relatedInformation :)
@swift-server-bot test this please
@swift-server-bot test this please
Fixes #653
This does not include serialized diagnostics which will involve changes in swift itself