Skip to content

Commit 74fc340

Browse files
amiraliesjaredly
authored andcommitted
add coc.nvim config synchronization (#342)
1 parent f6432da commit 74fc340

File tree

2 files changed

+85
-2
lines changed

2 files changed

+85
-2
lines changed

editor-extensions/coc.nvim/package.json

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "coc-reason",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"main": "lib/index.js",
55
"description": "coc.nvim Reason language server extension",
66
"keywords": [
@@ -26,6 +26,86 @@
2626
"engines": {
2727
"coc": "^0.0.4"
2828
},
29+
"contributes": {
30+
"configuration": {
31+
"type": "object",
32+
"title": "Reason language server configuration",
33+
"properties": {
34+
"reason_language_server.location": {
35+
"type": "string",
36+
"description": "Provide a custom location for the language server binary"
37+
},
38+
"reason_language_server.build_system_override_by_root": {
39+
"type": "object",
40+
"additionalProperties": {
41+
"type": "string",
42+
"enum": [
43+
"bsb:4.0.7",
44+
"dune:esy",
45+
"dune:opam:/abs/path/to/switch",
46+
"bsb-native:4.0.7:js",
47+
"bsb-native:4.0.7:bytecode",
48+
"bsb-native:4.0.7:native"
49+
]
50+
},
51+
"description": "Only specify this if build system autodetection isn't working for you (for example if you have a bsconfig.json, and a dune file in the same project). The keys in this object should be in uri format, e.g. file:///some/path/here"
52+
},
53+
"reason_language_server.refmt": {
54+
"type": "string",
55+
"description": "Provide a custom location for the refmt binary"
56+
},
57+
"reason_language_server.lispRefmt": {
58+
"type": "string",
59+
"description": "Provide a location for the reason-lisp lispRefmt binary"
60+
},
61+
"reason_language_server.format_width": {
62+
"type": "number",
63+
"default": 80,
64+
"description": "Format width (default=80)"
65+
},
66+
"reason_language_server.per_value_codelens": {
67+
"type": "boolean",
68+
"default": false,
69+
"description": "Show the type for each top-level value in a codelens"
70+
},
71+
"reason_language_server.dependencies_codelens": {
72+
"type": "boolean",
73+
"default": true,
74+
"description": "Show the dependencies for a file at the top"
75+
},
76+
"reason_language_server.opens_codelens": {
77+
"type": "boolean",
78+
"default": true,
79+
"description": "Indicate what values have been used from an open"
80+
},
81+
"reason_language_server.show_module_path_on_hover": {
82+
"type": "boolean",
83+
"default": true,
84+
"description": "Show the module path on hover"
85+
},
86+
"reason_language_server.reloadOnChange": {
87+
"type": "boolean",
88+
"default": false,
89+
"description": "Monitor the language server binary for updates, and restart it (for development)."
90+
},
91+
"reason_language_server.show_debug_errors": {
92+
"type": "boolean",
93+
"default": false,
94+
"description": "Show errors in the console"
95+
},
96+
"reason_language_server.autoRebuild": {
97+
"type": "boolean",
98+
"default": true,
99+
"description": "Enables autorun of bsb"
100+
},
101+
"reason_language_server.useOldDuneProcess": {
102+
"type": "boolean",
103+
"default": true,
104+
"description": "Keep the old process for determining package files (for compatability, will remove soon)"
105+
}
106+
}
107+
}
108+
},
29109
"devDependencies": {
30110
"@babel/core": "^7.6.0",
31111
"@babel/preset-env": "^7.6.0",

editor-extensions/coc.nvim/src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ async function activate(context: ExtensionContext) {
5454
const serverOptions = { command };
5555

5656
const documentSelector = [{ language: 'reason', scheme: 'file' }];
57-
const clientOptions = { documentSelector };
57+
const synchronize = {
58+
configurationSection: 'reason_language_server',
59+
};
60+
const clientOptions = { documentSelector, synchronize };
5861

5962
const languageClient = new LanguageClient('reason', 'ReasonML', serverOptions, clientOptions);
6063
context.subscriptions.push(services.registLanguageClient(languageClient));

0 commit comments

Comments
 (0)