Comments (5)
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.
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.
@azrdev - Have you used any modes in the grammar?
from jetbrains-plugin-sample.
@Shan1024 no (but maybe I will have to later)
from jetbrains-plugin-sample.
@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)
- Missed issues in editor HOT 1
- CoreASTFactory is scheduled for removal in version 2020.3 HOT 4
- Adding new custom keywords leads to errors HOT 1
- No string highlighting with \n HOT 1
- Leaf nodes should not implement INamedElement (bug fix for find usages)
- Proper Gradle setup
- Can not find SampleLanguageParser HOT 1
- Commit on antlr/jetbrains broke sample HOT 4
- NoClassDefFoundError HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jetbrains-plugin-sample.