Closed protalis closed 6 years ago
I'm pretty sure that converting from a .sublime-syntax
file to a tmLanguage
/PList XML is unsupported, (i.e. because .sublime-syntax
supports/contains a superset of .tmLanguage
functionality) and that this conversion functionality in PackageDev was designed to convert from a .YAML-tmLanguage
to a .tmLanguage
for old versions of ST before .sublime-syntax
was invented, but I could be wrong.
If you really need to make a .tmLanguage
(e.g. for compatibility with other editors), generally you should write a .YAML-tmLanguage
or .JSON-tmLanguage
and convert that, rather than work with .sublime-syntax
. But, it seems that for your example, you can work around the problem by changing your captures to:
captures:
"1": meta.preprocessor.c++
"2": keyword.control.include.c++
i.e. quoting the numbers - it still seems to work okay as a .sublime-syntax
in ST and no longer fails to be converted.
Exactly what @keith-hall said. Converting a .sublime-syntax
to a .tmLanguage
will never be supported because one provides a subset of the features of the other.
Even if you turn the captures keys into strings, the produced file won't be a valid tmLanguage because its structure is different. You have to decide on whether you need tmLanguage support and if you do, start working on a YAML-tmLanguage and don't care about sublime-syntax. The old format is still described in here: http://docs.sublimetext.info/en/latest/reference/syntaxdefs.html.
Any use of captures in YAML produces error on build to PLIST.
Feels like something in my environment, rather than a bug---but not very familiar with ST3 internals so not sure how to resolve.
Thank you for any help which you can provide.
Parsing YAML... (.config/sublime-text-3/Packages/User/test.sublime-syntax) Writing Property List... (.config/sublime-text-3/Packages/User/test.PLIST-sublime-syntax) Unexpected error occurred while dumping, please see the console for details.
generating syntax summary Traceback (most recent call last): File "plugins_.lib.sublimelib in .config/sublime-text-3/Installed Packages/PackageDev.sublime-package", line 59, in run File "/opt/sublime_text/sublimeplugin.py", line 795, in run return self.run(**args) File "plugins_.fileconversion in .config/sublime-text-3/Installed Packages/PackageDev.sublime-package", line 240, in run File "plugins.lib.fileconv.dumpers in .config/sublime-text-3/Installed Packages/PackageDev.sublime-package", line 177, in dump File "plugins_.lib.fileconv.dumpers in .config/sublime-text-3/Installed Packages/PackageDev.sublime-package", line 285, in write File "./python3.3/plistlib.py", line 94, in writePlist File "./python3.3/plistlib.py", line 218, in writeValue File "./python3.3/plistlib.py", line 247, in writeDict File "./python3.3/plistlib.py", line 218, in writeValue File "./python3.3/plistlib.py", line 247, in writeDict File "./python3.3/plistlib.py", line 224, in writeValue File "./python3.3/plistlib.py", line 256, in writeArray File "./python3.3/plistlib.py", line 218, in writeValue File "./python3.3/plistlib.py", line 247, in writeDict File "./python3.3/plistlib.py", line 218, in writeValue File "./python3.3/plistlib.py", line 245, in writeDict TypeError: keys must be strings