Revise json5formatSource code, keep keyname double quotes.The plugin logic is very simple, the fault tolerance is very limited TODO Under the TAB being edited, press CTRL + Command + 5 to format the JSON5 edited, as follows: Under the Sublime window: Preferences - Shortcuts Settingsįill in the following text (you can set the shortcut keys you want to set) to save. Os.system("formatjson5 -r /var/tmp/json5/format.json")įr = open('/var/tmp/json5/format.json','r') # Call the format command format JSON5 and rewrote the intermediate file # Create an intermediate file and write a full textįw = open('/var/tmp/json5/format.json','w') Save the following code as a json5.py file, and put it in / users / YouruserName / library / application support / sublime text / packages / user / under: import sublimeĬlass Json5Command(sublime_plugin.TextCommand):Ĭontents = (sublime.Region(0, ())) Sublime installed JSON5 plugin New user custom plugin target/debug/examples/formatjson5 /usr/local/bin/ (base) ~/RustProject/json5format cargo build -examplesĬompiling json5format v0.1.4 (/Users/wangbaoshan/RustProject/json5format)įinished dev target(s) in 3.15s text Mac installation JSON5FORMAT command Other versions can try, there should be no compatibility issues. Automatic Code Linting & Formatting with ESLint and Prettier in Sublime Text 3 by Nafeu Nasir Medium Write Sign up Sign In 500 Apologies, but something went wrong on our end. "Python" 6 Python executing shell command method Version Sublime TEXT 3 Chinese Document Plugin Extension API Reference I am non-Python technology stack, so the plugin writing is basically used, and the code may not be elegant enough, do not spray. json5formatTherefore, it takes advantage of its command to implement the Sublime format JSON5 plugin - Json5.īasic ideas are binders for the Sublime plug-in logic, call the JSON5Format command to format and replace the original. ![]() The only basic satisfaction requires that the Rust language is implemented. However, the library is searched in JSON5, and it is basically a string formatted to JSON5 format to JSON, and cannot be retained, and the requirements cannot be met.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |