Skip to content

Analyzer plugin fixes and assists are not available when using LSP #3502

Closed

Description

@dkrutskikh

Hi! I'm one of the authors of Dart Code Metrics, and we use analyzer plugin API (like sending AnalysisErrorFixes, etc.) to communicate with the analysis server. If I enable LSP preview in VSCode and have the plugin enabled, VSCode starts to display diagnostics without quick fixes. For example,

image

image

It works fine when LSP preview is disabled.

image

Could there be a problem with the analysis server?

Dart SDK version: 2.14.0-301.2.beta (beta) (Mon Jul 19 23:53:21 2021 +0200) on "macos_x64"
VSCode version: 1.58.0
Dart extension version: 3.24.2

Activity

  1. DanTup commented on Jul 29, 2021

    @DanTup
    Member

    Are the fixes that are missing from your plugin, or all fixes? Could you try enabling the analysis servers instrumentation log to see if any errors are recorded?

    If you can provide a small repro I can use (and confirm the exact version of the SDK you're using), that may help too. Thanks!

  2. added
    awaiting infoRequires more information from the customer to progress
    on Jul 29, 2021
  3. dkrutskikh commented on Jul 29, 2021

    @dkrutskikh
    Author
  4. added this to the v3.26.0 milestone on Jul 29, 2021
  5. added
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    and removed
    awaiting infoRequires more information from the customer to progress
    on Jul 29, 2021
  6. DanTup commented on Jul 29, 2021

    @DanTup
    Member

    Thanks - I can repro this. Looks like plugin code actions were overlooked when implementing LSP. Working on it - sorry for the bother!

  7. changed the title [-]Enabled LSP preview is not working with a quick fixes from the analyzer plugin as expected.[/-] [+]Analyzer plugin fixes and assists are not available when using LSP[/+] on Jul 29, 2021
  8. DanTup commented on Jul 29, 2021

    @DanTup
    Member

    I've got a change open to add this to the server: https://dart-review.googlesource.com/c/sdk/+/208404/

    fixesfromplugins

    Since it's an SDK change, it will only show up in a future SDK release though (rather than Dart-Code release).

  9. dkrutskikh commented on Jul 29, 2021

    @dkrutskikh
    Author

    Thank you, please clarify this fix support new command https://dartcode.org/releases/v3-25/#fix-all-command?

  10. DanTup commented on Jul 29, 2021

    @DanTup
    Member

    @dkrutskikh that new "fix all" command is equivalent to running "dart fix". It doesn't include all fixes, only a subset that have been chosen that are safe to apply together and that are very likely the correct fix for the error.

    I don't think it includes plugins (or how feasible it would be) - @bwilkerson may have more information about this than I.

  11. dkrutskikh commented on Jul 29, 2021

    @dkrutskikh
    Author

    Anyway, thanks a lot!

  12. bwilkerson commented on Jul 29, 2021

    @bwilkerson

    No, we don't currently have support for plugins to contribute to the set of fixes applied by the dart fix command. That support does seem like something we should look into adding, though there might be some interesting challenges around the area of conflicting edits. If that's a feature you're plugin would use, please open an issue here: https://github.com/dart-lang/sdk/issues/new.

  13. DanTup commented on Aug 3, 2021

    @DanTup
    Member

    The issue of plugin fixes not showing up is resolved by dart-lang/sdk@00cc25a. Since the change is in the analysis server, it'll show up in a future SDK release rather than a Dart-Code release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions