otter.nvim icon indicating copy to clipboard operation
otter.nvim copied to clipboard

Support Just / Justifies

Open dsully opened this issue 5 months ago • 5 comments

Hi - I'm having trouble getting otter to recognize embedded bash or fish in Justfiles.

Here's an example:

build-packages +packages='all':
    #!/usr/bin/env fish

    echo "{{ packages }}"

I can see the otter embedded language server. Using the default config.

The extensions portion of the configuration obviously only works for files with extension, while "Justfile" doesn't have one.

Thanks.

dsully avatar Jun 09 '25 15:06 dsully

The extension is meant for the embedded language, fish in your case, which exists. Do you have have treesitter injections for Justfiles working?

jmbuhr avatar Jun 10 '25 10:06 jmbuhr

Yes, injections appear to be working:

Image

dsully avatar Jun 10 '25 15:06 dsully

Looks like Justfiles are a current limitation of the way we extract the injected languages. The injection.content node starts before the injection.language node, but because otter goes through the treesitter nodes in order of appearance it doesn't retroactively assign the language to the content.

jmbuhr avatar Jun 12 '25 10:06 jmbuhr

Ok - so this is an issue with tree-sitter-just it sounds like. Or I can see about updating a local injections.scm to override?

dsully avatar Jun 12 '25 15:06 dsully

No, it's an issue in otter.nvim itself, so it can be fixed.

jmbuhr avatar Jun 12 '25 16:06 jmbuhr