Closed gdgp closed 1 year ago
Hello, Can you provide steps to reproduce it?
Hi @predragnikolic
Of course, I just created a sample project where the same happens to me. Some notes on it:
sample.html
and sample.html.eex
to see the differencesWorks:
Does not work:
What's the root scope of that EEx syntax? You can see by triggering menu: Tools -> Developer -> Show scope name.
I think this can be handled either by adding a mapping for the language id in userLanguages
initialization setting (https://github.com/sublimelsp/LSP-tailwindcss/issues/51#issuecomment-1329749851) or adding a global mapping in the LSP package.
The scope is text.html.eex
, I've played around with the mapping you mentioned but I was not successfull.
Latest attempt a bit all over the place:
// Settings in here override those in "LSP-tailwindcss/LSP-tailwindcss.sublime-settings"
{ "settings": { "tailwindCSS.includeLanguages": { "text.html.eex": "html" }, }, "selector": "source.jsx | source.js.react | source.js | source.tsx | source.ts | source.css | source.scss | source.less | text.html.vue | text.html.svelte | text.html.basic | text.html.twig | text.blade | text.html.blade | embedding.php | text.html.rails | text.html.erb | text.haml | text.jinja | text.django | text.html.elixir | text.html.eex" }
2. LSP.sublime-settings (sorry I'm not sure what I'm doing here so just tried several):
```json
// Settings in here override those in "LSP/LSP.sublime-settings"
{
"lsp_format_on_save": true,
"log_debug": false,
"initializationOptions": {
"userLanguages": {
"tailwind": "css",
"tailwind": "text.html.eex",
"text.html.eex": "html"
},
},
}
Try:
// SublimeText base scope -> LSP Language ID overrides
{
"text.html.eex": "html"
}
@rchl thanks!
For the reference I added:
// SublimeText base scope -> LSP Language ID overrides
{
"text.html.eex": "html",
"text.html.heex": "html",
"text.html.leex": "html"
}
Which finally worked paired with appending to the selector | text.html.eex | text.html.leex | text.html.heex
:
// Settings in here override those in "LSP-tailwindcss/LSP-tailwindcss.sublime-settings"
{
"selector": "source.jsx | source.js.react | source.js | source.tsx | source.ts | source.css | source.scss | source.less | text.html.vue | text.html.svelte | text.html.basic | text.html.twig | text.blade | text.html.blade | embedding.php | text.html.rails | text.html.erb | text.haml | text.jinja | text.django | text.html.elixir | text.html.eex | text.html.leex | text.html.heex"
}
Thanks a lot for the quick help @rchl and @predragnikolic
Hi!
I'm having an issue in which it runs perfectly in say, an HTML file (autocomplete, hover information, etc), but in Elixir template files (e.g.
eex
,heex
,leex
or even in someex
with html information in them) it does not. I can see that the language server is triggered in the status bar, but nothing happens.Strange part is that if I rename the file to for example an html or a php and reopen it, it works perfectly.
From looking into this closed issue I don't think I would need any special configuration. But, I've tried specifically adding it and some other
includeLanguages
, for the several different combinations, etc, but no luck -- to be fair, I already see the language server triggered.The only message I see in the console log (even with LSP debug mode enabled), but which I think is not related since it also appears in the case I renamed it to an extension where it works is:
Any clue what the issue could be?
Thanks in advance