manateelazycat / lsp-bridge

A blazingly fast LSP client for Emacs
GNU General Public License v3.0
1.42k stars 205 forks source link

lsp-bridge-code-action does not get imports #932

Closed hhamud closed 4 months ago

hhamud commented 5 months ago

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

manateelazycat commented 5 months ago

which language? have test code?

hhamud commented 5 months ago

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

manateelazycat commented 5 months ago

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.

hhamud commented 5 months ago

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.

manateelazycat commented 5 months ago

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?

hhamud commented 5 months ago

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.

manateelazycat commented 5 months ago

@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