Skip to content

"Code actions of kind 'quickfix 'requested but returned code action is of kind 'refactor.extract'." #2854

Closed

Description

@DanTup

Seen in Log (Extension Host) output pane when logging was on Trace while debugging something else.

Activity

  1. modified the milestones: v3.16.0, On Deck on Oct 6, 2020
  2. DanTup commented on Oct 8, 2020

    @DanTup
    MemberAuthor

    Can't currently repro on Dart or Flutter, LSP on or off.

  3. bsutton commented on Jan 7, 2021

    @bsutton

    I'm getting the same error. Is there anything I can do to help with the diagnosis?

    [2021-01-07 18:27:34.459] [exthost] [warning] Dart-Code.dart-code - Code actions of kind 'source 'requested but returned code action is of kind 'refactor.surround.block'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
    [2021-01-07 18:27:34.459] [exthost] [warning] Dart-Code.dart-code - Code actions of kind 'source 'requested but returned code action is of kind 'refactor.surround.if'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
    [2021-01-07 18:27:34.459] [exthost] [warning] Dart-Code.dart-code - Code actions of kind 'source 'requested but returned code action is of kind 'refactor.surround.while'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
    [2021-01-07 18:27:34.459] [exthost] [warning] Dart-Code.dart-code - Code actions of kind 'source 'requested but returned code action is of kind 'refactor.surround.forIn'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
    [2021-01-07 18:27:34.459] [exthost] [warning] Dart-Code.dart-code - Code actions of kind 'source 'requested but returned code action is of kind 'refactor.surround.forEach'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
    [2021-01-07 18:27:34.459] [exthost] [warning] Dart-Code.dart-code - Code actions of kind 'source 'requested but returned code action is of kind 'refactor.surround.doWhile'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
    [2021-01-07 18:27:34.459] [exthost] [warning] Dart-Code.dart-code - Code actions of kind 'source 'requested but returned code action is of kind 'refactor.surround.tryCatch'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
    [2021-01-07 18:27:34.459] [exthost] [warning] Dart-Code.dart-code - Code actions of kind 'source 'requested but returned code action is of kind 'refactor.surround.tryFinally'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
    [2021-01-07 18:27:34.459] [exthost] [warning] Dart-Code.dart-code - Code actions of kind 'source 'requested but returned code action is of kind 'refactor.convert.bodyToExpression'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
    [2021-01-07 18:27:34.459] [exthost] [warning] Dart-Code.dart-code - Code actions of kind 'source 'requested but returned code action is of kind 'refactor.extract'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
    

    I'm running dart 2.10.4 LSP.

    {
        "git.autofetch": true,
        "files.autoSave": "afterDelay",
        "dart.debugSdkLibraries": true,
        "editor.suggestSelection": "first",
        "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
        "java.semanticHighlighting.enabled": true,
        "files.exclude": {
            "**/.classpath": true,
            "**/.project": true,
            "**/.settings": true,
            "**/.factorypath": true
        },
        "java.requirements.JDK11Warning": false,
        "diffEditor.ignoreTrimWhitespace": false,
        "window.zoomLevel": -1,
        "java.imports.gradle.wrapper.checksums": [
            {
                "sha256": "2cae31aaabe2b362438e10dce5538f9a554e183056485df883f45aee08a008e0",
                "allowed": true
            },
            {
                "sha256": "16caeaf66d57a0d1d2087fef6a97efa62de8da69afa5b908f40db35afc4342da",
                "allowed": true
            }
        ],
        "editor.columnSelection": false,
        "[dart]": {
            "editor.formatOnSave": true,
            "editor.formatOnType": true,
            "editor.rulers": [
                120
            ],
            "editor.selectionHighlight": false,
            "editor.suggest.snippetsPreventQuickSuggestions": false,
            "editor.suggestSelection": "first",
            "editor.tabCompletion": "onlySnippets",
            "editor.wordBasedSuggestions": false
        },
        "dart.flutterCreateAndroidLanguage": "java",
        "dart.flutterCreateIOSLanguage": "objc",
        "editor.wordWrapColumn": 120,
        "dart.openDevTools": "flutter",
        "dart.debugExternalLibraries": true,
        "dart.analyzerPath": null,
        "diffEditor.renderSideBySide": true,
        "dart.previewLsp": true,
        "java.project.importHint": false,
        "editor.suggest.showStatusBar": true,
        "settingsSync.ignoredSettings": [
    
        
        ],
        "local-history.exclude": [
        
            "**/.history/**",
            "**/.vscode/**",
            "**/node_modules/**",
            "**/typings/**",
            "**/out/**",
            "**/Code/User/**"
        ],
        "local-history.treeLocation": "localHistory",
        "local-history.path": "./",
        // "dart.analyzerLogFile": "/tmp/dart-code.log"
    }
    
  4. DanTup commented on Jan 7, 2021

    @DanTup
    MemberAuthor

    @bsutton do you know what steps trigger it?

  5. DanTup commented on Jan 26, 2021

    @DanTup
    MemberAuthor

    Found a way to reproduce this. Seems like VS Code doesn't offer send only, but you can force it with a keybind to filter the list:

    {
    	"key": "cmd+.",
    	"command": "editor.action.codeAction",
    	"args": {
    		"kind": "refactor.convert",
    		"apply": "never"
    	}
    }

    Now when pressing Cmd+. it triggers this message when the server returns non-convert items (for example surround assists). Looking at the server code, it's doing no filtering whatsoever, which explains the issue.

  6. modified the milestones: On Deck, v3.20.0 on Jan 26, 2021
  7. DanTup commented on Feb 12, 2021

    @DanTup
    MemberAuthor
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