You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-7
Original file line number
Diff line number
Diff line change
@@ -404,7 +404,17 @@ The language server additionally includes this custom request to return a textua
404
404
405
405
## Plugins
406
406
407
-
You can register additional languages that can flow through the same CLI with Syntax Tree's plugin system. To register a new language, call:
407
+
You can register additional configuration and additional languages that can flow through the same CLI with Syntax Tree's plugin system. When invoking the CLI, you pass through the list of plugins with the `--plugins` options to the commands that accept them. They should be a comma-delimited list. When the CLI first starts, it will require the files corresponding to those names.
408
+
409
+
### Configuration
410
+
411
+
To register additional configuration, define a file somewhere in your load path named `syntax_tree/my_plugin` directory. Then when invoking the CLI, you will pass `--plugins=my_plugin`. That will get required. In this way, you can modify Syntax Tree however you would like. Some plugins ship with Syntax Tree itself. They are:
412
+
413
+
*`plugin/single_quotes` - This will change all of your string literals to use single quotes instead of the default double quotes.
@@ -416,13 +426,11 @@ In this case, whenever the CLI encounters a filepath that ends with the given ex
416
426
*`MyLanguage.parse(source)` - this should return the syntax tree corresponding to the given source. Those objects should implement the `pretty_print` interface.
417
427
*`MyLanguage.format(source)` - this should return the formatted version of the given source.
418
428
419
-
Below are listed all of the "official" plugins hosted under the same GitHub organization, which can be used as references for how to implement other plugins.
420
-
421
-
*[SyntaxTree::Haml](https://github.com/ruby-syntax-tree/syntax_tree-haml) for the [Haml template language](https://haml.info/).
422
-
*[SyntaxTree::JSON](https://github.com/ruby-syntax-tree/syntax_tree-json) for JSON.
423
-
*[SyntaxTree::RBS](https://github.com/ruby-syntax-tree/syntax_tree-rbs) for the [RBS type language](https://github.com/ruby/rbs).
429
+
Below are listed all of the "official" language plugins hosted under the same GitHub organization, which can be used as references for how to implement other plugins.
424
430
425
-
When invoking the CLI, you pass through the list of plugins with the `--plugins` options to the commands that accept them. They should be a comma-delimited list. When the CLI first starts, it will require the files corresponding to those names.
431
+
*[haml](https://github.com/ruby-syntax-tree/syntax_tree-haml) for the [Haml template language](https://haml.info/).
432
+
*[json](https://github.com/ruby-syntax-tree/syntax_tree-json) for JSON.
433
+
*[rbs](https://github.com/ruby-syntax-tree/syntax_tree-rbs) for the [RBS type language](https://github.com/ruby/rbs).
0 commit comments