Skip to content

Commit 2a99e67

Browse files
LeszekSwirskijacobdufault
authored andcommitted
Add option to disable formatting
Since people may want to use other formatting plugins, add an option to disable formatting via a middleware intercept.
1 parent a0f3391 commit 2a99e67

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,11 @@
828828
"type": "boolean",
829829
"default": true,
830830
"description": "If true, parameter declarations are inserted as snippets in function/method call arguments when completing a function/method call"
831+
},
832+
"cquery.formatting.enabled": {
833+
"type": "boolean",
834+
"default": true,
835+
"description": "If document formatting is enabled/disabled"
831836
}
832837
}
833838
}

src/extension.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ function getClientConfig(context: ExtensionContext) {
133133
['diagnostics.onType', 'diagnostics.onType'],
134134
['codeLens.localVariables', 'codeLens.onLocalVariables'],
135135
['emitInactiveRegions', 'misc.showInactiveRegions'],
136+
['formatting.enabled', 'formatting.enabled'],
136137
];
137138
let clientConfig = {
138139
launchCommand: '',
@@ -142,7 +143,7 @@ function getClientConfig(context: ExtensionContext) {
142143
},
143144
workspaceSymbol: {
144145
sort: false,
145-
}
146+
},
146147
};
147148
let config = workspace.getConfiguration('cquery');
148149
for (let prop of configMapping) {

0 commit comments

Comments
 (0)