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

HTML intellisense in ~L/H sigil. #243

Closed
kingdevnl opened this issue Apr 18, 2022 · 5 comments
Closed

HTML intellisense in ~L/H sigil. #243

kingdevnl opened this issue Apr 18, 2022 · 5 comments

Comments

@kingdevnl
Copy link

Is it possible to get html/ex autocompletion inside the ~L sigil?

@lukaszsamson
Copy link
Collaborator

Elixir intelisense is working. HTML is not.

@lukaszsamson lukaszsamson changed the title heex intellisense in ~L sigil. HTML intellisense in ~L/H sigil. Nov 6, 2022
@dvic
Copy link

dvic commented Feb 8, 2023

If you add the following

"emmet.includeLanguages": {
  "elixir": "html",
  "phoenix-heex": "html"
},
"emmet.triggerExpansionOnTab": true,

It will actually work (I tested it in HEEx sigils). It works because of the emmet.triggerExpansionOnTab setting, which expands the tag on TAB even if there is no item in the autocomplete list. However, it doesn't work for div because this autocompletes to the div() function in Kernel :( @lukaszsamson is there a way to disable the autocomplete for certain functions, and maybe just in the sigil?

In any case, this "hack" works for aby html element that is not shadowed by a function in scope.

@azyzz228
Copy link

azyzz228 commented May 9, 2023

If you add the following

"emmet.includeLanguages": {
  "elixir": "html",
  "phoenix-heex": "html"
},
"emmet.triggerExpansionOnTab": true,

It will actually work (I tested it in HEEx sigils). It works because of the emmet.triggerExpansionOnTab setting, which expands the tag on TAB even if there is no item in the autocomplete list. However, it doesn't work for div because this autocompletes to the div() function in Kernel :( @lukaszsamson is there a way to disable the autocomplete for certain functions, and maybe just in the sigil?

In any case, this "hack" works for aby html element that is not shadowed by a function in scope.

It works perfectly well but then when writing elixir code, you get a lot of emmet suggestions which is annoying. Would be great to configure Emmet to work only inside of ~H as you suggested

@lukaszsamson
Copy link
Collaborator

I think the proper solution would be to create a dedicated language server for html-eex

@lukaszsamson
Copy link
Collaborator

After more thought I'm sure that a dedicated phoenix language server is a way to go. There's already https://github.com/phoenixframework/vscode-phoenix which handles the H sigil. H sigil was supported but it turned to be a mistake breaking phoenix-heex grammar. This extension has supported E/L sigils but given that both are now deprecated for more than a year it safe to assume that in a year almost nobody will need support for them

@lukaszsamson lukaszsamson closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2023
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

No branches or pull requests

4 participants