Git Product home page Git Product logo

Comments (5)

bjansen avatar bjansen commented on June 7, 2024 3

Right, this is described in the SDK docs:

Note: Lexers, and in particular JFlex-based lexers, need to be created in such a way that they always match the entire contents of the file, without any gaps between tokens, and generate special tokens for characters which are not valid at their location. Lexers must never abort prematurely because of an invalid character.

For ANTLRv4 grammars, this means that you should never skip() tokens, but rather use channel(HIDDEN) instead like @nixel2007 suggested.

See also antlr/antlr4-intellij-adaptor#3 and this explanation from someone working at JetBrains.

from jetbrains-plugin-sample.

nixel2007 avatar nixel2007 commented on June 7, 2024 2

I've faced this issue with WHITESPACE rule with -> skip(). rewrote it in -> channel(HIDDEN) and a problem has gone. not sure if it'll make my life harder in the future, but it solves current problem. hope it helps.

from jetbrains-plugin-sample.

Shan1024 avatar Shan1024 commented on June 7, 2024

@azrdev - Have you used any modes in the grammar?

from jetbrains-plugin-sample.

azrdev avatar azrdev commented on June 7, 2024

@Shan1024 no (but maybe I will have to later)

from jetbrains-plugin-sample.

Shan1024 avatar Shan1024 commented on June 7, 2024

@azrdev - I encountered this issue but could not find any solution for it yet. I thought it was due to some issue in modes since it occurs in one mode that I have. Seems like that is not the case then.

from jetbrains-plugin-sample.

Related Issues (10)

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.