-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: semantic highlighting support (#640)
* feat: add semantic token * fix: custom token and enhancment * fix: unit tests * fix: coverage * chore: change set * fix: no semantic for none xml view files
- Loading branch information
1 parent
0fe9a18
commit 2c71dfa
Showing
35 changed files
with
1,752 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@ui5-language-assistant/vscode-ui5-language-assistant-bas-ext": patch | ||
"vscode-ui5-language-assistant": patch | ||
"@ui5-language-assistant/binding-parser": patch | ||
"@ui5-language-assistant/binding": patch | ||
--- | ||
|
||
add semantic highlighting support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
export * as BindingParserTypes from "./binding-parser"; | ||
|
||
export interface ExtractBindingSyntax { | ||
startIndex: number; | ||
endIndex: number; | ||
expression: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
packages/binding-parser/test/unit/data/quotes/key-colon-value/escaped/double-quotes/ast.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"bindings": [ | ||
{ | ||
"leftCurly": { | ||
"type": "left-curly", | ||
"text": "{", | ||
"range": "[(0,0)..(0,1)]" | ||
}, | ||
"elements": [ | ||
{ | ||
"key": { | ||
"type": "key", | ||
"text": "$filter", | ||
"range": "[(1,4)..(1,11)]", | ||
"originalText": "$filter" | ||
}, | ||
"colon": { | ||
"type": "colon", | ||
"text": ":", | ||
"range": "[(1,12)..(1,13)]" | ||
}, | ||
"value": { | ||
"type": "string-value", | ||
"text": "\"TravelStatus_code eq \\\"O\\\" and IsActiveEntity eq false or SiblingEntity/IsActiveEntity eq null\"", | ||
"range": "[(1,14)..(1,110)]" | ||
}, | ||
"range": "[(1,4)..(1,110)]", | ||
"type": "structure-element" | ||
} | ||
], | ||
"rightCurly": { | ||
"type": "right-curly", | ||
"text": "}", | ||
"range": "[(2,0)..(2,1)]" | ||
}, | ||
"range": "[(0,0)..(2,1)]", | ||
"commas": [], | ||
"type": "structure-value" | ||
} | ||
], | ||
"spaces": [ | ||
{ | ||
"type": "white-space", | ||
"text": "\n ", | ||
"range": "[(0,1)..(1,4)]" | ||
}, | ||
{ | ||
"type": "white-space", | ||
"text": " ", | ||
"range": "[(1,11)..(1,12)]" | ||
}, | ||
{ | ||
"type": "white-space", | ||
"text": " ", | ||
"range": "[(1,13)..(1,14)]" | ||
}, | ||
{ | ||
"type": "white-space", | ||
"text": "\n", | ||
"range": "[(1,110)..(1,111)]" | ||
} | ||
], | ||
"type": "template" | ||
} |
82 changes: 82 additions & 0 deletions
82
packages/binding-parser/test/unit/data/quotes/key-colon-value/escaped/double-quotes/cst.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
"name": "template", | ||
"children": { | ||
"object": [ | ||
{ | ||
"name": "object", | ||
"children": { | ||
"left-curly": [ | ||
{ | ||
"image": "{", | ||
"startColumn": 1, | ||
"endColumn": 1, | ||
"tokenTypeName": "left-curly" | ||
} | ||
], | ||
"object-item": [ | ||
{ | ||
"name": "object-item", | ||
"children": { | ||
"key": [ | ||
{ | ||
"image": "$filter", | ||
"startColumn": 5, | ||
"endColumn": 11, | ||
"tokenTypeName": "key" | ||
} | ||
], | ||
"colon": [ | ||
{ | ||
"image": ":", | ||
"startColumn": 13, | ||
"endColumn": 13, | ||
"tokenTypeName": "colon" | ||
} | ||
], | ||
"value": [ | ||
{ | ||
"name": "value", | ||
"children": { | ||
"string-value": [ | ||
{ | ||
"image": "\"TravelStatus_code eq \\\"O\\\" and IsActiveEntity eq false or SiblingEntity/IsActiveEntity eq null\"", | ||
"startColumn": 15, | ||
"endColumn": 110, | ||
"tokenTypeName": "string-value" | ||
} | ||
] | ||
}, | ||
"location": { | ||
"startColumn": 15, | ||
"endColumn": 110 | ||
} | ||
} | ||
] | ||
}, | ||
"location": { | ||
"startColumn": 5, | ||
"endColumn": 110 | ||
} | ||
} | ||
], | ||
"right-curly": [ | ||
{ | ||
"image": "}", | ||
"startColumn": 1, | ||
"endColumn": 1, | ||
"tokenTypeName": "right-curly" | ||
} | ||
] | ||
}, | ||
"location": { | ||
"startColumn": 1, | ||
"endColumn": 1 | ||
} | ||
} | ||
] | ||
}, | ||
"location": { | ||
"startColumn": 1, | ||
"endColumn": 1 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...ages/binding-parser/test/unit/data/quotes/key-colon-value/escaped/double-quotes/input.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
$filter : "TravelStatus_code eq \"O\" and IsActiveEntity eq false or SiblingEntity/IsActiveEntity eq null" | ||
} |
1 change: 1 addition & 0 deletions
1
...ding-parser/test/unit/data/quotes/key-colon-value/escaped/double-quotes/lexer-errors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
1 change: 1 addition & 0 deletions
1
...ding-parser/test/unit/data/quotes/key-colon-value/escaped/double-quotes/parse-errors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
70 changes: 70 additions & 0 deletions
70
packages/binding-parser/test/unit/data/quotes/key-colon-value/escaped/single-quotes/ast.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"bindings": [ | ||
{ | ||
"leftCurly": { | ||
"type": "left-curly", | ||
"text": "{", | ||
"range": "[(0,0)..(0,1)]" | ||
}, | ||
"elements": [ | ||
{ | ||
"key": { | ||
"type": "key", | ||
"text": "$filter", | ||
"range": "[(1,4)..(1,11)]", | ||
"originalText": "$filter" | ||
}, | ||
"colon": { | ||
"type": "colon", | ||
"text": ":", | ||
"range": "[(1,12)..(1,13)]" | ||
}, | ||
"value": { | ||
"type": "string-value", | ||
"text": "'TravelStatus_code eq \\'O\\' and IsActiveEntity eq false or SiblingEntity/IsActiveEntity eq null'", | ||
"range": "[(1,14)..(1,110)]" | ||
}, | ||
"range": "[(1,4)..(1,110)]", | ||
"type": "structure-element" | ||
} | ||
], | ||
"rightCurly": { | ||
"type": "right-curly", | ||
"text": "}", | ||
"range": "[(2,0)..(2,1)]" | ||
}, | ||
"range": "[(0,0)..(2,1)]", | ||
"commas": [ | ||
{ | ||
"type": "comma", | ||
"text": ",", | ||
"range": "[(1,110)..(1,111)]" | ||
} | ||
], | ||
"type": "structure-value" | ||
} | ||
], | ||
"spaces": [ | ||
{ | ||
"type": "white-space", | ||
"text": "\n ", | ||
"range": "[(0,1)..(1,4)]" | ||
}, | ||
{ | ||
"type": "white-space", | ||
"text": " ", | ||
"range": "[(1,11)..(1,12)]" | ||
}, | ||
{ | ||
"type": "white-space", | ||
"text": " ", | ||
"range": "[(1,13)..(1,14)]" | ||
}, | ||
{ | ||
"type": "white-space", | ||
"text": "\n", | ||
"range": "[(1,111)..(1,112)]" | ||
} | ||
], | ||
"type": "template" | ||
} |
Oops, something went wrong.