Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 95dc039

Browse files
authored
Merge pull request #28 from xfalcox/print-width-support
FEATURE: Add --print-width support using extension setting
2 parents d784450 + 6cd58fa commit 95dc039

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353
"type": "object",
5454
"title": "Syntax Tree",
5555
"properties": {
56+
"syntaxTree.printWidth": {
57+
"default": 80,
58+
"markdownDescription": "The width to be used when formatting code.",
59+
"type": "number"
60+
},
5661
"syntaxTree.singleQuotes": {
5762
"default": false,
5863
"markdownDescription": "Uses single-quoted strings when possible.",

src/extension.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ export async function activate(context: ExtensionContext) {
8787
args.push(`--plugins=${Array.from(plugins).join(",")}`);
8888
}
8989

90+
// Configure print width.
91+
args.push(`--print-width=${config.get<number>("printWidth")}`)
92+
9093
// There's a bit of complexity here. Basically, if there's an open folder,
9194
// then we're going to check if the syntax_tree gem is inside the bundle. If
9295
// it is, then we'll run bundle exec stree. This is good, because it'll

0 commit comments

Comments
 (0)