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

Error: "Ranges can only be made from 6 element long" for Dockerfile #6479

Open
adoyle-h opened this issue Apr 20, 2024 · 3 comments
Open

Error: "Ranges can only be made from 6 element long" for Dockerfile #6479

adoyle-h opened this issue Apr 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@adoyle-h
Copy link

Describe the bug

When open a Dockerfile, it throws the error.

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: ...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24: Error executing lua: ...brew/Cellar/neovi
m/0.9.4/share/nvim/runtime/filetype.lua:25: BufReadPost Autocommands for "*"..FileType Autocommands for "*": Vim(append):Error executin
g lua callback: ...4/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:264: Ranges can only be made from 6 element long tables or
nodes.
stack traceback:
        [C]: in function 'set_included_ranges'
        ...4/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:264: in function 'parse'
        ...4/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:316: in function 'parse'
        ...r/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:89: in function '_create_parser'
        ...r/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:131: in function 'get_parser'
        ...r/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:459: in function 'start'
        ...lugins/nvim-treesitter/lua/nvim-treesitter/highlight.lua:20: in function 'attach'
        .../plugins/nvim-treesitter/lua/nvim-treesitter/configs.lua:509: in function 'attach_module'
        .../plugins/nvim-treesitter/lua/nvim-treesitter/configs.lua:532: in function 'reattach_module'
        .../plugins/nvim-treesitter/lua/nvim-treesitter/configs.lua:133: in function <.../plugins/nvim-treesitter/lua/nvim-treesitter/c
onfigs.lua:132>
        [C]: in function 'nvim_cmd'
        ...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:25: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/fil
etype.lua:24>
        [C]: in function 'nvim_buf_call'
        ...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/fil
etype.lua:10>
stack traceback:
        [C]: in function 'nvim_cmd'
        ...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:25: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/fil
etype.lua:24>
        [C]: in function 'nvim_buf_call'
        ...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/fil
etype.lua:10>
stack traceback:
        [C]: in function 'nvim_buf_call'
        ...brew/Cellar/neovim/0.9.4/share/nvim/runtime/filetype.lua:24: in function <...brew/Cellar/neovim/0.9.4/share/nvim/runtime/fil
etype.lua:10>

To Reproduce

  1. Crate a Dockerfile with content:
FROM ubuntu:20.04

RUN python3 <<EOF
with open("/hello", "w") as f:
    print("Hello", file=f)
    print("World", file=f)
EOF

RUN python3 <<EOF > /hello
print("Hello")
print("World")
EOF
  1. Open the file with neovim.

Expected behavior

No response

Output of :checkhealth nvim-treesitter

==============================================================================
nvim-treesitter: require("nvim-treesitter.health").check()

