Syntax Highlighting Doesn't Work for Me #349
Answered
by
msujew
ballcoach12
asked this question in
Q&A
-
In the POC language extension that I'm building, I don't seem to be getting syntax highlighting when I test the editor in VSCode. I think I have all the required files and contents (.tmLanguage.json, language-configuration.json, package.json). Is there anything special that needs to be done in order to have the editor highlight keywords? Do I need to create a theme, maybe? {
"name": "flisr-feeder-dsl",
"scopeName": "source.flisr-feeder-dsl",
"fileTypes": [
".feeder"
],
"patterns": [
{
"include": "#comments"
},
{
"name": "keyword.control.flisr-feeder-dsl",
"match": "\\b(\\n|\\r|BRKR|Closed|Commissioned|commissionState|DEVICES|Disabled|displayName|Draft|EOL|eventDetectionSeconds|false|FEEDER|leftPTPosition|LINE_TAP|loadCapacity|lossOfSourceDetectionEnabled|lowVoltagePercentThreshold|miscoordinationDetectionEnabled|NETWORK|NF|nominalVoltage|None|normalStatus|Open|openPhaseDetectionEnabled|openPhaseDetectionSeconds|RECL|returnToNormalMode|rightPTPosition|Set1|Set2|shouldIsolateOpenPhase|SRC|SW|SWITCH|tempCapacity|true|uniqueId)\\b"
},
{
"name": "keyword.symbol.flisr-feeder-dsl",
"match": "(\\-|\\->|\\->(|\\,|\\:|\\.|\\)|\\[|\\]|\\\\n|\\\\r|\\+|\\=|\\|)"
}
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.block.flisr-feeder-dsl",
"begin": "/\\*",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.flisr-feeder-dsl"
}
},
"end": "\\*/",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.flisr-feeder-dsl"
}
}
},
{
"begin": "//",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.comment.leading.flisr-feeder-dsl"
}
},
"end": "(?=$)",
"name": "comment.line.flisr-feeder-dsl"
}
]
}
}
}
|
Beta Was this translation helpful? Give feedback.
Answered by
msujew
Jan 10, 2022
Replies: 1 comment 4 replies
-
Hi @ballcoach12, the textmate grammar looks alright. Did you reference it correctly in the |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
msujew
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @ballcoach12,
the textmate grammar looks alright. Did you reference it correctly in the
package.json
of your extension?https://github.com/langium/langium/blob/c6d977a05600a6f10cdb41c756914bd4c3085d77/packages/langium-vscode/package.json#L27-L33