Skip to content

Commit 767662f

Browse files
Refactor and improve colorization language services support (#4433)
* saving current progress * Migrated to json, moved from directly in patterns to repository. Using the cmake-language documentation (https://cmake.org/cmake/help/latest/manual/cmake-language.7.html) and the language grammars documentation (https://macromates.com/manual/en/language_grammars) I've migrated to json, as well as modify the 'name' fields to match names that have common themes associated. I have it working but haven't figured out the 'string' pattern, something is messing up with that one * fix the string pattern Turns out, after investigating why the string pattern wasn't working, negative lookbehinds, or any lookbehinds for that matter, aren't valid in TextMate Grammars * no need for the captures in the string pattern * split booleans out of operators Based on docs here: https://cmake.org/cmake/help/latest/command/if.html#matches, many of the operators should be broken out into specific booleans. I still need to figure out how to get it to recognize that we shouldn't identify the various properties, variables, etc, incorrectly * missed \\ to escape properly when matching what we have in our former xml * Add generator expression. Based on this documentation: https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html. The captures were necessary to capture the entire statement, otherwise the matching didn't fully do what we wanted * Add recursive generator expression This ensures that nested generator expressions are matched correctly * Add variable references as a pattern Within generator expressions, it'd still be nice to match variable references. * committing a TODO for unquoted and escape sequences, won't work as is because of json comments not being supported * Add unquoted It's not fully working, doesn't match the first in the parameter list, or the last, seems to miss some escaping characters, WIP * Slightly modify the names of some, add unquoted There is still more to do. I want to make this match more builtIn variables and properties, and then PR, though there will still be more work to make it fully implementing the spec * add a couple built in variables
1 parent 85e8f03 commit 767662f

File tree

5 files changed

+233
-318
lines changed

5 files changed

+233
-318
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@
131131
{
132132
"language": "cmake",
133133
"scopeName": "source.cmake",
134-
"path": "./syntaxes/CMake.tmLanguage"
134+
"path": "./syntaxes/CMake.tmLanguage.json"
135135
},
136136
{
137137
"language": "cmake-cache",
138138
"scopeName": "source.cmakecache",
139-
"path": "./syntaxes/CMakeCache.tmLanguage"
139+
"path": "./syntaxes/CMakeCache.tmLanguage.json"
140140
}
141141
],
142142
"commands": [

syntaxes/CMake.tmLanguage

Lines changed: 0 additions & 239 deletions
This file was deleted.

0 commit comments

Comments
 (0)