lsp-bridge icon indicating copy to clipboard operation
lsp-bridge copied to clipboard

lsp-bridge-code-action does not get imports

Open hhamud opened this issue 9 months ago • 7 comments

I would like to invoke lsp-bridge-code-action to be able to autoimport functions when calling the code-action but its does nothing.

hhamud avatar May 03 '24 22:05 hhamud

which language? have test code?

manateelazycat avatar May 04 '24 01:05 manateelazycat

which language? have test code?

its in every rust project that I have on.

one example would be having a rust file with a few functions and then trying to auto-import them using lsp-bridge-code-actions just like I can with lsp-execute-code-actions

hhamud avatar May 04 '24 17:05 hhamud

I rechecked and found that the auto import function is available in languages ​​similar to TypeScript. The main source code is https://github.com/manateelazycat/lsp-bridge/blob/471012f9e8e80fcd2d4e42d5e3739caceaa8ecf5/core/lspserver.py#L257 .organizeImports option to control.

I also checked Rust’s LSP Server. Currently, it seems that Rust LSP Server does not support the auto-import function: https://github.com/rust-lang/rust-analyzer/issues/12761

If other Emacs LSP Clients support the auto-import function, please give me feedback.

manateelazycat avatar May 05 '24 00:05 manateelazycat

I rechecked and found that the auto import function is available in languages ​​similar to TypeScript. The main source code is

https://github.com/manateelazycat/lsp-bridge/blob/471012f9e8e80fcd2d4e42d5e3739caceaa8ecf5/core/lspserver.py#L257 .organizeImports option to control.

I also checked Rust’s LSP Server. Currently, it seems that Rust LSP Server does not support the auto-import function: rust-lang/rust-analyzer#12761

If other Emacs LSP Clients support the auto-import function, please give me feedback.

lsp-mode in Doom emacs when calling the function lsp-execute-code-actions lets me import missing imports by choosing from a selection within a pop-up buffer.

I am not sure why you cannot do this.

hhamud avatar May 05 '24 02:05 hhamud

I am not sure why you cannot do this.

This is a personal open source project that does not charge users any fees. Why do you think it is natural for others to fix issues? Can't you maintain a little respect for others?

manateelazycat avatar May 05 '24 04:05 manateelazycat

I am not sure why you cannot do this.

This is a personal open source project that does not charge users any fees. Why do you think it is natural for others to fix issues? Can't you maintain a little respect for others?

I highlighted an issue, provided more information as requested and you flip out?

I genuinely don't understand your behaviour.

When I said I am not sure why you cannot do this.

I literally mean what is the blocker.

If you do not want to do so or can't be bothered that's fine its your project.

hhamud avatar May 05 '24 13:05 hhamud

@hhamud I'm sorry. I believe this is a misunderstanding between languages. In the Chinese context, I am not sure why you cannot do this means why lsp-mode can do it but lsp-bridge cannot. Yes, it's a bit provocative.

If lsp-mode works, can you send me the LSP logs that lsp-mode sends to the rust lsp server? I can study the logs to analyze what lsp-bridge is missing that causes the auto import function to be unavailable.

Apologize again

manateelazycat avatar May 05 '24 22:05 manateelazycat