Installation ~
- OK `tree-sitter` found 0.20.8 (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v18.16.1 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
  Version: Apple clang version 15.0.0 (clang-1500.3.9.4)
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

OS Info:
{
  machine = "arm64",
  release = "23.1.0",
  sysname = "Darwin",
  version = "Darwin Kernel Version 23.1.0: Mon Oct  9 21:32:52 PDT 2023; root:xnu-10002.41.9~7/RELEASE_ARM64_T8122"
} ~

Parser/Features         H L F I J
  - bash                ✓ ✓ ✓ . ✓
  - beancount           ✓ . ✓ . ✓
  - bibtex              ✓ . ✓ ✓ .
  - blueprint           ✓ . . . .
  - c                   ✓ ✓ ✓ ✓ ✓
  - clojure             ✓ ✓ ✓ . ✓
  - cmake               ✓ . ✓ ✓ .
  - comment             ✓ . . . .
  - commonlisp          ✓ ✓ ✓ . .
  - cpp                 ✓ ✓ ✓ ✓ ✓
  - css                 ✓ . ✓ ✓ ✓
  - cuda                ✓ ✓ ✓ ✓ ✓
  - dart                ✓ ✓ ✓ ✓ ✓
  - diff                ✓ . . . .
  - dockerfile          ✓ . . . ✓
  - dot                 ✓ . . ✓ ✓
  - eex                 ✓ . . . ✓
  - elixir              ✓ ✓ ✓ ✓ ✓
  - elm                 ✓ . . . ✓
  - elvish              ✓ . . . ✓
  - embedded_template   ✓ . . . ✓
  - erlang              ✓ . ✓ . .
  - fennel              ✓ ✓ ✓ . ✓
  - fish                ✓ ✓ ✓ ✓ ✓
  - git_rebase          ✓ . . . ✓
  - gitattributes       ✓ ✓ . . ✓
  - gitignore           ✓ . . . .
  - glimmer             ✓ ✓ ✓ ✓ .
  - glsl                ✓ ✓ ✓ ✓ ✓
  - go                  ✓ ✓ ✓ ✓ ✓
  - godot_resource      ✓ ✓ ✓ . ✓
  - gomod               ✓ . . . ✓
  - gowork              ✓ . . . ✓
  - graphql             ✓ . . ✓ ✓
  - haskell             ✓ . ✓ . ✓
  - hcl                 ✓ . ✓ ✓ ✓
  - hjson               ✓ ✓ ✓ ✓ ✓
  - hlsl                ✓ ✓ ✓ ✓ ✓
  - html                ✓ ✓ ✓ ✓ ✓
  - http                ✓ . . . ✓
  - java                ✓ ✓ ✓ ✓ ✓
  - javascript          ✓ ✓ ✓ ✓ ✓
  - jsdoc               ✓ . . . .
  - json                ✓ ✓ ✓ ✓ .
  - json5               ✓ . . . ✓
  - jsonnet             ✓ ✓ ✓ . .
  - julia               ✓ ✓ ✓ ✓ ✓
  - kotlin              ✓ ✓ ✓ . ✓
  - latex               ✓ . ✓ . ✓
  - llvm                ✓ . . . .
  - lua                 ✓ ✓ ✓ ✓ ✓
  - make                ✓ . ✓ . ✓
  - markdown            ✓ . ✓ ✓ ✓
  - markdown_inline     ✓ . . . ✓
  - perl                ✓ . ✓ . ✓
  - pioasm              ✓ . . . ✓
  - proto               ✓ . ✓ . .
  - python              ✓ ✓ ✓ ✓ ✓
  - query               ✓ ✓ ✓ ✓ ✓
  - racket              ✓ . ✓ . ✓
  - regex               ✓ . . . .
  - rust                ✓ ✓ ✓ ✓ ✓
  - scheme              ✓ . ✓ . ✓
  - scss                ✓ . ✓ ✓ .
  - solidity            ✓ . ✓ . .
  - sparql              ✓ ✓ ✓ ✓ ✓
  - sql                 ✓ . . ✓ ✓
  - svelte              ✓ ✓ ✓ ✓ ✓
  - swift               ✓ ✓ . ✓ .
  - teal                ✓ ✓ ✓ ✓ ✓
  - toml                ✓ ✓ ✓ ✓ ✓
  - tsx                 ✓ ✓ ✓ ✓ ✓
  - twig                ✓ . . . ✓
  - typescript          ✓ ✓ ✓ ✓ ✓
  - verilog             ✓ ✓ ✓ . ✓
  - vim                 ✓ ✓ ✓ . ✓
  - vimdoc              ✓ . . . ✓
  - vue                 ✓ . ✓ ✓ ✓
  - wgsl                ✓ . ✓ ✓ .
  - yaml                ✓ ✓ ✓ ✓ ✓
  - zig                 ✓ ✓ ✓ ✓ ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang} ~

Output of nvim --version

NVIM v0.9.4
Build type: Release
LuaJIT 2.1.0-beta3

Additional context

nvim-treesitter version: commit ea4f6d5

@adoyle-h adoyle-h added the bug Something isn't working label Apr 20, 2024
@clason
Copy link
Contributor

clason commented Apr 20, 2024

Cannot reproduce. Latest version is 0.9.5, please test that. And please provide a minimal(!) reproducible config we can test with nvim --clean -u test.lua.

@lucario387
Copy link
Member

Possibly is because of injection.combined. For stable neovim it's something like { unpack(range6), unpack(range6), ... } instead of { range6, range6 }

@AtunBetun
Copy link

I get the same stack trace @adoyle-h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants