Skip to content
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

Code actions are not returned when context.only parameter is not empty #986

Closed
fbricon opened this issue Jul 17, 2019 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@fbricon
Copy link
Collaborator

fbricon commented Jul 17, 2019

Recent builds of vscode now send code action requests containing a context.only value, like:

Params: {
    "textDocument": {
        "uri": "file:///Users/fbricon/Dev/souk/vertx-demo-david/demo/src/main/java/com/example/DemoApplication.java"
    },
    "range": {
        "start": {
            "line": 30,
            "character": 0
        },
        "end": {
            "line": 30,
            "character": 0
        }
    },
    "context": {
        "diagnostics": [],
        "only": [
            "source"
        ]
    }
}

In https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/text/correction/SourceAssistProcessor.java#L158, context.only values are compared to the code action kind as a whole, instead of checking if the kind has a valid prefix. As a result, no code actions are returned.

@fbricon
Copy link
Collaborator Author

fbricon commented Jul 18, 2019

All the quickfixes/code actions to extract to a field/var/constant from eclipse-jdtls/eclipse.jdt.ls#1088 are gone.

@fbricon fbricon reopened this Jul 18, 2019
@fbricon
Copy link
Collaborator Author

fbricon commented Jul 18, 2019

Nevermind, my problem was that I was selecting new Vets(); instead of new Vets(). That extra semicolon threw me off

@fbricon fbricon closed this as completed Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant