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

Issue: highlighting breaks with long object lines #59

Open
rejdeboer opened this issue Mar 14, 2024 · 3 comments
Open

Issue: highlighting breaks with long object lines #59

rejdeboer opened this issue Mar 14, 2024 · 3 comments

Comments

@rejdeboer
Copy link

rejdeboer commented Mar 14, 2024

What is the issue?

Whenever you have lines that contain a lot of logic, like if-statements and variables, the syntax highlighting below that logic line breaks. This problem is triggered when writing logic lines that are longer than 128 characters

Steps to reproduce

Working example

example: 
 teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeest:
    test: test
    other_test: test

nvim screenshot:
image

Broken example (add one more e)

example:
  teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeest:
    test: test
    other_test: test

nvim screenshot:
image

What behavior is expected?

The syntax highlighting doesn't break when using lines that are longer than 128 characters

What have I already tried?

  • Update tree-sitter
  • Disable synmaxcol limit: :set synmaxcol 0
  • Run :syntax sync fromstart
@rejdeboer rejdeboer changed the title Issue: highlighting breaks with long logic lines Issue: highlighting breaks with long ${{ }} lines Mar 14, 2024
@rejdeboer rejdeboer changed the title Issue: highlighting breaks with long ${{ }} lines Issue: highlighting breaks with long object lines Mar 14, 2024
@char0n
Copy link

char0n commented Apr 11, 2024

Yeah,

I'm seeing the same on this fixture:

swagger: "2.0"
paths:
  /pet/adding-new-pets/testing-thelong-size-path-name/testing-thepath/testingthepathnameggggggggggggggggggggggggglllllllllllllla: {}

The worst thing is that the lexical analysis stops on long line and doesn't continue any further. block mapping pair of test: 3 is just skipped.

openapi: 3.1.0
paths:
  /pet/adding-new-pets/testing-thelong-size-path-name/testing-thepath/testingthepathnamegggggggggggggggggggggggggllllllllllllll: {}
test: 3  

@char0n
Copy link

char0n commented Nov 12, 2024

This has already been addressed in tree-sitter-grammars#6 and is waiting for a release in tree-sitter-grammars#15

@char0n
Copy link

char0n commented Dec 13, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants