Skip to content

feat: account for ScalaDiagnostic in diagnostic data#5338

Merged
ckipp01 merged 1 commit intoscalameta:mainfrom
ckipp01:actionableDiagnostic
Jul 4, 2023
Merged

feat: account for ScalaDiagnostic in diagnostic data#5338
ckipp01 merged 1 commit intoscalameta:mainfrom
ckipp01:actionableDiagnostic

Conversation

@ckipp01
Copy link
Copy Markdown
Member

@ckipp01 ckipp01 commented Jun 15, 2023

This pr bumps the version of BSP to the latest that includes the changes necessary for the new ScalaDiagnostic that is included in the data field of the Diagnostic coming over BSP. These include actions coming straight from the Scala 3 compiler.

Here are some examples using sbt 1.9.0 and the code changes in here:

2023-06-15 14 43 48
2023-06-15 14 45 16
2023-06-15 14 45 58

Supersedes #5173 since the shape is a bit different now than originally planned. Since this is the shape already baked into BSP, I'll do a follow-up in scala-cli to also update the top level TextEdit that it uses to instead use ScalaDiagnostic in data.

* unrequired keys in the structure that causes issues when we try to
* deserialize the old top level text edit vs the newly nested actions.
*/
object DiagnosticDataDeserializer
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw your comment in #5173 (comment) @tgodzik , but I still couldn't figure out a good way to do this now that we're using b.ScalaDiagnostic that doesn't mark it as NotNull. This doesn't seem to work, but if you have a better solution I'm all ears.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so there is no sensible way around it. I found a Kotlin article that suggest using reflection for automatic detection of null fields, but let's not do that 😅

Copy link
Copy Markdown
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

This pr bumps the version of BSP to the latest that includes the changes
necessary for the new `ScalaDiagnostic` that is included in the `data`
field of the Diagnostic coming over BSP. These include actions coming
straight from the Scala 3 compiler.
@ckipp01 ckipp01 force-pushed the actionableDiagnostic branch from 54e88d3 to 4bd3ee1 Compare June 29, 2023 05:59
@ckipp01 ckipp01 merged commit 2d6030a into scalameta:main Jul 4, 2023
@ckipp01 ckipp01 deleted the actionableDiagnostic branch July 4, 2023 06:00
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