Giter Site home page Giter Site logo

Comments (9)

damieng avatar damieng commented on July 23, 2024 1

I've found this - it seems to be a very recent regression, let me investigate.

from tree-sitter-c-sharp.

damieng avatar damieng commented on July 23, 2024

Tree-Sitter Grammars do not, themselves, do any syntax highlighting.

What IDE/editor/viewer are you using?

from tree-sitter-c-sharp.

musjj avatar musjj commented on July 23, 2024

Sorry for not being specific, I guess. I'm using neovim, and it seems that problem isn't the highlighting, but the fact that they're not parsed correctly:

With variable assignment

image
image

Without variable assignment

image
image

from tree-sitter-c-sharp.

damieng avatar damieng commented on July 23, 2024

Your block of code parses as:

  (compilation_unit
      (global_statement
        (local_declaration_statement
          (variable_declaration
            (identifier)
            (variable_declarator
              (identifier)
              (equals_value_clause
                (invocation_expression
                  (generic_name
                    (identifier)
                    (type_argument_list
                      (identifier)))
                  (argument_list
                    (argument
                      (string_literal)))))))))
      (global_statement
        (expression_statement
          (invocation_expression
            (generic_name
              (identifier)
              (type_argument_list
                (identifier)))
            (argument_list
              (argument
                (string_literal)))))))

So both of them are mapping to the exact same block during the parsing phase. I checkout our tagging system which is used by highlighters as well:

image

While I'm not familiar with NeoVIM I would suggest trying to disable OmniSharp to see if the syntax on first then matches the syntax on the second.

from tree-sitter-c-sharp.

musjj avatar musjj commented on July 23, 2024

I've turned off the LSP, but no luck.
image
Weirdly, it seems that it got parsed as a binary expression for me. I wonder if my parser is outdated or something...

from tree-sitter-c-sharp.

damieng avatar damieng commented on July 23, 2024

Regression introduced in #294 which also shows a lack of these use cases in the corpus tests.

from tree-sitter-c-sharp.

damieng avatar damieng commented on July 23, 2024

Should now be working correctly here - neovim-tree-sitter will need to update their reference to the latest commit on master.

from tree-sitter-c-sharp.

musjj avatar musjj commented on July 23, 2024

Thanks a lot for the swift response! I'll give it a go once they bumped up the commit in the repo.

from tree-sitter-c-sharp.

musjj avatar musjj commented on July 23, 2024

This is fixed now, thanks a lot!

from tree-sitter-c-sharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.