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

Lua parser fails to find ending of string enclosed by level 1 long brackets if the last character of the string is a square bracket #2030

Closed
3 tasks done
zeertzjq opened this issue Nov 20, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@zeertzjq
Copy link

Before reporting

  • I have updated my neovim version to latest master
  • I have updated my plugin to the latest version
  • I have run :TSUpdate

Describe the bug

Lua parser fails to find ending of string enclosed by level 1 Lua long brackets if the last character of the string is a square bracket.

To Reproduce

  1. Open https://raw.githubusercontent.com/neovim/neovim/725cbe7d414f609e769081276f2a034e32a4337b/test/functional/terminal/tui_spec.lua using Nvim with nvim-treesitter Lua parser for highlight.
  2. All of lines 35 to 874 are highlighted as string.

Expected behavior

Lines 35 to 874 are highlighted correctly.

Output of :checkhealth nvim-treesitter

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found  0.20.0 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v16.11.1 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: cc (GCC) 11.1.0
  - OK: Neovim was compiled with tree-sitter runtime ABI version 13 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I J
  - python         ✓ ✓ ✓ ✓ ✓ 
  - lua            ✓ ✓ ✓ ✓ ✓ 
  - cpp            ✓ ✓ ✓ ✓ ✓ 
  - c              ✓ ✓ ✓ ✓ ✓ 

  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.6.0-dev+604-g725cbe7d41
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim-git/src/build/config -I/build/neovim-git/src/neovim-git/src -I/usr/include -I/build/neovim-git/src/build/src/nvim/auto -I/build/neovim-git/src/build/include
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Additional context

Screenshot:
Screenshot_20211120_145802

@zeertzjq zeertzjq added the bug Something isn't working label Nov 20, 2021
@zeertzjq zeertzjq changed the title Fails to find ending of string enclosed by level 1 Lua long brackets if the last character of the string is a square bracket Lua parser fails to find ending of string enclosed by level 1 long brackets if the last character of the string is a square bracket Nov 21, 2021
@kyazdani42
Copy link
Member

this should be upstreamed to the lua parser repo.

@zeertzjq
Copy link
Author

Does that repo allow issues?

@kyazdani42
Copy link
Member

kyazdani42 commented Nov 28, 2021

it does not actually as we maintain it. I'll check this out when i have some time.

@theHamsta
Copy link
Member

Now it does. I changed the settings.

@zeertzjq
Copy link
Author

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

3 participants