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

Auto-import: invalid type: null, expected struct CodeActionParams #6204

Closed
lnicola opened this issue Oct 12, 2020 · 11 comments · Fixed by #6213
Closed

Auto-import: invalid type: null, expected struct CodeActionParams #6204

lnicola opened this issue Oct 12, 2020 · 11 comments · Fixed by #6213

Comments

@lnicola
Copy link
Member

lnicola commented Oct 12, 2020

struct A {
    _marker: PhantomPinned, // try to auto-import this, server crashes
}

fn main() {

}
thread 'main' panicked at 'Invalid request
Method: experimental/resolveCodeAction
 error: invalid type: null, expected struct CodeActionParams'
@SomeoneToIgnore
Copy link
Contributor

Works for me for today's nightly: rust-analyzer version: nightly (b7596d2)

out

@lnicola
Copy link
Member Author

lnicola commented Oct 12, 2020

Tested at 518f6d7.

@SomeoneToIgnore
Copy link
Contributor

Can confirm that almost any auto import fails now on the fresh nightly.

@lnicola
Copy link
Member Author

lnicola commented Oct 13, 2020

Probably #6200 CC @kjeremy.

Actually, that doesn't seem related.

@lnicola
Copy link
Member Author

lnicola commented Oct 13, 2020

b7596d2 also fails for me.

@max-frai
Copy link
Contributor

Confirm that almost each auto import fails.

@hammypants
Copy link

hammypants commented Oct 13, 2020

This is also happening for Implement missing members code action for traits. (Which makes sense that it probably uses auto import under the hood.)

@lnicola
Copy link
Member Author

lnicola commented Oct 13, 2020

Looks like we're sending an invalid message:

[Trace - 12:26:34] Sending request 'experimental/resolveCodeAction - (54)'.
Params: [
    null
]

@lnicola
Copy link
Member Author

lnicola commented Oct 13, 2020

Filed #6213 for it.

@bors bors bot closed this as completed in 2d79bb9 Oct 13, 2020
@bors bors bot closed this as completed in #6213 Oct 13, 2020
@kjeremy
Copy link
Contributor

kjeremy commented Oct 13, 2020

Good find! Interestingly enough LSP 3.16 will have a codeAction/resolve request.

@matklad
Copy link
Member

matklad commented Oct 19, 2020

Yeah, we should switch to codeAction/resolve not sure if it'll square with our groups support though....

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 a pull request may close this issue.

6 participants