eclipse-tm4e / tm4e

TextMate support in Eclipse IDE
https://projects.eclipse.org/projects/technology.tm4e
Eclipse Public License 2.0
93 stars 56 forks source link

ClassCastException from RawCaptures.getCaptures #754

Open zulus opened 5 months ago

zulus commented 5 months ago

Looks like tm4e have trouble with parsing own built-in language_pack. There is a ClassCastException in logs, that prevents syntax coloring for vue files.

Problem appear during initial loading (startup) org.eclipse.tm4e.language_pack/syntaxes/go/go.tmLanguage.json, and loading patterns for keyword.function.go

sebthom commented 5 months ago

I cannot reproduce this. Please provide a reproducible example and a stacktrace.

zulus commented 5 months ago

I had to modify RawCaptures a little bit to catch stacktrace:


java.lang.ClassCastException: class org.eclipse.tm4e.core.internal.parser.PropertySettable$ArrayList cannot be cast to class org.eclipse.tm4e.core.internal.grammar.raw.IRawRule (org.eclipse.tm4e.core.internal.parser.PropertySettable$ArrayList and org.eclipse.tm4e.core.internal.grammar.raw.IRawRule are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @759cdfc8)
    at org.eclipse.tm4e.core.internal.grammar.raw.RawCaptures.getCapture(RawCaptures.java:23)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory._compileCaptures(RuleFactory.java:129)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$1(RuleFactory.java:96)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:207)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:51)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:171)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$1(RuleFactory.java:76)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:207)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:51)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:171)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$1(RuleFactory.java:76)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:207)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:51)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:171)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$1(RuleFactory.java:76)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:207)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:51)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:199)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$1(RuleFactory.java:89)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:207)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:51)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:208)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$1(RuleFactory.java:99)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:207)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:51)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:171)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$1(RuleFactory.java:76)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:207)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:51)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:171)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$1(RuleFactory.java:76)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:207)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:51)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:171)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$1(RuleFactory.java:76)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:207)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:51)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:199)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$1(RuleFactory.java:99)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:207)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:51)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:208)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$1(RuleFactory.java:99)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:207)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:51)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:208)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$1(RuleFactory.java:99)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:207)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:51)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory._compilePatterns(RuleFactory.java:208)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.lambda$1(RuleFactory.java:76)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.registerRule(Grammar.java:207)
    at org.eclipse.tm4e.core.internal.rule.RuleFactory.getCompiledRuleId(RuleFactory.java:51)
    at org.eclipse.tm4e.core.internal.grammar.Grammar._tokenize(Grammar.java:281)
    at org.eclipse.tm4e.core.internal.grammar.Grammar.tokenizeLine(Grammar.java:259)
    at org.eclipse.tm4e.core.model.TMTokenizationSupport.tokenize(TMTokenizationSupport.java:81)
    at org.eclipse.tm4e.core.model.TMModel$TokenizerThread.revalidateTokens(TMModel.java:250)
    at org.eclipse.tm4e.core.model.TMModel$TokenizerThread.run(TMModel.java:173)
zulus commented 5 months ago

I cannot reproduce this. Please provide a reproducible example and a stacktrace.

It depends to disk load order, once I'll find correct scenario I'll put here. ClassCastException normally is hidden