Skip to content

Commit 9237769

Browse files
committed
Support the ignoreFiles option explicitly in the VSCode config
1 parent f244fc2 commit 9237769

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@
6464
},
6565
"type": "array"
6666
},
67+
"syntaxTree.ignoreFiles": {
68+
"default": "",
69+
"markdownDescription": "A glob pattern of files to ignore for formatting.",
70+
"type": "string"
71+
},
6772
"syntaxTree.printWidth": {
6873
"markdownDescription": "The width to be used when formatting code.",
6974
"type": "number"

src/extension.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ export async function activate(context: ExtensionContext) {
183183
args.push(`--print-width=${printWidth}`);
184184
}
185185

186+
// Configure ignore files if any.
187+
const ignoreFiles = config.get<string>("ignoreFiles");
188+
if (ignoreFiles) {
189+
args.push(`--ignore-files=${ignoreFiles}`);
190+
}
191+
186192
const run = await getServerOptions(args);
187193
outputChannel.appendLine(`Starting language server: ${run.command} ${run.args?.join(" ")}`);
188194

0 commit comments

Comments
 (0)