diff --git a/package.json b/package.json index 60a5b04..16765cd 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,11 @@ "type": "object", "title": "Syntax Tree", "properties": { + "syntaxTree.printWidth": { + "default": 80, + "markdownDescription": "The width to be used when formatting code.", + "type": "number" + }, "syntaxTree.singleQuotes": { "default": false, "markdownDescription": "Uses single-quoted strings when possible.", diff --git a/src/extension.ts b/src/extension.ts index 1563ac5..4fd7746 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -87,6 +87,9 @@ export async function activate(context: ExtensionContext) { args.push(`--plugins=${Array.from(plugins).join(",")}`); } + // Configure print width. + args.push(`--print-width=${config.get("printWidth")}`) + // There's a bit of complexity here. Basically, if there's an open folder, // then we're going to check if the syntax_tree gem is inside the bundle. If // it is, then we'll run bundle exec stree. This is good, because it'll