提交 8f4e1f53 编写于 作者: P Phil Price

Update extension configuration options

上级 e27196db
......@@ -103,9 +103,14 @@
"configuration": {
"title": "Merge Conflict",
"properties": {
"merge-conflict.enabled": {
"merge-conflict.codeLens.enabled": {
"type": "boolean",
"description": "%config.enabled%",
"description": "%config.codeLensEnabled%",
"default": true
},
"merge-conflict.decorators.enabled": {
"type": "boolean",
"description": "%config.decoratorsEnabled%",
"default": true
}
}
......
......@@ -9,5 +9,6 @@
"command.next": "Next conflict",
"command.previous": "Previous conflict",
"command.compare": "Compare current conflict",
"config.enabled": "Whether merge conflict editor decorations and code lenses are enabled"
"config.codeLensEnabled": "Enable/disable merge conflict block CodeLens within editor",
"config.decoratorsEnabled": "Enable/disable merge conflict decorators within editor"
}
\ No newline at end of file
......@@ -11,8 +11,6 @@ import Decorator from './mergeDecorator';
import * as interfaces from './interfaces';
const ConfigurationSectionName = 'merge-conflict';
const FeatureEnabledProperty = 'enableEditorMerge';
const AlwaysEnableDecorations = true; // If true, merge-conflict.enableEditorMerge is ignored
export default class ServiceWrapper implements vscode.Disposable {
......@@ -51,12 +49,13 @@ export default class ServiceWrapper implements vscode.Disposable {
createExtensionConfiguration(): interfaces.IExtensionConfiguration {
const workspaceConfiguration = vscode.workspace.getConfiguration(ConfigurationSectionName);
const isEnabled: boolean = workspaceConfiguration.get(FeatureEnabledProperty, true);
const codeLensEnabled: boolean = workspaceConfiguration.get('codeLens.enabled', true);
const decoratorsEnabled: boolean = workspaceConfiguration.get('decorators.enabled', true);
return {
enableCodeLens: isEnabled,
enableDecorations: AlwaysEnableDecorations || isEnabled,
enableEditorOverview: isEnabled
enableCodeLens: codeLensEnabled,
enableDecorations: decoratorsEnabled,
enableEditorOverview: decoratorsEnabled
};
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册