Open sopa0 opened 2 months ago
Your injection doesn't work for me on the css part, but it does for your js example, for which I then also get e.g. completion:
I assume you have language servers installed and configured with lspconfig for css and js respectively?
I do notice that requests seem to be offset by 1 character, so e.g. the hover for ev
is available over v
and the space
to the right of it but not over the e
:
So that part is probably a bug in otter.
btw. otter.activate()
without arguments is enough, it uses all the languages it can find by default and the other two args are also the default.
Ah, your css example had additional **
, those have to be removed to get valid syntax and thus also injections.
Ah, your css example had additional
**
, those have to be removed to get valid syntax and thus also injections.
Ah yeah right, probs a mistake on my part As far as the lsp situation, I got both cssls and vtsls working in their respective filetypes
Css is somewhat working, in the context of a multi-line string:
Though, on the first autocomplete, it indents like this and stop working until I close and reopen the file:
Interesting that the js lsp in Script("") works for you, not the case for me, I'll try making a minimal config with otter only see if it's one of my plugins giving me a hard time
In Script("") I seem to get python lsp instead:
(got both ruff and pyright)
EDIT: javascript lsp now works in Script() after I removed eslint for some reason
Hi, Currently working with FastHTML, which is a python lib, which requires me to sometimes write css and js in .py files. Something like that:
For css (example pulled from the FastHTML docs)
For js (example pulled from this repo
Basically, some utility callables take in a str as a parameter, which contains another language. I made a few TS injection queries, which are in my after/queries/python/injections.scm:
I know the queries work because I get proper highlighting for the injected langs
Now, when I run :lua require("otter").activate({"css", "javascript"}, true, true) in my python files, I get no lsp features, no autocomplete, even though otter is running, and running :lua require("otter").export() gives me correct contents for the hidden buffers (each contain their respective css and javascript content)
as far as my config goes, it's the basic one from the docs:
So, is there anything I can do on my end to fix it, or is it an issue with the plugin? Thanks