-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Fix the interference issue caused by organizing aliases. #761
base: main
Are you sure you want to change the base?
Conversation
apps/remote_control/lib/lexical/remote_control/code_action/handlers/organize_aliases.ex
Outdated
Show resolved
Hide resolved
apps/remote_control/lib/lexical/remote_control/code_action/handlers/organize_aliases.ex
Outdated
Show resolved
Hide resolved
I would also like organize aliases to show up if you're inside of a scope with aliases, for example defmodule WithAliases do
alias Foo.Bar
alias Baz.Quux
|
end
|
Do you have any suggestions regarding the implementation for it? It seems to conflict somewhat with the goals of this PR. |
the implementation would be something like:
|
b56add8
to
a28b342
Compare
Checking this is a bit cumbersome because its ancestors include these before reaching {:__block__, [],
{{:__block__, [line: 1, column: 17], [:do]},
{{:__block__, [line: 1, column: 17], [:do]}, so I think maybe we could just check that both before and after the current cursor are blanks. |
46cc9bc
to
da6b362
Compare
This feels like a problem that can be solved. |
(also, blocks are annoying) |
625c698
to
a08eeac
Compare
Please take a look when you have a chance. The block is really annoying, but I think the last commit has limited room for improvement. |
apps/remote_control/lib/lexical/remote_control/code_action/handlers/organize_aliases.ex
Outdated
Show resolved
Hide resolved
d747d8c
to
965921f
Compare
When I'm writing functions, I occasionally need to handle unused variables, but I find that organizing aliases still returns results. This causes a lot of interference, especially when there's a bug in nvim, as pressing keys quickly can mess up my code. We should not return the results of organizing aliases when the cursor is not on a line with an alias or when the current token is not an alias.
965921f
to
9444bd7
Compare
When I'm writing functions, I occasionally need to handle unused variables, but I find that organizing aliases still returns results. This causes a lot of interference, especially when there's a bug in nvim, as pressing keys quickly can mess up my code.
We should not return the results of organizing aliases when the cursor is not on a line with an alias or when the current token is not an alias.