on master help sign in
Haskell Language Server.novaextension/Scripts/download.js+42−1
since splitsnapshots
unifiedsplit
@@ -5,6 +5,8 @@ const {
5const {
5const {
6 readStream,
6 readStream,
7 getStorage,
7 getStorage,
8+ call,
9+ hasCustomEnv
8} = require("utils");
10} = require("utils");
9
11
10exports.getHLS = getHLS;
12exports.getHLS = getHLS;
@@ -43,6 +45,9 @@ async function downloadTool(name) {
43 const storagePath = getStorageForTool(name);
45 const storagePath = getStorageForTool(name);
44 console.log("Downloading " + storagePath);
46 console.log("Downloading " + storagePath);
45 const urls = await getHLSAssets();
47 const urls = await getHLSAssets();
48+ if (!(name in urls)) {
49+ sendPermanentNotification("There is no pre-built HLS for GHC " + name ,"There is no pre-built version of HLS for GHC " + name + ". You can either build HLS yourself or update your project to one of the pre-built versions: https://github.com/haskell/haskell-language-server/releases")
50+ }
46 const response = await fetch(urls[name]);
51 const response = await fetch(urls[name]);
47 if (!response.ok) {
52 if (!response.ok) {
48 console.error(response.statusText);
53 console.error(response.statusText);
@@ -128,7 +133,7 @@ async function getGHCVersion() {
128 sendPermanentNotification(
133 sendPermanentNotification(
129 tool + " not installed!",
134 tool + " not installed!",
130 "Please install " + tool +
135 "Please install " + tool +
131− " and restart Haskell Language Server.",
136+ " and restart Haskell Language Server.",
132 );
137 );
133 } else {
138 } else {
134 sendPermanentNotification("Couldn't detect GHC version", x);
139 sendPermanentNotification("Couldn't detect GHC version", x);
@@ -141,7 +146,28 @@ async function getGHCVersion() {
141 return promise;
146 return promise;
142}
147}
143async function getHLS() {
148async function getHLS() {
149+ const explicitPath = nova.workspace.config.get("haskell-language-server-path")
150+ if (explicitPath) {
151+ sendNotification("HLS path specified in settings", "Using the path to haskell-language-server specified in settings.")
152+ return explicitPath
153+ }
154+
155+ const localHLSPath = await which("haskell-language-server").catch((_) => null)
156+ if (hasCustomEnv() && localHLSPath) {
157+ return localHLSPath
158+ }
159+
144 const version = await getGHCVersion();
160 const version = await getGHCVersion();
161+ if (localHLSPath) {
162+ sendNotification("Found HLS", "Found haskell-language-server in PATH. Checking if it is the right version.")
163+ const v = await getHLSVersion(localHLSPath)
164+ if (v === version) {
165+ sendNotification("Using local HLS", "The haskell-language-server in PATH has the right version. Using it.")
166+ return localHLSPath
167+ } else {
168+ sendNotification("Not using local HLS", "The haskell-language-server in PATH is built fot GHC " + v + " but we need GHC " + version + ". Trying other alternatives.")
169+ }
170+ }
145 return await getTool(version);
171 return await getTool(version);
146}
172}
147
173
@@ -156,3 +182,18 @@ function getToolName(name) {
156function notifyToolDownloading(name) {
182function notifyToolDownloading(name) {
157 sendNotification("Downloading tool", "Downloading " + getToolName(name));
183 sendNotification("Downloading tool", "Downloading " + getToolName(name));
158}
184}
185+
186+function getHLSVersion(path) {
187+ return call(path, {
188+ args: ["--version"],
189+ })
190+ .then((x) => x.match(/\(GHC: (\S+)\)/)[1].trim())
191+ .catch((err) => sendPermanentNotification("HLS version check failed", err))
192+}
193+
194+function which(name) {
195+ return call("/usr/bin/which", {
196+ args: [name],
197+ shell: true,
198+ }).then((p) => p.trim())
199+}
Haskell Language Server.novaextension/Scripts/main.js+6−7
@@ -9,8 +9,9 @@ const {
9 getHLSConfig,
9 getHLSConfig,
10} = require("configuration");
10} = require("configuration");
11const {
11const {
12− getFileName,
12+ getFileName, createEnv, getEnv
13} = require("utils");
13} = require("utils");
14+
14exports.activate = function () {
15exports.activate = function () {
15 nova.commands.register("stop", (_workspace) => {
16 nova.commands.register("stop", (_workspace) => {
16 stopServer();
17 stopServer();
@@ -23,7 +24,7 @@ exports.activate = function () {
23 startServer();
24 startServer();
24 });
25 });
25 nova.commands.register("format", formatFile);
26 nova.commands.register("format", formatFile);
26− startServer();
27+ // startServer();
27};
28};
28exports.deactivate = function () {
29exports.deactivate = function () {
29 // Clean up state before the extension is deactivated
30 // Clean up state before the extension is deactivated
@@ -107,10 +108,12 @@ function applyAllLSPEdits(edits, text) {
107}
108}
108let lspClient = null;
109let lspClient = null;
109async function startServer() {
110async function startServer() {
111+ await createEnv()
110 stopServer();
112 stopServer();
111 const path = await getServerPath();
113 const path = await getServerPath();
114+ const env = await getEnv()
112 const serverOptions = {
115 const serverOptions = {
113− path: path,
116+ path, env,
114 args: ["lsp", "--cwd", nova.workspace.path],
117 args: ["lsp", "--cwd", nova.workspace.path],
115 };
118 };
116 const clientOptions = {
119 const clientOptions = {
@@ -137,7 +140,3 @@ function stopServer() {
137function getServerPath() {
140function getServerPath() {
138 return getHLS();
141 return getHLS();
139}
142}
140−
141−// function getLogPath() {
142−// return getStorage() + "/haskell-language-server.log";
143−// }
Haskell Language Server.novaextension/Scripts/utils.js+92−1
@@ -1,3 +1,8 @@
1+const {
2+ sendNotification,
3+ sendPermanentNotification,
4+} = require("notifications");
5+
1function readStream(readableStream) {
6function readStream(readableStream) {
2 return new Promise((resolve, _reject) => {
7 return new Promise((resolve, _reject) => {
3 const reader = readableStream.getReader();
8 const reader = readableStream.getReader();
@@ -48,4 +53,90 @@ function traceRaw(x) {
48 return x;
53 return x;
49}
54}
50
55
56+async function call(path, args) {
57+ const env = await getEnv()
58+ const process = new Process(path, {...args, ...{env}});
59+ const promise = new Promise((resolve, reject) => {
60+ process.onDidExit((exitCode) => {
61+ console.log(exitCode)
62+ if (exitCode == 0) {
63+ readStream(process.stdout).then((x) => {
64+ resolve(x);
65+ });
66+ } else {
67+ readStream(process.stderr).then((x) => {
68+ reject(x)
69+ });
70+ }
71+ });
72+ })
73+ process.start()
74+ return promise
75+}
76+
77+
78+function parseEnvs(x) {
79+ const env = {}
80+ for (line of x.split("\n")) {
81+ const res = line.match(/(.*?)=(.*)/)
82+ if (res) {
83+ env[res[1]] = res[2]
84+ }
85+ }
86+
87+ console.log(JSON.stringify(env))
88+
89+ return env
90+}
91+
92+let envCache = null
93+
94+async function createEnv() {
95+ const generator = nova.workspace.config.get("env-generator")
96+ if (generator) {
97+ const [prog, ...args] = generator.split(/\s+/)
98+ sendNotification("Generating environment", "Executing " + generator + ".")
99+ const process = new Process(prog, {
100+ shell: true,
101+ args,
102+ cwd: nova.workspace.path
103+ });
104+ const promise = new Promise((resolve, reject) => {
105+ process.onDidExit((exitCode) => {
106+ console.log(exitCode)
107+ if (exitCode == 0) {
108+ readStream(process.stdout).then((x) => {
109+ resolve(x);
110+ });
111+ } else {
112+ readStream(process.stderr).then((x) => {
113+ reject(x)
114+ });
115+ }
116+ });
117+ })
118+ process.start()
119+
120+ const envStr = await promise
121+ .catch((err) => sendPermanentNotification("Generating environment failed", err))
122+ envCache = parseEnvs(envStr)
123+ } else {
124+ envCache = {}
125+ }
126+}
127+
128+async function getEnv() {
129+ console.log(JSON.stringify(envCache))
130+ if (!envCache) {
131+ await createEnv()
132+ }
133+ return envCache
134+}
135+
136+
137+function hasCustomEnv() {
138+ return (nova.workspace.config.get("env-generator") !== null)
139+}
140+
51−module.exports = { readStream, getStorage, getFileName, trace, traceRaw };
141+module.exports = { readStream, getStorage, getFileName, trace, traceRaw, call, createEnv, hasCustomEnv, getEnv };
142+
Haskell Language Server.novaextension/Syntaxes/Haskell.xml+217−254
@@ -1,9 +1,9 @@
1<?xml version="1.0" encoding="UTF-8"?>
1<?xml version="1.0" encoding="UTF-8"?>
2<syntax name="haskell">
2<syntax name="haskell">
3 <meta>
3 <meta>
4− <name>Haskell</name>
4+ <name>Haskell</name>
5− <type>compiled</type>
5+ <type>compiled</type>
6− <preferred-file-extension>hs</preferred-file-extension>
6+ <preferred-file-extension>hs</preferred-file-extension>
7 </meta>
7 </meta>
8
8
9 <detectors>
9 <detectors>
@@ -57,8 +57,6 @@
57 <include syntax="self" collection="type-family-definition" />
57 <include syntax="self" collection="type-family-definition" />
58 <include syntax="self" collection="pattern-definition" />
58 <include syntax="self" collection="pattern-definition" />
59 <include syntax="self" collection="type-definition" />
59 <include syntax="self" collection="type-definition" />
60− <!-- <include syntax="self" collection="type-annotation" /> -->
61− <include syntax="self" collection="data-definition" />
62 <include syntax="self" collection="GADT-definition" />
60 <include syntax="self" collection="GADT-definition" />
63 <include syntax="self" collection="instance" />
61 <include syntax="self" collection="instance" />
64 <include syntax="self" collection="typeclass" />
62 <include syntax="self" collection="typeclass" />
@@ -67,7 +65,6 @@
67
65
68 <template-scopes>
66 <template-scopes>
69 <include syntax="self" collection="Quote" />
67 <include syntax="self" collection="Quote" />
70− <include syntax="self" collection="comments" />
71 </template-scopes>
68 </template-scopes>
72
69
73 <collections>
70 <collections>
@@ -80,51 +77,27 @@
80 </collection>
77 </collection>
81
78
82 <collection name="expressions">
79 <collection name="expressions">
80+ <scope name="haskell.construct.keyword.at">
81+ <expression>@</expression>
82+ </scope>
83+ <scope name="haskell.construct.keyword.case-arrow">
84+ <expression>-&gt;</expression>
85+ </scope>
86+ <scope name="haskell.construct.keyword.bind-arrow">
87+ <expression>&lt;-</expression>
88+ </scope>
83− <include syntax="self" collection="do-bind" />
89+ <include syntax="self" collection="keywords" />
84 <include syntax="self" collection="literal" />
90 <include syntax="self" collection="literal" />
85 <include syntax="self" collection="operators" />
91 <include syntax="self" collection="operators" />
92+ <include syntax="self" collection="record-match" />
86 <include syntax="self" collection="list" />
93 <include syntax="self" collection="list" />
94+ <include syntax="self" collection="view-pattern" />
87 <include syntax="self" collection="lambda-case" />
95 <include syntax="self" collection="lambda-case" />
88 <include syntax="self" collection="lambda-head" />
96 <include syntax="self" collection="lambda-head" />
89− <include syntax="self" collection="type-applications" />
97+ <include syntax="self" collection="case-expression" />
90− <include syntax="self" collection="outer-case-expression" />
98+ <include syntax="self" collection="qconid" />
91 <include syntax="self" collection="qvarid" />
99 <include syntax="self" collection="qvarid" />
92 <include syntax="self" collection="tuple" />
100 <include syntax="self" collection="tuple" />
93−
94−
95− <!-- Needed for do binds -->
96− <!-- <include syntax="self" collection="pattern-match" /> -->
97− </collection>
98−
99− <collection name="pattern-match">
100− <include syntax="self" collection="literal" />
101− <include syntax="self" collection="tuple-match" />
102− <!-- <include syntax="self" collection="at-pattern" /> -->
103− <include syntax="self" collection="varid" />
104− <include syntax="self" collection="qconid" />
105− <include syntax="self" collection="record-match" />
106− <include syntax="self" collection="list-pattern" />
107− <include syntax="self" collection="view-pattern" />
108− </collection>
109−
110− <collection name="type-applications">
111− <scope name="type-applications">
112− <starts-with>
113− <expression>(\s@)\(</expression>
114− <capture number="1" name="haskell.keyword.operator.typeapplication" />
115− </starts-with>
116− <ends-with>
117− <expression>)</expression>
118− </ends-with>
119− <subscopes>
120− <include syntax="self" collection="type" />
121− </subscopes>
122− </scope>
123− <scope name="type-applications-single">
124− <expression>(@)(\w+)</expression>
125− <capture number="1" name="haskell.keyword.operator.typeapplication" />
126− <capture number="2" name="haskell.identifier.type" />
127− </scope>
128 </collection>
101 </collection>
129
102
130 <collection name="Quote">
103 <collection name="Quote">
@@ -163,8 +136,8 @@
163 <capture number="1" name="haskell.pattern.record.bracket" />
136 <capture number="1" name="haskell.pattern.record.bracket" />
164 </ends-with>
137 </ends-with>
165 <subscopes>
138 <subscopes>
166− <include syntax="self" collection="pattern-match" />
139+ <include syntax="self" collection="comments" />
167− <include syntax="self" collection="varid" />
140+ <include syntax="self" collection="expressions" />
168 <scope name="record-sep">
141 <scope name="record-sep">
169 <expression>=</expression>
142 <expression>=</expression>
170 </scope>
143 </scope>
@@ -186,6 +159,7 @@
186 <capture number="1" name="haskell.pattern.record.bracket" />
159 <capture number="1" name="haskell.pattern.record.bracket" />
187 </ends-with>
160 </ends-with>
188 <subscopes>
161 <subscopes>
162+ <include syntax="self" collection="comments" />
189 <scope name="haskell.pattern.record.wildcard">
163 <scope name="haskell.pattern.record.wildcard">
190 <expression>\.\.</expression>
164 <expression>\.\.</expression>
191 </scope>
165 </scope>
@@ -212,29 +186,12 @@
212 <capture number="1" name="haskell.list.bracket" />
186 <capture number="1" name="haskell.list.bracket" />
213 </ends-with>
187 </ends-with>
214 <subscopes>
188 <subscopes>
189+ <include syntax="self" collection="comments" />
215 <include syntax="self" collection="expressions" />
190 <include syntax="self" collection="expressions" />
216 </subscopes>
191 </subscopes>
217 </scope>
192 </scope>
218 </collection>
193 </collection>
219
194
220− <collection name="list-pattern">
221− <symbol type="expression" />
222− <scope name="haskell.pattern.list">
223− <starts-with>
224− <expression>(\[)</expression>
225− <capture number="1" name="haskell.pattern.list.bracket" />
226− </starts-with>
227− <ends-with>
228− <expression>(\])</expression>
229− <capture number="1" name="haskell.pattern.list.bracket" />
230− </ends-with>
231− <subscopes>
232− <include syntax="self" collection="pattern-match" />
233− </subscopes>
234− </scope>
235− </collection>
236−
237−
238 <collection name="view-pattern">
195 <collection name="view-pattern">
239 <scope name="haskell.pattern.view">
196 <scope name="haskell.pattern.view">
240 <symbol type="expression" />
197 <symbol type="expression" />
@@ -251,24 +208,7 @@
251 <scope name="haskell.pattern.view.operator.arrow">
208 <scope name="haskell.pattern.view.operator.arrow">
252 <expression>-&gt;</expression>
209 <expression>-&gt;</expression>
253 </scope>
210 </scope>
254− <include syntax="self" collection="pattern-match" />
211+ <include syntax="self" collection="expressions" />
255− </subscopes>
256− </scope>
257− </collection>
258−
259− <collection name="tuple-match">
260− <symbol type="expression" />
261− <scope name="haskell.pattern.tuple">
262− <starts-with>
263− <expression>(\()</expression>
264− <capture number="1" name="haskell.pattern.tuple.bracket" />
265− </starts-with>
266− <ends-with>
267− <expression>(\))</expression>
268− <capture number="1" name="haskell.pattern.tuple.bracket" />
269− </ends-with>
270− <subscopes>
271− <include syntax="self" collection="pattern-match" />
272 </subscopes>
212 </subscopes>
273 </scope>
213 </scope>
274 </collection>
214 </collection>
@@ -284,53 +224,11 @@
284 <capture number="1" name="haskell.case.keyword.condition" />
224 <capture number="1" name="haskell.case.keyword.condition" />
285 </ends-with>
225 </ends-with>
286 <subscopes anchored="true">
226 <subscopes anchored="true">
287− <include syntax="self" collection="pattern-match" />
288− </subscopes>
289− </scope>
290− </collection>
291−
292− <collection name="case-match">
293− <scope name="case-match">
294− <starts-with>
295− <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
296− </starts-with>
297− <ends-with>
298− <expression>-&gt;</expression>
299− </ends-with>
300− <subscopes anchored="true">
301− <include syntax="self" collection="pattern-match" />
302− </subscopes>
303− </scope>
304− </collection>
305−
306− <collection name="inner-case-expressions">
307− <scope name="inner-case-expressions">
308− <starts-with>
309− <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
310− </starts-with>
311− <ends-with>
312− <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
313− </ends-with>
314− <subscopes>
315− <include syntax="self" collection="case-match" />
316 <include syntax="self" collection="expressions" />
227 <include syntax="self" collection="expressions" />
317 </subscopes>
228 </subscopes>
318 </scope>
229 </scope>
319 </collection>
230 </collection>
320
231
321− <collection name="outer-case-expression">
322− <scope name="outer-case-expression">
323− <starts-with>
324− <expression>(?=case)</expression>
325− </starts-with>
326− <ends-with />
327− <subscopes anchored="true" skip-whitespace="false">
328− <include syntax="self" collection="case-expression" />
329− <include syntax="self" collection="inner-case-expressions" repeat="true" />
330− </subscopes>
331− </scope>
332− </collection>
333−
334 <collection name="tuple">
232 <collection name="tuple">
335 <symbol type="expression" />
233 <symbol type="expression" />
336 <scope name="haskell.tuple">
234 <scope name="haskell.tuple">
@@ -343,136 +241,144 @@
343 <capture number="1" name="haskell.tuple.bracket" />
241 <capture number="1" name="haskell.tuple.bracket" />
344 </ends-with>
242 </ends-with>
345 <subscopes>
243 <subscopes>
244+ <include syntax="self" collection="comments" />
346 <include syntax="self" collection="expressions" />
245 <include syntax="self" collection="expressions" />
347 </subscopes>
246 </subscopes>
348 </scope>
247 </scope>
349 </collection>
248 </collection>
350
249
351 <collection name="typeclass">
250 <collection name="typeclass">
352− <symbol type="interface" />
251+ <scope name="haskell.definition.class.head">
353− <scope name="haskell.definition.class">
252+ <symbol type="class" scope="global" name-selector="haskell.keyword.construct.class.name">
253+ <context behavior="whitespace" foldable="true" />
254+ </symbol>
354 <starts-with>
255 <starts-with>
355 <expression>^(\h*)(class)($|\h)</expression>
256 <expression>^(\h*)(class)($|\h)</expression>
356 <capture number="2" name="haskell.keyword.construct.class" />
257 <capture number="2" name="haskell.keyword.construct.class" />
357 </starts-with>
258 </starts-with>
358− <ends-with>
259+ <ends-with />
359− <template>^(?!\s+\1\S)(?!\s*$)</template>
260+ <subscopes anchored="true">
261+ <scope name="haskell.keyword.construct.class.name">
262+ <starts-with>
263+ <expression></expression>
264+ </starts-with>
265+ <ends-with>
266+ <expression>(?=(where|^\s*$))</expression>
360− </ends-with>
267+ </ends-with>
361− <subscopes>
268+ <subscopes>
269+ <include syntax="self" collection="comments" />
270+ <include syntax="self" collection="type" />
271+ </subscopes>
272+ </scope>
362− <scope name="haskell.keyword.construct.where">
273+ <scope name="haskell.keyword.construct.where" optional="true">
363 <expression>where</expression>
274 <expression>where</expression>
364 </scope>
275 </scope>
365− <include syntax="self" collection="type" />
366− <include syntax="self" collection="type-definition" />
367− <!-- <include syntax="self" collection="type-annotation" /> -->
368− <include syntax="self" collection="definition" />
369 </subscopes>
276 </subscopes>
370 </scope>
277 </scope>
371 </collection>
278 </collection>
372
279
373 <collection name="instance">
280 <collection name="instance">
374 <scope name="haskell.instance">
281 <scope name="haskell.instance">
375− <symbol type="category" />
282+ <symbol type="category" name-selector="haskell.keyword.construct.instance.name">
283+ <context behavior="whitespace" foldable="true" />
284+ </symbol>
376 <starts-with>
285 <starts-with>
377 <expression>^(\h*)(instance)($|\h)</expression>
286 <expression>^(\h*)(instance)($|\h)</expression>
378 <capture number="2" name="haskell.keyword.construct.instance" />
287 <capture number="2" name="haskell.keyword.construct.instance" />
379 </starts-with>
288 </starts-with>
380− <ends-with>
289+ <ends-with />
381− <template>^(?!\s+\1\S)(?!\s*$)</template>
290+ <subscopes anchored="true">
291+ <scope name="haskell.keyword.construct.instance.name">
292+ <starts-with>
293+ <expression></expression>
294+ </starts-with>
295+ <ends-with>
296+ <expression>(?=(where|^\s*$))</expression>
382− </ends-with>
297+ </ends-with>
383− <subscopes>
298+ <subscopes>
299+ <include syntax="self" collection="type" />
300+ </subscopes>
301+ </scope>
384− <scope name="haskell.keyword.construct.where">
302+ <scope name="haskell.keyword.construct.where" optional="true">
385 <expression>where</expression>
303 <expression>where</expression>
386 </scope>
304 </scope>
387− <include syntax="self" collection="type" />
388− <include syntax="self" collection="type-definition" />
389− <include syntax="self" collection="type-annotation" />
390− <include syntax="self" collection="definition" />
391 </subscopes>
305 </subscopes>
392 </scope>
306 </scope>
393 </collection>
307 </collection>
394
308
395 <collection name="type-family-definition">
309 <collection name="type-family-definition">
396− <scope name="haskell.definition.type.type-family">
310+ <scope name="haskell.definition.type-family.type">
397− <symbol type="type" />
398 <starts-with>
311 <starts-with>
399− <expression>^(\h*)(type\h+family)\h+`?(\w(\w|')*)`?($|\h)</expression>
312+ <expression>^(\h*)(type\h+family)</expression>
400 <capture number="2" name="haskell.keyword.construct.type-family" />
313 <capture number="2" name="haskell.keyword.construct.type-family" />
401 </starts-with>
314 </starts-with>
402 <ends-with>
315 <ends-with>
403 <template>^(?!\s+\1\S)(?!\s*$)</template>
316 <template>^(?!\s+\1\S)(?!\s*$)</template>
404 </ends-with>
317 </ends-with>
405− <subscopes>
318+ <subscopes anchored="true" skip-whitespace="false">
319+ <scope name="haskell.type-family.head">
320+ <starts-with>
321+ <expression></expression>
322+ </starts-with>
323+ <ends-with>
324+ <expression>where</expression>
406− <scope name="haskell.keyword.construct.where">
325+ <capture number="0" name="haskell.keyword.construct.where" />
326+ </ends-with>
327+ <subscopes anchored="true">
328+ <scope name="haskell.identifier.type-family.type.name">
407− <expression>where</expression>
329+ <expression>\S+</expression>
330+ </scope>
331+ <include syntax="self" collection="type" repeat="true" optional="true" />
332+ </subscopes>
408 </scope>
333 </scope>
409− <include syntax="self" collection="type" />
410− </subscopes>
411− </scope>
412− </collection>
413−
414− <collection name="definition">
415− <scope name="haskell.definition.type.function">
416− <symbol type="function">
417− <display-name>
418− <component selector="haskell.definition.type.function" />
419− </display-name>
420
334
421− </symbol>
422− <starts-with>
423− <expression>^(?=(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h))</expression>
424− <capture number="2" name="haskell.keyword.construct.default" />
425− <capture number="3" name="haskell.identifier.function" />
426− </starts-with>
427− <ends-with>
428− <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
429− </ends-with>
430− <subscopes>
431− <include syntax="self" collection="type-annotation" />
335+ <include syntax="self" collection="type-family-case-definition" optional="true" repeat="true" />
432− <include syntax="self" collection="implementation" />
433 </subscopes>
336 </subscopes>
434 </scope>
337 </scope>
435 </collection>
338 </collection>
436
339
437− <collection name="do-bind">
340+ <collection name="type-family-case-definition">
438− <scope name="do-bind">
341+ <scope name="haskell.definition.type-family.type.case">
439 <starts-with>
342 <starts-with>
440− <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
343+ <expression>^(\h*)(?=\S)</expression>
441 </starts-with>
344 </starts-with>
442 <ends-with>
345 <ends-with>
443− <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
346+ <template>^(?!\s+\1\S)(?!\s*$)</template>
444 </ends-with>
347 </ends-with>
445 <subscopes>
348 <subscopes>
446− <include syntax="self" collection="do-pattern" />
349+ <include syntax="self" collection="comments" />
447− <include syntax="self" collection="expressions" />
350+ <include syntax="self" collection="type" optional="true" repeat="true" />
448− <!-- <scope name="bind-arrow">
351+ <scope>
449− <expression>&lt;-</expression>
352+ <expression>=</expression>
450− </scope> -->
353+ </scope>
354+ <include syntax="self" collection="type" optional="true" repeat="true" />
451 </subscopes>
355 </subscopes>
452 </scope>
356 </scope>
453 </collection>
357 </collection>
454
358
455− <collection name="do-pattern">
359+ <collection name="definition">
456− <scope name="do-pattern">
360+ <scope name="haskell.definition.type.function">
361+ <symbol type="function">
362+ <context behavior="whitespace" foldable="true" />
363+ </symbol>
457 <starts-with>
364 <starts-with>
458− <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
365+ <expression>^(?=(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h))</expression>
366+ <capture number="2" name="haskell.keyword.construct.default" />
367+ <capture number="3" name="haskell.identifier.function.name" />
459 </starts-with>
368 </starts-with>
460 <ends-with>
369 <ends-with>
461− <expression>&lt;-</expression>
370+ <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
462 </ends-with>
371 </ends-with>
463 <subscopes>
372 <subscopes>
464− <include syntax="self" collection="pattern-match" />
373+ <include syntax="self" collection="comments" />
465− <!-- <scope name="bind-arrow">
374+ <include syntax="self" collection="type-annotation" />
466− <expression>&lt;-</expression>
467− </scope>
468− <include syntax="self" collection="expressions" repeat="true" /> -->
375+ <include syntax="self" collection="implementation" />
469 </subscopes>
376 </subscopes>
470 </scope>
377 </scope>
471 </collection>
378 </collection>
472
379
473 <collection name="implementation">
380 <collection name="implementation">
474− <scope name="haskell.definition.type.function">
381+ <scope name="haskell.definition.type.function.implementation">
475− <local scope="within-construct" />
476 <starts-with>
382 <starts-with>
477 <expression>^(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h)</expression>
383 <expression>^(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h)</expression>
478 <capture number="2" name="haskell.keyword.construct.default" />
384 <capture number="2" name="haskell.keyword.construct.default" />
@@ -482,14 +388,20 @@
482 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
388 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
483 </ends-with>
389 </ends-with>
484 <subscopes>
390 <subscopes>
485− <include syntax="self" collection="where-clause" />
391+ <include syntax="self" collection="comments" />
486− <include syntax="self" collection="expressions" />
392+ <include syntax="self" collection="pattern-match" optional="true" repeat="true" />
393+ <scope>
394+ <expression>=</expression>
395+ <capture number="0" name="haskell.construct.function.keyword.eq" />
396+ </scope>
397+ <include syntax="self" collection="expressions" optional="true" repeat="true" />
398+ <include syntax="self" collection="where-clause" optional="true" />
487 </subscopes>
399 </subscopes>
488 </scope>
400 </scope>
489 </collection>
401 </collection>
490
402
491 <collection name="type-annotation">
403 <collection name="type-annotation">
492− <scope name="haskell.definition.type.function">
404+ <scope name="haskell.definition.type.function.type-signature">
493 <starts-with>
405 <starts-with>
494 <expression>^(\h*)`?(\w(\w|')*)`?\h*::($|\h)</expression>
406 <expression>^(\h*)`?(\w(\w|')*)`?\h*::($|\h)</expression>
495 <capture number="2" name="haskell.identifier.function" />
407 <capture number="2" name="haskell.identifier.function" />
@@ -498,6 +410,7 @@
498 <template>^(?!\s+\1\S)(?!\s*$)</template>
410 <template>^(?!\s+\1\S)(?!\s*$)</template>
499 </ends-with>
411 </ends-with>
500 <subscopes>
412 <subscopes>
413+ <include syntax="self" collection="comments" />
501 <include syntax="self" collection="type" />
414 <include syntax="self" collection="type" />
502 </subscopes>
415 </subscopes>
503 </scope>
416 </scope>
@@ -505,15 +418,19 @@
505
418
506 <collection name="type-definition">
419 <collection name="type-definition">
507 <scope name="haskell.definition.type">
420 <scope name="haskell.definition.type">
421+ <symbol type="type" scope="global">
422+ <context behavior="whitespace" foldable="true" />
423+ </symbol>
508 <starts-with>
424 <starts-with>
509 <expression>^(\h*)(type)\h+(\w(\w|')*)</expression>
425 <expression>^(\h*)(type)\h+(\w(\w|')*)</expression>
510 <capture number="2" name="haskell.keyword.construct.type" />
426 <capture number="2" name="haskell.keyword.construct.type" />
511− <capture number="3" name="haskell.identifier.type" />
427+ <capture number="3" name="haskell.identifier.type.name" />
512 </starts-with>
428 </starts-with>
513 <ends-with>
429 <ends-with>
514 <template>^(?!\s+\1\S)(?!\s*$)</template>
430 <template>^(?!\s+\1\S)(?!\s*$)</template>
515 </ends-with>
431 </ends-with>
516 <subscopes>
432 <subscopes>
433+ <include syntax="self" collection="comments" />
517 <include syntax="self" collection="type" />
434 <include syntax="self" collection="type" />
518 </subscopes>
435 </subscopes>
519 </scope>
436 </scope>
@@ -521,66 +438,72 @@
521
438
522 <collection name="GADT-definition">
439 <collection name="GADT-definition">
523 <scope name="haskell.definition.struct.GADT">
440 <scope name="haskell.definition.struct.GADT">
441+ <symbol type="struct" scope="global">
442+ <context behavior="subtree" foldable="false" />
443+ </symbol>
524 <starts-with>
444 <starts-with>
525− <expression>^(\h*)(data)\h+(\w(\w|')*)</expression>
445+ <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
526 <capture number="2" name="haskell.keyword.construct.data.GADT" />
446 <capture number="2" name="haskell.keyword.construct.data.GADT" />
447+ <capture number="3" name="haskell.identifier.data.type.name" />
527 </starts-with>
448 </starts-with>
528 <ends-with>
449 <ends-with>
529 <template>^(?!\s+\1\S)(?!\s*$)</template>
450 <template>^(?!\s+\1\S)(?!\s*$)</template>
530 </ends-with>
451 </ends-with>
531 <subscopes>
452 <subscopes>
453+ <include syntax="self" collection="comments" />
454+ <scope name="haskell.keyword.construct.where">
455+ <expression>where</expression>
456+ </scope>
457+
458+ <include syntax="self" collection="deriving-clause" />
459+ <include syntax="self" collection="record-definition" />
532 <include syntax="self" collection="gadt-constructor" />
460 <include syntax="self" collection="gadt-constructor" />
533 <include syntax="self" collection="type" />
461 <include syntax="self" collection="type" />
534− <include syntax="self" collection="record-definition" />
535− <include syntax="self" collection="record-definition-field-name" />
536 </subscopes>
462 </subscopes>
537 </scope>
463 </scope>
538 </collection>
464 </collection>
539
465
540 <collection name="gadt-constructor">
466 <collection name="gadt-constructor">
541− <scope name="identifier.type.struct.GADT.constructor">
467+ <scope name="haskell.identifier.type.struct.data.constructor">
542− <expression>^\h+[A-Z](\w|')*</expression>
468+ <symbol type="constructor">
543− </scope>
469+ <context behavior="subtree" foldable="true" />
544− </collection>
470+ </symbol>
545−
546− <collection name="data-definition">
547− <scope name="haskell.definition.struct.data">
548 <starts-with>
471 <starts-with>
549− <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
472+ <expression>(^|=|\||^)\h+([A-Z](\w|')*)</expression>
550− <capture number="2" name="haskell.keyword.construct.data.newtype" />
473+ <capture number="2" name="haskell.identifier.data.name" />
551− <capture number="3" name="haskell.identifier.type" />
552 </starts-with>
474 </starts-with>
553− <ends-with>
475+ <ends-with />
554− <template>^(?!\s+\1\S)(?!\s*$)</template>
555− </ends-with>
556− <subscopes>
476+ <subscopes anchored="true">
557 <include syntax="self" collection="record-definition" />
477 <include syntax="self" collection="record-definition" />
558− <include syntax="self" collection="data-constructor" />
559− <include syntax="self" collection="type" />
560 </subscopes>
478 </subscopes>
561 </scope>
479 </scope>
562 </collection>
480 </collection>
563
481
564− <collection name="data-constructor">
482+ <collection name="deriving-clause">
565− <scope name="haskell.identifier.type.struct.data.constructor">
483+ <scope name="haskell.record.construct.deriving.keyword">
566− <expression>=\h+[A-Z](\w|')*</expression>
484+ <expression>deriving(\h+(newtype|stock|anyclass))?</expression>
567 </scope>
485 </scope>
568− <scope name="haskell.identifier.type.struct.data.constructor">
486+ <scope name="haskell.record.construct.deriving.keyword">
487+ <include syntax="self" collection="comments" />
569− <expression>\|\h+[A-Z](\w|')*</expression>
488+ <expression>via</expression>
570 </scope>
489 </scope>
571 </collection>
490 </collection>
572
491
573 <collection name="record-definition">
492 <collection name="record-definition">
574 <scope name="haskell.record">
493 <scope name="haskell.record">
494+ <symbol>
495+ <context behavior="subtree" foldable="true" />
496+ </symbol>
575 <starts-with>
497 <starts-with>
576− <expression>(\{)</expression>
498+ <expression>(?=\{)</expression>
577− <capture number="1" name="haskell.record.bracket" />
499+ <capture number="0" name="haskell.record.bracket" />
578 </starts-with>
500 </starts-with>
579 <ends-with>
501 <ends-with>
580 <expression>(\})</expression>
502 <expression>(\})</expression>
581 <capture number="1" name="haskell.record.bracket" />
503 <capture number="1" name="haskell.record.bracket" />
582 </ends-with>
504 </ends-with>
583 <subscopes>
505 <subscopes>
506+ <include syntax="self" collection="comments" />
584 <include syntax="self" collection="record-definition-field-name" />
507 <include syntax="self" collection="record-definition-field-name" />
585 <include syntax="self" collection="type" />
508 <include syntax="self" collection="type" />
586 </subscopes>
509 </subscopes>
@@ -589,26 +512,65 @@
589
512
590 <collection name="record-definition-field-name">
513 <collection name="record-definition-field-name">
591 <scope name="haskell.record.definition.property">
514 <scope name="haskell.record.definition.property">
515+ <symbol type="property" />
592− <expression>\w(\w|')*\h*::</expression>
516+ <expression>(((?![A-Z])\w(\w|')*)\h*::|(^|\{|,)\h*((?![A-Z])\w(\w|')*))</expression>
517+ <capture number="5" name="haskell.record.definition.property.field.property.name" />
518+ <capture number="2" name="haskell.record.definition.property.field.property.name" />
593 </scope>
519 </scope>
594 </collection>
520 </collection>
595
521
596 <collection name="type">
522 <collection name="type">
523+ <scope name="haskell.keyword.construct.function-arrow">
524+ <expression>-&gt;</expression>
525+ </scope>
526+ <scope name="haskell.keyword.construct.fat-arrow">
527+ <expression>=&gt;</expression>
528+ </scope>
529+ <include syntax="self" collection="strings" />
530+ <scope name="haskell.type.construct.tuple">
531+ <starts-with>
532+ <expression>\(</expression>
533+ </starts-with>
534+ <ends-with>
535+ <expression>\)</expression>
536+ </ends-with>
537+ <subscopes>
538+ <include syntax="self" collection="comments" />
539+ <scope name="haskell.construct.type.typle.comma">
540+ <expression>\,</expression>
541+ </scope>
542+ <include syntax="self" collection="type" />
543+ </subscopes>
544+ </scope>
545+ <scope name="haskell.type.list">
546+ <starts-with>
547+ <expression>'?\[</expression>
548+ </starts-with>
549+ <ends-with>
550+ <expression>\]</expression>
551+ </ends-with>
552+ <subscopes>
553+ <include syntax="self" collection="comments" />
554+ <include syntax="self" collection="type" />
555+ </subscopes>
556+ </scope>
557+ <scope name="haskell.type.star">
558+ <expression>\*</expression>
559+ </scope>
560+ <scope name="haskell.keyword.construct.type-annotation-operator">
561+ <expression>::</expression>
562+ </scope>
597 <include syntax="self" collection="type-list" />
563 <include syntax="self" collection="type-list" />
564+ <scope>
565+ <expression>(([A-Z](\w|')*\.)*)'*\!?([A-Z](\w|')*)</expression>
566+ <capture number="1" name="haskell.identifier.package.module" />
598− <scope name="haskell.identifier.type">
567+ <capture number="4" name="haskell.identifier.type" />
599− <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
600 </scope>
568 </scope>
601 <scope name="haskell.keyword.construct.forall">
569 <scope name="haskell.keyword.construct.forall">
602 <expression>forall</expression>
570 <expression>forall</expression>
603 </scope>
571 </scope>
604 <scope name="haskell.identifier.type.variable">
572 <scope name="haskell.identifier.type.variable">
605− <expression>\w(\w|')*</expression>
573+ <expression>(?!where)(?!=)((?!(\(|\)|\,|\!))\S)((?!(\(|\)|\,))\w)*</expression>
606− </scope>
607− <scope name="haskell.keyword.construct.function-arrow">
608− <expression>-&gt;</expression>
609− </scope>
610− <scope name="haskell.keyword.construct.fat-arrow">
611− <expression>=&gt;</expression>
612 </scope>
574 </scope>
613 </collection>
575 </collection>
614
576
@@ -623,6 +585,7 @@
623 <template>^(?!\s+\1\S)(?!\s*$)</template>
585 <template>^(?!\s+\1\S)(?!\s*$)</template>
624 </ends-with>
586 </ends-with>
625 <subscopes>
587 <subscopes>
588+ <include syntax="self" collection="comments" />
626 <scope name="haskell.keyword.construct.where">
589 <scope name="haskell.keyword.construct.where">
627 <expression>where</expression>
590 <expression>where</expression>
628 </scope>
591 </scope>
@@ -642,6 +605,7 @@
642 <capture number="1" name="haskell.type-list.bracket" />
605 <capture number="1" name="haskell.type-list.bracket" />
643 </ends-with>
606 </ends-with>
644 <subscopes>
607 <subscopes>
608+ <include syntax="self" collection="comments" />
645 <include syntax="self" collection="type" />
609 <include syntax="self" collection="type" />
646 </subscopes>
610 </subscopes>
647 </scope>
611 </scope>
@@ -658,6 +622,7 @@
658 <capture number="1" name="haskell.keyword.construct.lambda" />
622 <capture number="1" name="haskell.keyword.construct.lambda" />
659 </ends-with>
623 </ends-with>
660 <subscopes>
624 <subscopes>
625+ <include syntax="self" collection="comments" />
661 <include syntax="self" collection="pattern-match" />
626 <include syntax="self" collection="pattern-match" />
662 </subscopes>
627 </subscopes>
663 </scope>
628 </scope>
@@ -671,7 +636,6 @@
671
636
672 <collection name="where-clause">
637 <collection name="where-clause">
673 <scope name="haskell.construct.where">
638 <scope name="haskell.construct.where">
674− <local scope="within-parent" />
675 <starts-with>
639 <starts-with>
676 <expression>^(\h*)(where)</expression>
640 <expression>^(\h*)(where)</expression>
677 <capture number="2" name="haskell.construct.keyword.where" />
641 <capture number="2" name="haskell.construct.keyword.where" />
@@ -680,6 +644,7 @@
680 <template>^(?!\1\s*\S)(?!s*$)</template>
644 <template>^(?!\1\s*\S)(?!s*$)</template>
681 </ends-with>
645 </ends-with>
682 <subscopes>
646 <subscopes>
647+ <include syntax="self" collection="comments" />
683 <include syntax="self" collection="definition" />
648 <include syntax="self" collection="definition" />
684 </subscopes>
649 </subscopes>
685 </scope>
650 </scope>
@@ -688,7 +653,9 @@
688
653
689 <collection name="qvarid">
654 <collection name="qvarid">
690 <scope name="haskell.identifier.function">
655 <scope name="haskell.identifier.function">
691− <expression>([A-Z](\w|')*\.)*\w(\w|')*</expression>
656+ <expression>(([A-Z](\w|')*\.)*)(\w(\w|')*)</expression>
657+ <capture number="1" name="haskell.identifier.package.module" />
658+ <capture number="4" name="haskell.identifier.type" />
692 </scope>
659 </scope>
693 </collection>
660 </collection>
694
661
@@ -717,12 +684,12 @@
717
684
718
685
719 <collection name="strings">
686 <collection name="strings">
720− <scope name="haskell.string.double-quoted">
687+ <scope name="haskell.string.double-quoted" spell-check="true">
721 <starts-with>
688 <starts-with>
722− <expression>"</expression>
689+ <expression>&quot;</expression>
723 </starts-with>
690 </starts-with>
724 <ends-with>
691 <ends-with>
725− <expression>"</expression>
692+ <expression>&quot;</expression>
726 </ends-with>
693 </ends-with>
727 <subscopes>
694 <subscopes>
728 <scope name="haskell.string.escape-sequences">
695 <scope name="haskell.string.escape-sequences">
@@ -759,6 +726,7 @@
759 </ends-with>
726 </ends-with>
760 <subscopes>
727 <subscopes>
761 <scope name="identifier.haskell.type">
728 <scope name="identifier.haskell.type">
729+ <symbol type="expression" />
762 <symbol type="expression" />
730 <symbol type="expression" />
763 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
731 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
764 <capture number="1" name="identifier.type" />
732 <capture number="1" name="identifier.type" />
@@ -783,6 +751,7 @@
783 </ends-with>
751 </ends-with>
784 <subscopes>
752 <subscopes>
785 <scope name="haskell.construct.qualified">
753 <scope name="haskell.construct.qualified">
754+ <symbol type="expression" />
786 <expression>qualified</expression>
755 <expression>qualified</expression>
787 <capture number="0" name="haskell.construct.keyword.qualified" />
756 <capture number="0" name="haskell.construct.keyword.qualified" />
788 </scope>
757 </scope>
@@ -800,6 +769,7 @@
800 </ends-with>
769 </ends-with>
801 <subscopes anchored="true">
770 <subscopes anchored="true">
802 <include syntax="self" collection="import-list" />
771 <include syntax="self" collection="import-list" />
772+ <symbol type="expression" />
803 </subscopes>
773 </subscopes>
804 </scope>
774 </scope>
805
775
@@ -833,6 +803,7 @@
833 </ends-with>
803 </ends-with>
834 <subscopes>
804 <subscopes>
835 <scope name="haskell.identifier.struct">
805 <scope name="haskell.identifier.struct">
806+ <symbol type="expression" />
836 <symbol type="reference" scope="local" />
807 <symbol type="reference" scope="local" />
837 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
808 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
838 <capture number="1" name="haskell.import-list.identifier.type.name" />
809 <capture number="1" name="haskell.import-list.identifier.type.name" />
@@ -846,13 +817,6 @@
846 </scope>
817 </scope>
847 </collection>
818 </collection>
848
819
849− <!-- <collection name="special">
850− <scope>
851− <expression>(;|,)</expression>
852− </scope>
853− </collection> -->
854−
855−
856 <collection name="reservedop">
820 <collection name="reservedop">
857 <scope name="keyword.operator">
821 <scope name="keyword.operator">
858 <expression>(\.\.|:|::|=|\\|\||&lt;-|-&gt;|@|~|=>)</expression>
822 <expression>(\.\.|:|::|=|\\|\||&lt;-|-&gt;|@|~|=>)</expression>
@@ -860,10 +824,11 @@
860 </collection>
824 </collection>
861
825
862 <collection name="keywords">
826 <collection name="keywords">
863− <scope name="haskell.keyword.modifier">
827+ <scope name="haskell.keyword.self">
864 <symbol type="keyword" />
828 <symbol type="keyword" />
865 <strings>
829 <strings>
866 <string>do</string>
830 <string>do</string>
831+ <string>mdo</string>
867 <string>in</string>
832 <string>in</string>
868 <string>infix</string>
833 <string>infix</string>
869 <string>infixl</string>
834 <string>infixl</string>
@@ -901,20 +866,18 @@
901 <strings>
866 <strings>
902 <string>undefined</string>
867 <string>undefined</string>
903 <string>_</string>
868 <string>_</string>
869+ <string>@</string>
904 </strings>
870 </strings>
905 </scope>
871 </scope>
906 </collection>
872 </collection>
907
873
908 <collection name="comments">
874 <collection name="comments">
909 <scope name="haskell.comment.single" spell-check="true">
875 <scope name="haskell.comment.single" spell-check="true">
910− <starts-with>
876+ <symbol type="comment" />
911− <expression>--</expression>
912− </starts-with>
913− <ends-with>
914− <expression>$</expression>
877+ <expression> --.*$</expression>
915− </ends-with>
916 </scope>
878 </scope>
917 <scope name="haskell.comment.block" spell-check="true">
879 <scope name="haskell.comment.block" spell-check="true">
880+ <symbol type="comment" />
918 <starts-with>
881 <starts-with>
919 <expression>{-</expression>
882 <expression>{-</expression>
920 </starts-with>
883 </starts-with>
@@ -926,4 +889,4 @@
926
889
927
890
928 </collections>
891 </collections>
929−</syntax>
892+</syntax>
Haskell Language Server.novaextension/extension.json+200−159
@@ -6,292 +6,333 @@
6 "version": "1.0",
6 "version": "1.0",
7 "categories": ["languages", "formatters"],
7 "categories": ["languages", "formatters"],
8 "main": "main.js",
8 "main": "main.js",
9− "entitlements": {
9+ "entitlements":
10+ {
10 "process": true,
11 "process": true,
11 "filesystem": "readwrite",
12 "filesystem": "readwrite",
12 "requests": true
13 "requests": true
13 },
14 },
14− "configWorkspace": [{
15+ "configWorkspace": [
16+ {
15 "key": "haskell-language-server-path",
17 "key": "haskell-language-server-path",
16 "title": "Haskell Language Server path",
18 "title": "Haskell Language Server path",
17 "description": "If you want to use a custom HLS build for this project, then specify the path to it here.",
19 "description": "If you want to use a custom HLS build for this project, then specify the path to it here.",
18 "type": "path",
20 "type": "path",
19 "placeholder": "/usr/local/bin/example"
21 "placeholder": "/usr/local/bin/example"
20− }, {
22+ },
23+ {
24+ "key": "env-generator",
25+ "title": "Environment generator",
26+ "description": "You can specify a shell command which will be used to generate the environment, in which the extension will be executes. This is useful if you want to utilize `nix-shell`, `direnv` or any similar command.\n\nExpects the command to have the same stdout as the `env` command.",
27+ "type": "enum",
28+ "allowsCustom": true,
29+ "values": ["nix-shell --run env", "direnv exec env"]
30+ },
31+ {
21 "type": "section",
32 "type": "section",
22 "title": "Haskell Language Server settings",
33 "title": "Haskell Language Server settings",
34+ "description":"Some of the features are not supported in Nova. Some of them are explicitly marked as not supported, but it is not exhaustive.",
23− "children": [{
35+ "children": [
36+ {
24− "key": "haskell.formattingProvider",
37+ "key": "haskell.formattingProvider",
25− "title": "Code formatter",
38+ "title": "Code formatter",
26− "type": "enum",
39+ "type": "enum",
27− "values": [
40+ "values": [
28− "brittany",
41+ "brittany",
29− "floskell",
42+ "floskell",
30− "fourmolu",
43+ "fourmolu",
31− "ormolu",
44+ "ormolu",
32− "stylish-haskell",
45+ "stylish-haskell",
33− "none"
46+ "none"
34− ],
47+ ],
35− "default": "ormolu",
48+ "default": "ormolu",
36− "description": "The formatter to use when formatting a document or range. Ensure the plugin is enabled."
49+ "description": "The formatter to use when formatting a document or range. Ensure the plugin is enabled."
37− }, {
50+ },
51+ {
38− "key": "haskell.checkProject",
52+ "key": "haskell.checkProject",
39− "title": "Check whole project",
53+ "title": "Check whole project",
40− "type": "boolean",
54+ "type": "boolean",
41− "default": false,
55+ "default": false,
42− "description": "Whether to typecheck the entire project on load. It could drive to bad perfomance in large projects."
56+ "description": "Whether to typecheck the entire project on load. It could lead to bad perfomance in large projects."
43− }, {
57+ },
44− "key": "haskell.maxCompletions",
45− "type": "number",
46− "title": "Maximum number of completions",
47− "description": "Maximum number of completions sent to the editor.",
48− "default": 40
49− }, {
58+ {
50− "type": "section",
59+ "title": "Completions",
51− "title": "Plugin settings",
52− "children": [{
53 "type": "section",
60 "type": "section",
54− "title": "Import lens",
55− "description": "Not currently implemented in Nova",
56− "children": [{
61+ "children": [
57− "key": "haskell.plugin.importLens.codeActionsOn",
62+ {
58− "title": "Enable code actions",
63+ "key": "haskell.plugin.ghcide-completions.config.autoExtendOn",
59− "type": "boolean",
64+ "title": "Extend with out-of-scope identifiers",
65+ "description": "Extends the import list automatically when completing a out-of-scope identifier",
60 "default": true,
66 "default": true,
61− "description": "Enables explicit imports code actions"
67+ "type": "boolean"
62− }, {
68+ },
63− "key": "haskell.plugin.importLens.codeLensOn",
69+ {
64− "title": "Enable code lens",
70+ "key": "haskell.plugin.ghcide-completions.config.snippetsOn",
65− "type": "boolean",
71+ "title": "Insert snippets",
72+ "description": "Inserts snippets when using code completions",
66 "default": true,
73 "default": true,
67− "description": "Enables explicit imports code lenses"
74+ "type": "boolean"
75+ },
76+ {
77+ "key": "haskell.maxCompletions",
78+ "type": "number",
79+ "title": "Maximum number of completions",
80+ "description": "Maximum number of completions sent to the editor.",
81+ "default": 40
68 }]
82 }]
69− }, {
83+ },
84+ {
70 "title": "HLint",
85 "title": "HLint",
71 "type": "section",
86 "type": "section",
72− "children": [{
87+ "children": [
88+ {
73 "key": "haskell.plugin.hlint.codeActionsOn",
89 "key": "haskell.plugin.hlint.codeActionsOn",
74 "title": "Enable code actions",
90 "title": "Enable code actions",
75 "type": "boolean",
91 "type": "boolean",
76 "default": true,
92 "default": true,
77 "description": "Enables hlint code actions (apply hints)"
93 "description": "Enables hlint code actions (apply hints)"
78− }, {
94+ },
95+ {
79 "key": "haskell.plugin.hlint.diagnosticsOn",
96 "key": "haskell.plugin.hlint.diagnosticsOn",
80 "title": "Enable diagnostics",
97 "title": "Enable diagnostics",
81 "type": "boolean",
98 "type": "boolean",
82 "default": true,
99 "default": true,
83 "description": "Enables hlint diagnostics"
100 "description": "Enables hlint diagnostics"
84− }, {
101+ },
85− "title": "Configuration",
102+ {
86− "type": "section",
87− "children": [{
88− "key": "haskell.plugin.hlint.config.flags",
103+ "key": "haskell.plugin.hlint.config.flags",
89− "title": "Flags",
104+ "title": "Flags",
90− "description": "Flags used by hlint",
105+ "description": "Flags used by hlint",
91− "default": [],
106+ "default": [],
92− "type": "stringArray"
107+ "type": "stringArray"
108+ }]
109+ },
110+ {
111+ "type": "section",
112+ "title": "Import lens",
113+ "description": "Not currently implemented in Nova",
114+ "children": [
115+ {
116+ "key": "haskell.plugin.importLens.codeActionsOn",
117+ "title": "Enable code actions",
118+ "type": "boolean",
119+ "default": true,
120+ "description": "Enables explicit imports code actions"
93− }]
121+ },
122+ {
123+ "key": "haskell.plugin.importLens.codeLensOn",
124+ "title": "Enable code lens",
125+ "type": "boolean",
126+ "default": true,
127+ "description": "Enables explicit imports code lenses"
94 }]
128 }]
95− }, {
129+ },
130+
131+ {
96 "title": "Eval",
132 "title": "Eval",
97 "type": "section",
133 "type": "section",
98− "children": [{
134+ "children": [
135+ {
99 "key": "haskell.plugin.eval.globalOn",
136 "key": "haskell.plugin.eval.globalOn",
100 "title": "Enable",
137 "title": "Enable",
101 "type": "boolean",
138 "type": "boolean",
102 "default": true,
139 "default": true,
103 "description": "Enables eval plugin"
140 "description": "Enables eval plugin"
104 }]
141 }]
105− }, {
142+ },
143+ {
106 "title": "Module name",
144 "title": "Module name",
107 "type": "section",
145 "type": "section",
108− "children": [{
146+ "children": [
147+ {
109 "key": "haskell.plugin.moduleName.globalOn",
148 "key": "haskell.plugin.moduleName.globalOn",
110 "title": "Enable",
149 "title": "Enable",
111 "type": "boolean",
150 "type": "boolean",
112 "default": true,
151 "default": true,
113 "description": "Enables module name plugin"
152 "description": "Enables module name plugin"
114 }]
153 }]
115− }, {
154+ },
155+ {
116 "title": "Splice",
156 "title": "Splice",
117 "type": "section",
157 "type": "section",
118− "children": [{
158+ "children": [
159+ {
119 "key": "haskell.plugin.splice.globalOn",
160 "key": "haskell.plugin.splice.globalOn",
120 "title": "Enable",
161 "title": "Enable",
121 "type": "boolean",
162 "type": "boolean",
122 "default": true,
163 "default": true,
123 "description": "Enables splice plugin (expand template haskell definitions)"
164 "description": "Enables splice plugin (expand template haskell definitions)"
124 }]
165 }]
125− }, {
166+ },
167+ {
126 "title": "Haddock comments",
168 "title": "Haddock comments",
127 "type": "section",
169 "type": "section",
128− "children": [{
170+ "children": [
171+ {
129 "key": "haskell.plugin.haddockComments.globalOn",
172 "key": "haskell.plugin.haddockComments.globalOn",
130 "title": "Enable",
173 "title": "Enable",
131 "type": "boolean",
174 "type": "boolean",
132 "default": true,
175 "default": true,
133 "description": "Enables haddock comments plugin"
176 "description": "Enables haddock comments plugin"
134 }]
177 }]
135− }, {
178+ },
179+ {
136 "title": "Class",
180 "title": "Class",
137 "type": "section",
181 "type": "section",
138− "children": [{
182+ "children": [
183+ {
139 "key": "haskell.plugin.class.globalOn",
184 "key": "haskell.plugin.class.globalOn",
140 "title": "Enable",
185 "title": "Enable",
141 "type": "boolean",
186 "type": "boolean",
142 "default": true,
187 "default": true,
143 "description": "Enables type class plugin"
188 "description": "Enables type class plugin"
144 }]
189 }]
145− }, {
190+ },
191+ {
146 "title": "Retrie",
192 "title": "Retrie",
147 "type": "section",
193 "type": "section",
148− "children": [{
194+ "children": [
195+ {
149 "key": "haskell.plugin.retrie.globalOn",
196 "key": "haskell.plugin.retrie.globalOn",
150 "title": "Enable",
197 "title": "Enable",
151 "type": "boolean",
198 "type": "boolean",
152 "default": true,
199 "default": true,
153 "description": "Enables retrie plugin"
200 "description": "Enables retrie plugin"
154 }]
201 }]
155− }, {
202+ },
203+ {
156 "title": "Wingman",
204 "title": "Wingman",
157 "type": "section",
205 "type": "section",
158− "children": [{
206+ "children": [
207+ {
159 "key": "haskell.plugin.tactics.globalOn",
208 "key": "haskell.plugin.tactics.globalOn",
160 "title": "Enable",
209 "title": "Enable",
161 "type": "boolean",
210 "type": "boolean",
162 "default": true,
211 "default": true,
163 "description": "Enables Wingman (tactics) plugin"
212 "description": "Enables Wingman (tactics) plugin"
164− }, {
213+ },
165− "title": "Configuration",
214+ {
166− "type": "section",
167− "children": [{
168− "key": "haskell.plugin.tactics.config.auto_gas",
215+ "key": "haskell.plugin.tactics.config.auto_gas",
169− "title": "Gas",
216+ "title": "Gas",
170− "description": "The depth of the search tree when performing \"Attempt to fill hole\". Bigger values will be able to derive more solutions, but will take exponentially more time.",
217+ "description": "The depth of the search tree when performing \"Attempt to fill hole\". Bigger values will be able to derive more solutions, but will take exponentially more time.",
171− "default": 4,
218+ "default": 4,
172− "type": "number"
219+ "type": "number"
173− }, {
220+ },
221+ {
174− "key": "haskell.plugin.tactics.config.hole_severity",
222+ "key": "haskell.plugin.tactics.config.hole_severity",
175− "title": "Hole severity",
223+ "title": "Hole severity",
176− "description": "The severity to use when showing hole diagnostics.",
224+ "description": "The severity to use when showing hole diagnostics.",
177− "values": [
225+ "values": [
178− 1,
226+ 1,
179− 2,
227+ 2,
180− 3,
228+ 3,
181− 4,
229+ 4,
182− null
230+ null
183− ],
231+ ],
184− "default": null,
232+ "default": null,
185− "type": "enum"
233+ "type": "enum"
186− }, {
234+ },
235+ {
187− "key": "haskell.plugin.tactics.config.max_use_ctor_actions",
236+ "key": "haskell.plugin.tactics.config.max_use_ctor_actions",
188− "title": "Max number of constructors",
237+ "title": "Max number of constructors",
189− "type": "number",
238+ "type": "number",
190− "default": 5,
239+ "default": 5,
191− "description": "Maximum number of `Use constructor <x>` code actions that can appear"
240+ "description": "Maximum number of `Use constructor <x>` code actions that can appear"
192− }, {
241+ },
242+ {
193− "key": "haskell.plugin.tactics.config.timeout_duration",
243+ "key": "haskell.plugin.tactics.config.timeout_duration",
194− "title": "Timeout",
244+ "title": "Timeout",
195− "description": "The timeout for Wingman actions, in seconds",
245+ "description": "The timeout for Wingman actions, in seconds",
196− "default": 2,
246+ "default": 2,
197− "type": "number"
247+ "type": "number"
198− }, {
248+ },
249+ {
199− "key": "haskell.plugin.tactics.config.proofstate_styling",
250+ "key": "haskell.plugin.tactics.config.proofstate_styling",
200− "title": "Proof states",
251+ "title": "Proof states",
201− "description": "Should Wingman emit styling markup when showing metaprogram proof states?",
252+ "description": "Should Wingman emit styling markup when showing metaprogram proof states?",
202− "default": true,
253+ "default": true,
203− "type": "boolean"
254+ "type": "boolean"
204− }]
205 }]
255 }]
206− }, {
256+ },
257+ {
207 "title": "Pragmas",
258 "title": "Pragmas",
208 "type": "section",
259 "type": "section",
209− "children": [{
260+ "children": [
261+ {
210 "key": "haskell.plugin.pragmas.codeActionsOn",
262 "key": "haskell.plugin.pragmas.codeActionsOn",
211 "title": "Enable code actions",
263 "title": "Enable code actions",
212 "type": "boolean",
264 "type": "boolean",
213 "default": true,
265 "default": true,
214 "description": "Enables pragmas code actions"
266 "description": "Enables pragmas code actions"
215− }, {
267+ },
268+ {
216 "key": "haskell.plugin.pragmas.completionOn",
269 "key": "haskell.plugin.pragmas.completionOn",
217 "title": "Enable completions",
270 "title": "Enable completions",
218 "type": "boolean",
271 "type": "boolean",
219 "default": true,
272 "default": true,
220 "description": "Enables pragmas completions"
273 "description": "Enables pragmas completions"
221 }]
274 }]
222− }, {
275+ },
223− "title": "Completions",
276+ {
224− "type": "section",
277+ "title": "Type lenses",
225− "children": [{
226− "title": "Configuration",
227− "type": "section",
228− "children": [{
229− "key": "haskell.plugin.ghcide-completions.config.autoExtendOn",
230− "title": "Extend with out-of-scope identifiers",
231− "description": "Extends the import list automatically when completing a out-of-scope identifier",
232− "default": true,
233− "type": "boolean"
234− }, {
235− "key": "haskell.plugin.ghcide-completions.config.snippetsOn",
236− "title": "Insert snippets",
237− "description": "Inserts snippets when using code completions",
238− "default": true,
239− "type": "boolean"
240− }]
241− }]
242− }, {
243 "description": "Not currently implemented in Nova",
278 "description": "Not currently implemented in Nova",
244 "type": "section",
279 "type": "section",
245− "children": [{
280+ "children": [
281+ {
246 "key": "haskell.plugin.ghcide-type-lenses.globalOn",
282 "key": "haskell.plugin.ghcide-type-lenses.globalOn",
247 "title": "Enable",
283 "title": "Enable",
248 "type": "boolean",
284 "type": "boolean",
249 "default": true,
285 "default": true,
250 "description": "Enables type lenses plugin"
286 "description": "Enables type lenses plugin"
251− }, {
287+ },
252− "title": "Configuration",
288+ {
253− "type": "section",
254− "children": [{
255− "key": "haskell.plugin.ghcide-type-lenses.config.mode",
289+ "key": "haskell.plugin.ghcide-type-lenses.config.mode",
256− "title": "Mode",
290+ "title": "Mode",
257− "type": "enum",
291+ "type": "enum",
258− "default": true,
292+ "default": true,
259− "description": "Control how type lenses are shown",
293+ "description": "Control how type lenses are shown",
260− "values": ["always", "exported", "diagnostics"]
294+ "values": ["always", "exported", "diagnostics"]
261− }]
262 }]
295 }]
263− }, {
296+ },
297+ {
264 "title": "Refine imports",
298 "title": "Refine imports",
265 "type": "section",
299 "type": "section",
266− "children": [{
300+ "children": [
301+ {
267 "key": "haskell.plugin.refineImports.globalOn",
302 "key": "haskell.plugin.refineImports.globalOn",
268 "title": "Enable",
303 "title": "Enable",
269 "type": "boolean",
304 "type": "boolean",
270 "default": true,
305 "default": true,
271 "description": "Enables refine imports plugin"
306 "description": "Enables refine imports plugin"
272 }]
307 }]
273− }]
308+ }
274− }]
309+ ]
275 }],
310 }],
276 "activationEvents": ["onLanguage:haskell", "onLanguage:hs"],
311 "activationEvents": ["onLanguage:haskell", "onLanguage:hs"],
277− "commands": {
312+ "commands":
313+ {
278− "editor": [{
314+ "editor": [
315+ {
279 "title": "Format file with Haskell Language Server",
316 "title": "Format file with Haskell Language Server",
280 "command": "format",
317 "command": "format",
281 "when": "editorSyntax == 'haskell' && editorHasFocus",
318 "when": "editorSyntax == 'haskell' && editorHasFocus",
282− "filters": {
319+ "filters":
320+ {
283 "syntaxes": ["haskell"]
321 "syntaxes": ["haskell"]
284 }
322 }
285 }],
323 }],
286− "extensions": [{
324+ "extensions": [
325+ {
287 "title": "Stop",
326 "title": "Stop",
288 "paletteTitle": "Stop Haskell Language Server",
327 "paletteTitle": "Stop Haskell Language Server",
289 "command": "stop"
328 "command": "stop"
290− }, {
329+ },
330+ {
291 "title": "Restart",
331 "title": "Restart",
292 "paletteTitle": "Restart Haskell Language Server",
332 "paletteTitle": "Restart Haskell Language Server",
293 "command": "restart"
333 "command": "restart"
294− }, {
334+ },
335+ {
295 "title": "Clear cached versions",
336 "title": "Clear cached versions",
296 "paletteTitle": "Clear cached versions of Haskell Language Server",
337 "paletteTitle": "Clear cached versions of Haskell Language Server",
297 "command": "clear-cache"
338 "command": "clear-cache"