diff --git a/lib/app-integrator.js b/lib/app-integrator.js index f8acb5b..94db6cf 100644 --- a/lib/app-integrator.js +++ b/lib/app-integrator.js @@ -1,7 +1,7 @@ 'use strict'; -const EXTENSION_NAMESPACE = 'textmarker'; +const Const = require('./const'); class AppIntegrator { @@ -26,14 +26,14 @@ class AppIntegrator { _registerCommands(context) { const app = this._app; const disposable = this._vscode.commands.registerCommand( - `${EXTENSION_NAMESPACE}.clearAllHighlight`, app.clearAllHighlight.bind(app)); + `${Const.EXTENSION_NAME}.clearAllHighlight`, app.clearAllHighlight.bind(app)); context.subscriptions.push(disposable); } _registerTextEditorCommands(context) { const app = this._app; const disposable = this._vscode.commands.registerTextEditorCommand( - `${EXTENSION_NAMESPACE}.markText`, app.markText.bind(app)); + `${Const.EXTENSION_NAME}.markText`, app.markText.bind(app)); context.subscriptions.push(disposable); } diff --git a/lib/config-store.js b/lib/config-store.js index 2f82560..5252db6 100644 --- a/lib/config-store.js +++ b/lib/config-store.js @@ -1,13 +1,15 @@ 'use strict'; +const Const = require('./const'); + class ConfigStore { constructor(params) { this._workspace = params.workspace; } get(configName) { - const extensionConfig = this._workspace.getConfiguration('textmarker'); + const extensionConfig = this._workspace.getConfiguration(Const.EXTENSION_NAME); return extensionConfig.get(configName); } } diff --git a/lib/const.js b/lib/const.js new file mode 100644 index 0000000..9d09bf2 --- /dev/null +++ b/lib/const.js @@ -0,0 +1,6 @@ + +module.exports = { + + EXTENSION_NAME: 'textmarker' + +};