-
-
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
Is there any options to remove certain completions? e.g. div(dividend, divisor)
#688
Comments
All of the neovim lsp callbacks are customizable. So could override the the completion request and swallow ones matching that pattern. |
Currently, lexical doesn't support any configuration. I've been considering adding project-level configuration, but we haven't had the need for configuration yet. |
Another take on this would be to refine completions based on their context. For example, you should not get a completion in heex unless you're inside of an elixir block. |
This would be amazing. As much as there are a lot of things I like about the new Phoenix stuff since LiveView, the comingling of HTML and Elixir can at times be cumbersome. Either the HTML doesn't format, or intellisense gives me Elixir completions inside of HTML, or equally as bad, I guess it's different for everyone in terms of what code assistance they find nice to have, and which things they find hard to live without. Having function completion in Elixir is very nice, but for me having to type out a function is typically less cumbersome(since it generally flows in a single direction), than having to type out HTML tags by hand, because you're either jumping around to the beginning and end of everything, or you're trying to figure out what block is missing a closing tag. One complexity is that you have Elixir within HTML within Elixir. I'm not sure how much of a challenge that it from the code context side of things defmodule SomeComponent do
def some_function(assigns) do
# ELIXIR HERE
~H"""
HTML HERE
<div class={ELIXIR HERE}>HTML HERE <%= ELIXIR HERE %></div>
"""
end
end |
This is very helpful, thank you. I'm still in the long, (sometimes painful) process of switching to Neovim, and while I'm sure everything I want is possible, I have to sometimes block my time, "Ok, I'll only spend 1 hour trying to find the relevant docs/solution to this", otherwise Neovim can at times feel like 90% of your time is coding your editor, and only 10% is coding your code, haha. But this link gets me going in the right direction. |
You should be able to get more granular than that. Emacs has something called multi-mode-mode or polymode which allows you to tell it that certain parts of a file are in one language, and the others are in another. Perhaps vscode has similar functionality?
We can detect the |
This isn't a bug, but rather a question, or maybe feature request.
I'm using the setup for nvim, and I had a similar issue in VSCode which is that Lexical likes to suggest
div(dividend, divisor)~ Function
for autocomplete, which seems to always be at the top of the list(when i've typeddiv
), however from years of muscle memory,div
is always<div>|</div>
, so it drives me nuts every time I getdiv(|dividend, divisor)
since it's a function I use so rarely. VSCode seemed to have no way to turn off specific suggestions. I'm curious if there are any options for neovim I can pass to Lexical in thelsp_config.setup({...})
call that would turn off specific suggestions?The text was updated successfully, but these errors were encountered: