-
Notifications
You must be signed in to change notification settings - Fork 951
feat: add in actions()
to Problem
#7242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This adds a new field into `xsbti.Problem` allowing for the compiler to forward "actions" that can address diagnostics. The idea largely mimics a very minimal `CodeAction` that can be found in the [LSP Spec](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeAction) in order to ensure it will work with a variety of difference clients that use LSP, and those that don't. In the future the `WorkspaceEdit` that was created here could also be expanded to handle more advanced changes, aka resource operations, like creating/moving/deleting files. For now we only focus on a small subset of these features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ckipp01!
**Problem** We want to pass along code actions via Diagnostics, even though this idea seems to have been shot down already in LSP microsoft/language-server-protocol 581. **Solution** This defines additional `actions` field to `Diagnostics`, mirroring sbt/sbt#7242.
[](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [sbt/sbt](https://togithub.com/sbt/sbt) | patch | `1.9.2` -> `1.9.3` | --- ### Release Notes <details> <summary>sbt/sbt (sbt/sbt)</summary> ### [`v1.9.3`](https://togithub.com/sbt/sbt/releases/tag/v1.9.3): 1.9.3 [Compare Source](https://togithub.com/sbt/sbt/compare/v1.9.2...v1.9.3) ##### Actionable diagnostics (aka quickfix) Actionable diagnostics, or quickfix, is an area in Scala tooling that's been getting attention since Chris Kipp presented it in the March 2023 Tooling Summit. Chris has written the [roadmap][actionable] and sent [sbt/sbt#7242][7242] that kickstarted the effort, but now there's been steady progress in [Build Server Protocol][bsp527], [Dotty](https://togithub.com/lampepfl/dotty/issues/17337), [Scala 2.13](https://togithub.com/scala/scala/pull/10406/), IntelliJ, Zinc, etc. Metals 1.0.0, for example, is now capable of surfacing code actions as a quickfix. sbt 1.9.3 adds a new interface called `AnalysisCallback2` to relay code actions from the compiler(s) to Zinc's Analysis file. Future version of Scala 2.13.x (and hopefully Scala 3) will release with proper code actions, but as a demo I've implemented a code action for procedure syntax usages even on current Scala 2.13.11 with `-deprecation` flag. This was contributed by Eugene Yokota ([@​eed3si9n](https://togithub.com/eed3si9n)) in [zinc#1226][zinc1226]. Special thanks to [@​lrytz][@​lrytz] for identifying this issue in [zinc#1214](https://togithub.com/sbt/zinc/discussions/1214). #### other updates - Adds M1/M2/Aarch64 build of sbtn into the installer by [@​julienrf](https://togithub.com/julienrf) in [https://github.com/sbt/sbt/pull/7329](https://togithub.com/sbt/sbt/pull/7329) - Fixes scripted tests timing out after 5 minutes by [@​eed3si9n](https://togithub.com/eed3si9n) in [https://github.com/sbt/sbt/pull/7336](https://togithub.com/sbt/sbt/pull/7336) **Full Changelog**: sbt/sbt@v1.9.2...v1.9.3 [@&# 10000 8203;eed3si9n]: https://togithub.com/eed3si9n [@​Nirvikalpa108]: https://togithub.com/Nirvikalpa108 [@​adpi2]: https://togithub.com/adpi2 [@​er1c]: https://togithub.com/er1c [@​eatkins]: https://togithub.com/eatkins [@​dwijnand]: https://togithub.com/dwijnand [@​ckipp01]: https://togithub.com/ckipp01 [@​mdedetrich]: https://togithub.com/mdedetrich [@​xuwei-k]: https://togithub.com/xuwei-k [@​lrytz]: https://togithub.com/lrytz [7242]: https://togithub.com/sbt/sbt/pull/7242 [7251]: https://togithub.com/sbt/sbt/pull/7251 [zinc1186]: https://togithub.com/sbt/zinc/pull/1186 [zinc1226]: https://togithub.com/sbt/zinc/pull/1226 [bsp527]: https://togithub.com/build-server-protocol/build-server-protocol/pull/527 [actionable]: https://contributors.scala-lang.org/t/roadmap-for-actionable-diagnostics/6172/1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/cwienberg/spark-sorting-helpers). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMTEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
### What changes were proposed in this pull request? The pr aims to upgrade sbt from 1.9.2 to 1.9.3. ### Why are the changes needed? 1.The new version brings some improvment: Actionable diagnostics (aka quickfix) Actionable diagnostics, or quickfix, is an area in Scala tooling that's been getting attention since Chris Kipp presented it in the March 2023 Tooling Summit. Chris has written the [roadmap](https://contributors.scala-lang.org/t/roadmap-for-actionable-diagnostics/6172/1) and sent sbt/sbt#7242 that kickstarted the effort, but now there's been steady progress in build-server-protocol/build-server-protocol#527, scala/scala3#17337, scala/scala#10406, IntelliJ, Zinc, etc. Metals 1.0.0, for example, is now capable of surfacing code actions as a quickfix. sbt 1.9.3 adds a new interface called AnalysisCallback2 to relay code actions from the compiler(s) to Zinc's Analysis file. Future version of Scala 2.13.x (and hopefully Scala 3) will release with proper code actions, but as a demo I've implemented a code action for procedure syntax usages even on current Scala 2.13.11 with -deprecation flag. 2.Full release notes: https://github.com/sbt/sbt/releases/tag/v1.9.3 3.v1.9.2 VS v1.9.3 sbt/sbt@v1.9.2...v1.9.3 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. Closes #42141 from panbingkun/SPARK-44536. Authored-by: panbingkun <pbk1982@gmail.com> Signed-off-by: yangjie01 <yangjie01@baidu.com>
### What changes were proposed in this pull request? The pr aims to upgrade sbt from 1.9.2 to 1.9.3. ### Why are the changes needed? 1.The new version brings some improvment: Actionable diagnostics (aka quickfix) Actionable diagnostics, or quickfix, is an area in Scala tooling that's been getting attention since Chris Kipp presented it in the March 2023 Tooling Summit. Chris has written the [roadmap](https://contributors.scala-lang.org/t/roadmap-for-actionable-diagnostics/6172/1) and sent sbt/sbt#7242 that kickstarted the effort, but now there's been steady progress in build-server-protocol/build-server-protocol#527, scala/scala3#17337, scala/scala#10406, IntelliJ, Zinc, etc. Metals 1.0.0, for example, is now capable of surfacing code actions as a quickfix. sbt 1.9.3 adds a new interface called AnalysisCallback2 to relay code actions from the compiler(s) to Zinc's Analysis file. Future version of Scala 2.13.x (and hopefully Scala 3) will release with proper code actions, but as a demo I've implemented a code action for procedure syntax usages even on current Scala 2.13.11 with -deprecation flag. 2.Full release notes: https://github.com/sbt/sbt/releases/tag/v1.9.3 3.v1.9.2 VS v1.9.3 sbt/sbt@v1.9.2...v1.9.3 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. Closes apache#42141 from panbingkun/SPARK-44536. Authored-by: panbingkun <pbk1982@gmail.com> Signed-off-by: yangjie01 <yangjie01@baidu.com>
This adds a new field into
xsbti.Problem
allowing for the compiler to forward "actions" that can address diagnostics. The idea largely mimics a very minimalCodeAction
that can be found in the LSP Spec in order to ensure it will work with a variety of difference clients that use LSP, and those that don't. In the future theWorkspaceEdit
that was created here could also be expanded to handle more advanced changes, aka resource operations, like creating/moving/deleting files. For now we only focus on a small subset of these features.This relates to the discussion in https://contributors.scala-lang.org/t/roadmap-for-actionable-diagnostics/6172