Skip to content

Commit 9abc163

Browse files
committed
Add enable/disable option
1 parent f5a7f01 commit 9abc163

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@
2323
"activationEvents": [
2424
"onLanguage:elixir"
2525
],
26+
"configuration": {
27+
"type": "object",
28+
"title": "Elixir Config",
29+
"properties": {
30+
"elixir.enable": {
31+
"type": "boolean",
32+
"default": true,
33+
"description": "Enable elixir extension"
34+
}
35+
}
36+
},
2637
"author": {
2738
"name": "Amirali Esmaeili",
2839
"email": "[email protected]"

src/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
// @flow
22

3-
import { LanguageClient, services, ExtensionContext } from 'coc.nvim';
3+
import { LanguageClient, services, ExtensionContext, workspace } from 'coc.nvim';
44

55
exports.activate = (context: ExtensionContext) => {
6+
const config = workspace.getConfiguration().get('elixir', {});
7+
8+
if (config.enable === false) {
9+
return;
10+
}
11+
612
const command = context.asAbsolutePath('./els-release/language_server.sh');
713
const serverOptions = {
814
command,

0 commit comments

Comments
 (0)