on 979cc86 help sign in
5 files changed+437−621
since splitsnapshots
unifiedsplit
Haskell Language Server.novaextension/Scripts/download.js+1−42 Haskell Language Server.novaextension/Scripts/main.js+6−5 Haskell Language Server.novaextension/Scripts/utils.js+1−92 Haskell Language Server.novaextension/Syntaxes/Haskell.xml+270−282 Haskell Language Server.novaextension/extension.json+159−200
Haskell Language Server.novaextension/Scripts/download.js+1−42
@@ -5,8 +5,6 @@ const {
55const {
66 readStream,
77 getStorage,
8− call,
9− hasCustomEnv
108} = require("utils");
119
1210exports.getHLS = getHLS;
@@ -45,9 +43,6 @@ async function downloadTool(name) {
4543 const storagePath = getStorageForTool(name);
4644 console.log("Downloading " + storagePath);
4745 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− }
5146 const response = await fetch(urls[name]);
5247 if (!response.ok) {
5348 console.error(response.statusText);
@@ -133,7 +128,7 @@ async function getGHCVersion() {
133128 sendPermanentNotification(
134129 tool + " not installed!",
135130 "Please install " + tool +
136− " and restart Haskell Language Server.",
131+ " and restart Haskell Language Server.",
137132 );
138133 } else {
139134 sendPermanentNotification("Couldn't detect GHC version", x);
@@ -146,28 +141,7 @@ async function getGHCVersion() {
146141 return promise;
147142}
148143async 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−
160144 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− }
171145 return await getTool(version);
172146}
173147
@@ -182,18 +156,3 @@ function getToolName(name) {
182156function notifyToolDownloading(name) {
183157 sendNotification("Downloading tool", "Downloading " + getToolName(name));
184158}
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−5
@@ -9,9 +9,8 @@ const {
99 getHLSConfig,
1010} = require("configuration");
1111const {
12− getFileName, createEnv, getEnv
12+ getFileName,
1313} = require("utils");
14−
1514exports.activate = function () {
1615 nova.commands.register("stop", (_workspace) => {
1716 stopServer();
@@ -108,12 +107,10 @@ function applyAllLSPEdits(edits, text) {
108107}
109108let lspClient = null;
110109async function startServer() {
111− await createEnv()
112110 stopServer();
113111 const path = await getServerPath();
114− const env = await getEnv()
115112 const serverOptions = {
116− path, env,
113+ path: path,
117114 args: ["lsp", "--cwd", nova.workspace.path],
118115 };
119116 const clientOptions = {
@@ -140,3 +137,7 @@ function stopServer() {
140137function getServerPath() {
141138 return getHLS();
142139}
140+
141+// function getLogPath() {
142+// return getStorage() + "/haskell-language-server.log";
143+// }
Haskell Language Server.novaextension/Scripts/utils.js+1−92
@@ -1,8 +1,3 @@
1−const {
2− sendNotification,
3− sendPermanentNotification,
4−} = require("notifications");
5−
61function readStream(readableStream) {
72 return new Promise((resolve, _reject) => {
83 const reader = readableStream.getReader();
@@ -53,90 +48,4 @@ function traceRaw(x) {
5348 return x;
5449}
5550
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−
141−module.exports = { readStream, getStorage, getFileName, trace, traceRaw, call, createEnv, hasCustomEnv, getEnv };
142−
51+module.exports = { readStream, getStorage, getFileName, trace, traceRaw };
Haskell Language Server.novaextension/Syntaxes/Haskell.xml+270−282
@@ -41,7 +41,7 @@
4141 <indentation>
4242 <increase>
4343 <expression>
44− (case|class|do|let|where|=).*
44+ (case|class|do|let|where).*
4545 </expression>
4646 </increase>
4747 <decrease>
@@ -57,6 +57,8 @@
5757 <include syntax="self" collection="type-family-definition" />
5858 <include syntax="self" collection="pattern-definition" />
5959 <include syntax="self" collection="type-definition" />
60+ <!-- <include syntax="self" collection="type-annotation" /> -->
61+ <include syntax="self" collection="data-definition" />
6062 <include syntax="self" collection="GADT-definition" />
6163 <include syntax="self" collection="instance" />
6264 <include syntax="self" collection="typeclass" />
@@ -65,6 +67,7 @@
6567
6668 <template-scopes>
6769 <include syntax="self" collection="Quote" />
70+ <include syntax="self" collection="comments" />
6871 </template-scopes>
6972
7073 <collections>
@@ -77,27 +80,52 @@
7780 </collection>
7881
7982 <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>
89− <include syntax="self" collection="keywords" />
83+ <include syntax="self" collection="do-bind" />
9084 <include syntax="self" collection="literal" />
9185 <include syntax="self" collection="operators" />
92− <include syntax="self" collection="record-match" />
9386 <include syntax="self" collection="list" />
94− <include syntax="self" collection="view-pattern" />
9587 <include syntax="self" collection="lambda-case" />
9688 <include syntax="self" collection="lambda-head" />
97− <include syntax="self" collection="case-expression" />
98− <include syntax="self" collection="qconid" />
89+ <include syntax="self" collection="type-applications" />
90+ <include syntax="self" collection="outer-case-expression" />
9991 <include syntax="self" collection="qvarid" />
10092 <include syntax="self" collection="tuple" />
93+
94+
95+
96+ <!-- Needed for do binds -->
97+ <!-- <include syntax="self" collection="pattern-match" /> -->
98+ </collection>
99+
100+ <collection name="pattern-match">
101+ <include syntax="self" collection="literal" />
102+ <include syntax="self" collection="tuple-match" />
103+ <!-- <include syntax="self" collection="at-pattern" /> -->
104+ <include syntax="self" collection="varid" />
105+ <include syntax="self" collection="qconid" />
106+ <include syntax="self" collection="record-match" />
107+ <include syntax="self" collection="list-pattern" />
108+ <include syntax="self" collection="view-pattern" />
109+ </collection>
110+
111+ <collection name="type-applications">
112+ <scope name="type-applications">
113+ <starts-with>
114+ <expression>(\s@)\(</expression>
115+ <capture number="1" name="haskell.keyword.operator.typeapplication" />
116+ </starts-with>
117+ <ends-with>
118+ <expression>)</expression>
119+ </ends-with>
120+ <subscopes>
121+ <include syntax="self" collection="type" />
122+ </subscopes>
123+ </scope>
124+ <scope name="type-applications-single">
125+ <expression>(@)(\w+)</expression>
126+ <capture number="1" name="haskell.keyword.operator.typeapplication" />
127+ <capture number="2" name="haskell.identifier.type" />
128+ </scope>
101129 </collection>
102130
103131 <collection name="Quote">
@@ -136,8 +164,8 @@
136164 <capture number="1" name="haskell.pattern.record.bracket" />
137165 </ends-with>
138166 <subscopes>
139− <include syntax="self" collection="comments" />
140− <include syntax="self" collection="expressions" />
167+ <include syntax="self" collection="pattern-match" />
168+ <include syntax="self" collection="varid" />
141169 <scope name="record-sep">
142170 <expression>=</expression>
143171 </scope>
@@ -159,7 +187,6 @@
159187 <capture number="1" name="haskell.pattern.record.bracket" />
160188 </ends-with>
161189 <subscopes>
162− <include syntax="self" collection="comments" />
163190 <scope name="haskell.pattern.record.wildcard">
164191 <expression>\.\.</expression>
165192 </scope>
@@ -186,12 +213,29 @@
186213 <capture number="1" name="haskell.list.bracket" />
187214 </ends-with>
188215 <subscopes>
189− <include syntax="self" collection="comments" />
190216 <include syntax="self" collection="expressions" />
191217 </subscopes>
192218 </scope>
193219 </collection>
194220
221+ <collection name="list-pattern">
222+ <symbol type="expression" />
223+ <scope name="haskell.pattern.list">
224+ <starts-with>
225+ <expression>(\[)</expression>
226+ <capture number="1" name="haskell.pattern.list.bracket" />
227+ </starts-with>
228+ <ends-with>
229+ <expression>(\])</expression>
230+ <capture number="1" name="haskell.pattern.list.bracket" />
231+ </ends-with>
232+ <subscopes>
233+ <include syntax="self" collection="pattern-match" />
234+ </subscopes>
235+ </scope>
236+ </collection>
237+
238+
195239 <collection name="view-pattern">
196240 <scope name="haskell.pattern.view">
197241 <symbol type="expression" />
@@ -208,7 +252,24 @@
208252 <scope name="haskell.pattern.view.operator.arrow">
209253 <expression>-&gt;</expression>
210254 </scope>
211− <include syntax="self" collection="expressions" />
255+ <include syntax="self" collection="pattern-match" />
256+ </subscopes>
257+ </scope>
258+ </collection>
259+
260+ <collection name="tuple-match">
261+ <symbol type="expression" />
262+ <scope name="haskell.pattern.tuple">
263+ <starts-with>
264+ <expression>(\()</expression>
265+ <capture number="1" name="haskell.pattern.tuple.bracket" />
266+ </starts-with>
267+ <ends-with>
268+ <expression>(\))</expression>
269+ <capture number="1" name="haskell.pattern.tuple.bracket" />
270+ </ends-with>
271+ <subscopes>
272+ <include syntax="self" collection="pattern-match" />
212273 </subscopes>
213274 </scope>
214275 </collection>
@@ -224,7 +285,49 @@
224285 <capture number="1" name="haskell.case.keyword.condition" />
225286 </ends-with>
226287 <subscopes anchored="true">
227− <include syntax="self" collection="expressions" />
288+ <include syntax="self" collection="pattern-match" />
289+ </subscopes>
290+ </scope>
291+ </collection>
292+
293+ <collection name="case-match">
294+ <scope name="case-match">
295+ <starts-with>
296+ <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
297+ </starts-with>
298+ <ends-with>
299+ <expression>-&gt;</expression>
300+ </ends-with>
301+ <subscopes anchored="true">
302+ <include syntax="self" collection="pattern-match" />
303+ </subscopes>
304+ </scope>
305+ </collection>
306+
307+ <collection name="inner-case-expressions">
308+ <scope name="inner-case-expressions">
309+ <starts-with>
310+ <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
311+ </starts-with>
312+ <ends-with>
313+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
314+ </ends-with>
315+ <subscopes>
316+ <include syntax="self" collection="case-match" />
317+ <include syntax="self" collection="expressions"/>
318+ </subscopes>
319+ </scope>
320+ </collection>
321+
322+ <collection name="outer-case-expression">
323+ <scope name="outer-case-expression">
324+ <starts-with>
325+ <expression>(?=case)</expression>
326+ </starts-with>
327+ <ends-with />
328+ <subscopes anchored="true" skip-whitespace="false">
329+ <include syntax="self" collection="case-expression" />
330+ <include syntax="self" collection="inner-case-expressions" repeat="true" />
228331 </subscopes>
229332 </scope>
230333 </collection>
@@ -241,117 +344,70 @@
241344 <capture number="1" name="haskell.tuple.bracket" />
242345 </ends-with>
243346 <subscopes>
244− <include syntax="self" collection="comments" />
245347 <include syntax="self" collection="expressions" />
246348 </subscopes>
247349 </scope>
248350 </collection>
249351
250352 <collection name="typeclass">
251− <scope name="haskell.definition.class.head">
252− <symbol type="class" scope="global" name-selector="haskell.keyword.construct.class.name">
253− <context behavior="whitespace" foldable="true" />
254− </symbol>
353+ <symbol type="interface" />
354+ <scope name="haskell.definition.class">
255355 <starts-with>
256356 <expression>^(\h*)(class)($|\h)</expression>
257357 <capture number="2" name="haskell.keyword.construct.class" />
258358 </starts-with>
259− <ends-with />
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>
267− </ends-with>
268− <subscopes>
269− <include syntax="self" collection="comments" />
270− <include syntax="self" collection="type" />
271− </subscopes>
272− </scope>
273− <scope name="haskell.keyword.construct.where" optional="true">
359+ <ends-with>
360+ <template>^(?!\s+\1\S)(?!\s*$)</template>
361+ </ends-with>
362+ <subscopes>
363+ <scope name="haskell.keyword.construct.where">
274364 <expression>where</expression>
275365 </scope>
366+ <include syntax="self" collection="type" />
367+ <include syntax="self" collection="type-definition" />
368+ <!-- <include syntax="self" collection="type-annotation" /> -->
369+ <include syntax="self" collection="definition" />
276370 </subscopes>
277371 </scope>
278372 </collection>
279373
280374 <collection name="instance">
281375 <scope name="haskell.instance">
282− <symbol type="category" name-selector="haskell.keyword.construct.instance.name">
283− <context behavior="whitespace" foldable="true" />
284− </symbol>
376+ <symbol type="category" />
285377 <starts-with>
286378 <expression>^(\h*)(instance)($|\h)</expression>
287379 <capture number="2" name="haskell.keyword.construct.instance" />
288380 </starts-with>
289− <ends-with />
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>
297− </ends-with>
298− <subscopes>
299− <include syntax="self" collection="type" />
300− </subscopes>
301− </scope>
302− <scope name="haskell.keyword.construct.where" optional="true">
303− <expression>where</expression>
304− </scope>
305− </subscopes>
306− </scope>
307− </collection>
308−
309− <collection name="type-family-definition">
310− <scope name="haskell.definition.type-family.type">
311− <starts-with>
312− <expression>^(\h*)(type\h+family)</expression>
313− <capture number="2" name="haskell.keyword.construct.type-family" />
314− </starts-with>
315381 <ends-with>
316382 <template>^(?!\s+\1\S)(?!\s*$)</template>
317383 </ends-with>
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>
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">
329− <expression>\S+</expression>
330− </scope>
331− <include syntax="self" collection="type" repeat="true" optional="true" />
332− </subscopes>
384+ <subscopes>
385+ <scope name="haskell.keyword.construct.where">
386+ <expression>where</expression>
333387 </scope>
334−
335− <include syntax="self" collection="type-family-case-definition" optional="true" repeat="true" />
388+ <include syntax="self" collection="type" />
389+ <include syntax="self" collection="type-definition" />
390+ <include syntax="self" collection="type-annotation" />
391+ <include syntax="self" collection="definition" />
336392 </subscopes>
337393 </scope>
338394 </collection>
339395
340− <collection name="type-family-case-definition">
341− <scope name="haskell.definition.type-family.type.case">
396+ <collection name="type-family-definition">
397+ <scope name="haskell.definition.type.type-family">
398+ <symbol type="type" />
342399 <starts-with>
343− <expression>^(\h*)(?=\S)</expression>
400+ <expression>^(\h*)(type\h+family)\h+`?(\w(\w|')*)`?($|\h)</expression>
401+ <capture number="2" name="haskell.keyword.construct.type-family" />
344402 </starts-with>
345403 <ends-with>
346404 <template>^(?!\s+\1\S)(?!\s*$)</template>
347405 </ends-with>
348406 <subscopes>
349− <include syntax="self" collection="comments" />
350− <include syntax="self" collection="type" optional="true" repeat="true" />
351− <scope>
352− <expression>=</expression>
407+ <scope name="haskell.keyword.construct.where">
408+ <expression>where</expression>
353409 </scope>
354− <include syntax="self" collection="type" optional="true" repeat="true" />
410+ <include syntax="self" collection="type" />
355411 </subscopes>
356412 </scope>
357413 </collection>
@@ -359,26 +415,65 @@
359415 <collection name="definition">
360416 <scope name="haskell.definition.type.function">
361417 <symbol type="function">
362− <context behavior="whitespace" foldable="true" />
418+ <display-name>
419+ <component selector="haskell.definition.type.function" />
420+ </display-name>
421+
363422 </symbol>
364423 <starts-with>
365424 <expression>^(?=(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h))</expression>
366425 <capture number="2" name="haskell.keyword.construct.default" />
367− <capture number="3" name="haskell.identifier.function.name" />
426+ <capture number="3" name="haskell.identifier.function" />
368427 </starts-with>
369428 <ends-with>
370429 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
371430 </ends-with>
372431 <subscopes>
373− <include syntax="self" collection="comments" />
374432 <include syntax="self" collection="type-annotation" />
375433 <include syntax="self" collection="implementation" />
376434 </subscopes>
377435 </scope>
378436 </collection>
379437
438+ <collection name="do-bind">
439+ <scope name="do-bind">
440+ <starts-with>
441+ <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
442+ </starts-with>
443+ <ends-with>
444+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
445+ </ends-with>
446+ <subscopes>
447+ <include syntax="self" collection="do-pattern" />
448+ <include syntax="self" collection="expressions" />
449+ <!-- <scope name="bind-arrow">
450+ <expression>&lt;-</expression>
451+ </scope> -->
452+ </subscopes>
453+ </scope>
454+ </collection>
455+
456+ <collection name="do-pattern">
457+ <scope name="do-pattern">
458+ <starts-with>
459+ <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
460+ </starts-with>
461+ <ends-with>
462+ <expression>&lt;-</expression>
463+ </ends-with>
464+ <subscopes>
465+ <include syntax="self" collection="pattern-match" />
466+ <!-- <scope name="bind-arrow">
467+ <expression>&lt;-</expression>
468+ </scope>
469+ <include syntax="self" collection="expressions" repeat="true" /> -->
470+ </subscopes>
471+ </scope>
472+ </collection>
473+
380474 <collection name="implementation">
381− <scope name="haskell.definition.type.function.implementation">
475+ <scope name="haskell.definition.type.function">
476+ <local scope="within-construct" />
382477 <starts-with>
383478 <expression>^(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h)</expression>
384479 <capture number="2" name="haskell.keyword.construct.default" />
@@ -388,20 +483,14 @@
388483 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
389484 </ends-with>
390485 <subscopes>
391− <include syntax="self" collection="comments" />
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" />
486+ <include syntax="self" collection="where-clause" />
487+ <include syntax="self" collection="expressions" />
399488 </subscopes>
400489 </scope>
401490 </collection>
402491
403492 <collection name="type-annotation">
404− <scope name="haskell.definition.type.function.type-signature">
493+ <scope name="haskell.definition.type.function">
405494 <starts-with>
406495 <expression>^(\h*)`?(\w(\w|')*)`?\h*::($|\h)</expression>
407496 <capture number="2" name="haskell.identifier.function" />
@@ -410,7 +499,6 @@
410499 <template>^(?!\s+\1\S)(?!\s*$)</template>
411500 </ends-with>
412501 <subscopes>
413− <include syntax="self" collection="comments" />
414502 <include syntax="self" collection="type" />
415503 </subscopes>
416504 </scope>
@@ -418,19 +506,15 @@
418506
419507 <collection name="type-definition">
420508 <scope name="haskell.definition.type">
421− <symbol type="type" scope="global">
422− <context behavior="whitespace" foldable="true" />
423− </symbol>
424509 <starts-with>
425510 <expression>^(\h*)(type)\h+(\w(\w|')*)</expression>
426511 <capture number="2" name="haskell.keyword.construct.type" />
427− <capture number="3" name="haskell.identifier.type.name" />
512+ <capture number="3" name="haskell.identifier.type" />
428513 </starts-with>
429514 <ends-with>
430515 <template>^(?!\s+\1\S)(?!\s*$)</template>
431516 </ends-with>
432517 <subscopes>
433− <include syntax="self" collection="comments" />
434518 <include syntax="self" collection="type" />
435519 </subscopes>
436520 </scope>
@@ -438,72 +522,66 @@
438522
439523 <collection name="GADT-definition">
440524 <scope name="haskell.definition.struct.GADT">
441− <symbol type="struct" scope="global">
442− <context behavior="subtree" foldable="false" />
443− </symbol>
444525 <starts-with>
445− <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
526+ <expression>^(\h*)(data)\h+(\w(\w|')*)</expression>
446527 <capture number="2" name="haskell.keyword.construct.data.GADT" />
447− <capture number="3" name="haskell.identifier.data.type.name" />
448528 </starts-with>
449529 <ends-with>
450530 <template>^(?!\s+\1\S)(?!\s*$)</template>
451531 </ends-with>
452532 <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" />
460533 <include syntax="self" collection="gadt-constructor" />
461534 <include syntax="self" collection="type" />
535+ <include syntax="self" collection="record-definition" />
536+ <include syntax="self" collection="record-definition-field-name" />
462537 </subscopes>
463538 </scope>
464539 </collection>
465540
466541 <collection name="gadt-constructor">
467− <scope name="haskell.identifier.type.struct.data.constructor">
468− <symbol type="constructor">
469− <context behavior="subtree" foldable="true" />
470− </symbol>
542+ <scope name="identifier.type.struct.GADT.constructor">
543+ <expression>^\h+[A-Z](\w|')*</expression>
544+ </scope>
545+ </collection>
546+
547+ <collection name="data-definition">
548+ <scope name="haskell.definition.struct.data">
471549 <starts-with>
472− <expression>(^|=|\||^)\h+([A-Z](\w|')*)</expression>
473− <capture number="2" name="haskell.identifier.data.name" />
550+ <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
551+ <capture number="2" name="haskell.keyword.construct.data.newtype" />
552+ <capture number="3" name="haskell.identifier.type" />
474553 </starts-with>
475− <ends-with />
476− <subscopes anchored="true">
554+ <ends-with>
555+ <template>^(?!\s+\1\S)(?!\s*$)</template>
556+ </ends-with>
557+ <subscopes>
477558 <include syntax="self" collection="record-definition" />
559+ <include syntax="self" collection="data-constructor" />
560+ <include syntax="self" collection="type" />
478561 </subscopes>
479562 </scope>
480563 </collection>
481564
482− <collection name="deriving-clause">
483− <scope name="haskell.record.construct.deriving.keyword">
484− <expression>deriving(\h+(newtype|stock|anyclass))?</expression>
565+ <collection name="data-constructor">
566+ <scope name="haskell.identifier.type.struct.data.constructor">
567+ <expression>=\h+[A-Z](\w|')*</expression>
485568 </scope>
486− <scope name="haskell.record.construct.deriving.keyword">
487− <include syntax="self" collection="comments" />
488− <expression>via</expression>
569+ <scope name="haskell.identifier.type.struct.data.constructor">
570+ <expression>\|\h+[A-Z](\w|')*</expression>
489571 </scope>
490572 </collection>
491573
492574 <collection name="record-definition">
493575 <scope name="haskell.record">
494− <symbol>
495− <context behavior="subtree" foldable="true" />
496− </symbol>
497576 <starts-with>
498− <expression>(?=\{)</expression>
499− <capture number="0" name="haskell.record.bracket" />
577+ <expression>(\{)</expression>
578+ <capture number="1" name="haskell.record.bracket" />
500579 </starts-with>
501580 <ends-with>
502581 <expression>(\})</expression>
503582 <capture number="1" name="haskell.record.bracket" />
504583 </ends-with>
505584 <subscopes>
506− <include syntax="self" collection="comments" />
507585 <include syntax="self" collection="record-definition-field-name" />
508586 <include syntax="self" collection="type" />
509587 </subscopes>
@@ -512,65 +590,26 @@
512590
513591 <collection name="record-definition-field-name">
514592 <scope name="haskell.record.definition.property">
515− <symbol type="property" />
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+ <expression>\w(\w|')*\h*::</expression>
519594 </scope>
520595 </collection>
521596
522597 <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>
563598 <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" />
567− <capture number="4" name="haskell.identifier.type" />
599+ <scope name="haskell.identifier.type">
600+ <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
568601 </scope>
569602 <scope name="haskell.keyword.construct.forall">
570603 <expression>forall</expression>
571604 </scope>
572605 <scope name="haskell.identifier.type.variable">
573− <expression>(?!where)(?!=)((?!(\(|\)|\,|\!))\S)((?!(\(|\)|\,))\w)*</expression>
606+ <expression>\w(\w|')*</expression>
607+ </scope>
608+ <scope name="haskell.keyword.construct.function-arrow">
609+ <expression>-&gt;</expression>
610+ </scope>
611+ <scope name="haskell.keyword.construct.fat-arrow">
612+ <expression>=&gt;</expression>
574613 </scope>
575614 </collection>
576615
@@ -585,7 +624,6 @@
585624 <template>^(?!\s+\1\S)(?!\s*$)</template>
586625 </ends-with>
587626 <subscopes>
588− <include syntax="self" collection="comments" />
589627 <scope name="haskell.keyword.construct.where">
590628 <expression>where</expression>
591629 </scope>
@@ -605,7 +643,6 @@
605643 <capture number="1" name="haskell.type-list.bracket" />
606644 </ends-with>
607645 <subscopes>
608− <include syntax="self" collection="comments" />
609646 <include syntax="self" collection="type" />
610647 </subscopes>
611648 </scope>
@@ -622,7 +659,6 @@
622659 <capture number="1" name="haskell.keyword.construct.lambda" />
623660 </ends-with>
624661 <subscopes>
625− <include syntax="self" collection="comments" />
626662 <include syntax="self" collection="pattern-match" />
627663 </subscopes>
628664 </scope>
@@ -636,6 +672,7 @@
636672
637673 <collection name="where-clause">
638674 <scope name="haskell.construct.where">
675+ <local scope="within-parent" />
639676 <starts-with>
640677 <expression>^(\h*)(where)</expression>
641678 <capture number="2" name="haskell.construct.keyword.where" />
@@ -644,7 +681,6 @@
644681 <template>^(?!\1\s*\S)(?!s*$)</template>
645682 </ends-with>
646683 <subscopes>
647− <include syntax="self" collection="comments" />
648684 <include syntax="self" collection="definition" />
649685 </subscopes>
650686 </scope>
@@ -653,9 +689,7 @@
653689
654690 <collection name="qvarid">
655691 <scope name="haskell.identifier.function">
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+ <expression>([A-Z](\w|')*\.)*\w(\w|')*</expression>
659693 </scope>
660694 </collection>
661695
@@ -684,12 +718,12 @@
684718
685719
686720 <collection name="strings">
687− <scope name="haskell.string.double-quoted" spell-check="true">
721+ <scope name="haskell.string.double-quoted">
688722 <starts-with>
689− <expression>&quot;</expression>
723+ <expression>"</expression>
690724 </starts-with>
691725 <ends-with>
692− <expression>&quot;</expression>
726+ <expression>"</expression>
693727 </ends-with>
694728 <subscopes>
695729 <scope name="haskell.string.escape-sequences">
@@ -712,11 +746,8 @@
712746
713747 <collection name="module">
714748 <scope name="haskell.definition.module.package">
715− <symbol type="package">
716− <context behavior="subtree" foldable="true" export-local="true" />
717− </symbol>
718749 <starts-with>
719− <expression>^(module)\s+((\w|\.)+)</expression>
750+ <expression>^(module)\s+(\w|\.)+</expression>
720751 <capture number="1" name="haskell.construct.keyword.module" />
721752 <capture number="2" name="haskell.definition.module.package" />
722753 </starts-with>
@@ -724,75 +755,32 @@
724755 <expression>(where)</expression>
725756 <capture number="1" name="haskell.construct.keyword.module" />
726757 </ends-with>
727− <subscopes>
728− <scope name="identifier.haskell.type">
729− <symbol type="expression" />
730− <symbol type="expression" />
731− <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
732− <capture number="1" name="identifier.type" />
733− </scope>
734− <scope name="identifier.variable">
735− <symbol type="expression" />
758+ <subscopes export-symbols="true">
759+ <scope name="identifier.constant">
736760 <expression>(\w|')+</expression>
737− <capture number="0" name="identifier.haskell.function" />
738761 </scope>
739762 </subscopes>
740763 </scope>
741764 </collection>
742765
743766 <collection name="import">
744− <scope name="haskell.construct.import">
745− <starts-with>
746− <expression>^(import)\s</expression>
747− <capture number="1" name="haskell.construct.keyword.import" />
748− </starts-with>
749− <ends-with>
750− <expression>(?=^\S)</expression>
751− </ends-with>
752− <subscopes>
753− <scope name="haskell.construct.qualified">
754− <symbol type="expression" />
755− <expression>qualified</expression>
756− <capture number="0" name="haskell.construct.keyword.qualified" />
757− </scope>
758−
759− <scope name="haskell.construct.hiding">
760− <symbol type="keyword">
761− <context behavior="subtree" />
762− </symbol>
763− <starts-with>
764− <expression>(hiding)\h*(?=\()</expression>
765− <capture number="1" name="haskell.construct.keyword.hiding" />
766− </starts-with>
767− <ends-with>
768− <expression>(?=\))</expression>
769− </ends-with>
770− <subscopes anchored="true">
771− <include syntax="self" collection="import-list" />
772− <symbol type="expression" />
773− </subscopes>
774− </scope>
775−
776− <scope name="haskell.construct.keyword.as">
777− <symbol type="package" />
778− <expression>as(\h+([A-Z]\w*))?</expression>
779− <capture number="2" name="haskell.package.qualified.name" />
780− </scope>
781− <scope name="haskell.identifier.module.package">
782− <symbol type="package" />
783− <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
784− <capture number="0" name="haskell.package.name" />
785− </scope>
786− <include syntax="self" collection="import-list" />
787− </subscopes>
767+ <scope name="haskell.construct.keyword.import">
768+ <expression>^import\s</expression>
769+ </scope>
770+ <scope name="haskell.construct.keyword.qualified">
771+ <expression>qualified</expression>
788772 </scope>
773+ <scope name="haskell.construct.keyword.as">
774+ <expression>as</expression>
775+ </scope>
776+ <scope name="haskell.identifier.module.package">
777+ <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
778+ </scope>
779+ <include syntax="self" collection="import-list" />
789780 </collection>
790781
791782 <collection name="import-list">
792783 <scope name="import-list">
793− <symbol>
794− <context behavior="subtree" export-local="true" />
795− </symbol>
796784 <starts-with>
797785 <expression>(\()</expression>
798786 <capture number="1" name="haskell.import-list.bracket" />
@@ -802,21 +790,20 @@
802790 <capture number="1" name="haskell.import-list.bracket" />
803791 </ends-with>
804792 <subscopes>
805− <scope name="haskell.identifier.struct">
806− <symbol type="expression" />
807− <symbol type="reference" scope="local" />
808− <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
809− <capture number="1" name="haskell.import-list.identifier.type.name" />
810− </scope>
811− <scope name="haskell.identifier.function">
812− <symbol type="reference" scope="local" />
813− <expression>(\w|')+</expression>
814− <capture number="0" name="haskell.import-list.function.name" />
793+ <scope name="identifier.decorator">
794+ <expression>([A-Z](\w|')*\.)*\w(\w|')*</expression>
815795 </scope>
816796 </subscopes>
817797 </scope>
818798 </collection>
819799
800+ <!-- <collection name="special">
801+ <scope>
802+ <expression>(;|,)</expression>
803+ </scope>
804+ </collection> -->
805+
806+
820807 <collection name="reservedop">
821808 <scope name="keyword.operator">
822809 <expression>(\.\.|:|::|=|\\|\||&lt;-|-&gt;|@|~|=>)</expression>
@@ -824,11 +811,10 @@
824811 </collection>
825812
826813 <collection name="keywords">
827− <scope name="haskell.keyword.self">
814+ <scope name="haskell.keyword.modifier">
828815 <symbol type="keyword" />
829816 <strings>
830817 <string>do</string>
831− <string>mdo</string>
832818 <string>in</string>
833819 <string>infix</string>
834820 <string>infixl</string>
@@ -866,18 +852,20 @@
866852 <strings>
867853 <string>undefined</string>
868854 <string>_</string>
869− <string>@</string>
870855 </strings>
871856 </scope>
872857 </collection>
873858
874859 <collection name="comments">
875860 <scope name="haskell.comment.single" spell-check="true">
876− <symbol type="comment" />
877− <expression> --.*$</expression>
861+ <starts-with>
862+ <expression>--</expression>
863+ </starts-with>
864+ <ends-with>
865+ <expression>$</expression>
866+ </ends-with>
878867 </scope>
879868 <scope name="haskell.comment.block" spell-check="true">
880− <symbol type="comment" />
881869 <starts-with>
882870 <expression>{-</expression>
883871 </starts-with>
Haskell Language Server.novaextension/extension.json+159−200
@@ -6,333 +6,292 @@
66 "version": "1.0",
77 "categories": ["languages", "formatters"],
88 "main": "main.js",
9− "entitlements":
10− {
9+ "entitlements": {
1110 "process": true,
1211 "filesystem": "readwrite",
1312 "requests": true
1413 },
15− "configWorkspace": [
16− {
14+ "configWorkspace": [{
1715 "key": "haskell-language-server-path",
1816 "title": "Haskell Language Server path",
1917 "description": "If you want to use a custom HLS build for this project, then specify the path to it here.",
2018 "type": "path",
2119 "placeholder": "/usr/local/bin/example"
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− {
20+ }, {
3221 "type": "section",
3322 "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.",
35− "children": [
36− {
37− "key": "haskell.formattingProvider",
38− "title": "Code formatter",
39− "type": "enum",
40− "values": [
41− "brittany",
42− "floskell",
43− "fourmolu",
44− "ormolu",
45− "stylish-haskell",
46− "none"
47− ],
48− "default": "ormolu",
49− "description": "The formatter to use when formatting a document or range. Ensure the plugin is enabled."
50− },
51− {
52− "key": "haskell.checkProject",
53− "title": "Check whole project",
54− "type": "boolean",
55− "default": false,
56− "description": "Whether to typecheck the entire project on load. It could lead to bad perfomance in large projects."
57− },
58− {
59− "title": "Completions",
23+ "children": [{
24+ "key": "haskell.formattingProvider",
25+ "title": "Code formatter",
26+ "type": "enum",
27+ "values": [
28+ "brittany",
29+ "floskell",
30+ "fourmolu",
31+ "ormolu",
32+ "stylish-haskell",
33+ "none"
34+ ],
35+ "default": "ormolu",
36+ "description": "The formatter to use when formatting a document or range. Ensure the plugin is enabled."
37+ }, {
38+ "key": "haskell.checkProject",
39+ "title": "Check whole project",
40+ "type": "boolean",
41+ "default": false,
42+ "description": "Whether to typecheck the entire project on load. It could drive to bad perfomance in large projects."
43+ }, {
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+ }, {
50+ "type": "section",
51+ "title": "Plugin settings",
52+ "children": [{
6053 "type": "section",
61− "children": [
62− {
63− "key": "haskell.plugin.ghcide-completions.config.autoExtendOn",
64− "title": "Extend with out-of-scope identifiers",
65− "description": "Extends the import list automatically when completing a out-of-scope identifier",
54+ "title": "Import lens",
55+ "description": "Not currently implemented in Nova",
56+ "children": [{
57+ "key": "haskell.plugin.importLens.codeActionsOn",
58+ "title": "Enable code actions",
59+ "type": "boolean",
6660 "default": true,
67− "type": "boolean"
68− },
69− {
70− "key": "haskell.plugin.ghcide-completions.config.snippetsOn",
71− "title": "Insert snippets",
72− "description": "Inserts snippets when using code completions",
61+ "description": "Enables explicit imports code actions"
62+ }, {
63+ "key": "haskell.plugin.importLens.codeLensOn",
64+ "title": "Enable code lens",
65+ "type": "boolean",
7366 "default": true,
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
67+ "description": "Enables explicit imports code lenses"
8268 }]
83− },
84− {
69+ }, {
8570 "title": "HLint",
8671 "type": "section",
87− "children": [
88− {
72+ "children": [{
8973 "key": "haskell.plugin.hlint.codeActionsOn",
9074 "title": "Enable code actions",
9175 "type": "boolean",
9276 "default": true,
9377 "description": "Enables hlint code actions (apply hints)"
94− },
95− {
78+ }, {
9679 "key": "haskell.plugin.hlint.diagnosticsOn",
9780 "title": "Enable diagnostics",
9881 "type": "boolean",
9982 "default": true,
10083 "description": "Enables hlint diagnostics"
101− },
102− {
103− "key": "haskell.plugin.hlint.config.flags",
104− "title": "Flags",
105− "description": "Flags used by hlint",
106− "default": [],
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"
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"
84+ }, {
85+ "title": "Configuration",
86+ "type": "section",
87+ "children": [{
88+ "key": "haskell.plugin.hlint.config.flags",
89+ "title": "Flags",
90+ "description": "Flags used by hlint",
91+ "default": [],
92+ "type": "stringArray"
93+ }]
12894 }]
129− },
130−
131− {
95+ }, {
13296 "title": "Eval",
13397 "type": "section",
134− "children": [
135− {
98+ "children": [{
13699 "key": "haskell.plugin.eval.globalOn",
137100 "title": "Enable",
138101 "type": "boolean",
139102 "default": true,
140103 "description": "Enables eval plugin"
141104 }]
142− },
143− {
105+ }, {
144106 "title": "Module name",
145107 "type": "section",
146− "children": [
147− {
108+ "children": [{
148109 "key": "haskell.plugin.moduleName.globalOn",
149110 "title": "Enable",
150111 "type": "boolean",
151112 "default": true,
152113 "description": "Enables module name plugin"
153114 }]
154− },
155− {
115+ }, {
156116 "title": "Splice",
157117 "type": "section",
158− "children": [
159− {
118+ "children": [{
160119 "key": "haskell.plugin.splice.globalOn",
161120 "title": "Enable",
162121 "type": "boolean",
163122 "default": true,
164123 "description": "Enables splice plugin (expand template haskell definitions)"
165124 }]
166− },
167− {
125+ }, {
168126 "title": "Haddock comments",
169127 "type": "section",
170− "children": [
171− {
128+ "children": [{
172129 "key": "haskell.plugin.haddockComments.globalOn",
173130 "title": "Enable",
174131 "type": "boolean",
175132 "default": true,
176133 "description": "Enables haddock comments plugin"
177134 }]
178− },
179− {
135+ }, {
180136 "title": "Class",
181137 "type": "section",
182− "children": [
183− {
138+ "children": [{
184139 "key": "haskell.plugin.class.globalOn",
185140 "title": "Enable",
186141 "type": "boolean",
187142 "default": true,
188143 "description": "Enables type class plugin"
189144 }]
190− },
191− {
145+ }, {
192146 "title": "Retrie",
193147 "type": "section",
194− "children": [
195− {
148+ "children": [{
196149 "key": "haskell.plugin.retrie.globalOn",
197150 "title": "Enable",
198151 "type": "boolean",
199152 "default": true,
200153 "description": "Enables retrie plugin"
201154 }]
202− },
203− {
155+ }, {
204156 "title": "Wingman",
205157 "type": "section",
206− "children": [
207− {
158+ "children": [{
208159 "key": "haskell.plugin.tactics.globalOn",
209160 "title": "Enable",
210161 "type": "boolean",
211162 "default": true,
212163 "description": "Enables Wingman (tactics) plugin"
213− },
214− {
215− "key": "haskell.plugin.tactics.config.auto_gas",
216− "title": "Gas",
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.",
218− "default": 4,
219− "type": "number"
220− },
221− {
222− "key": "haskell.plugin.tactics.config.hole_severity",
223− "title": "Hole severity",
224− "description": "The severity to use when showing hole diagnostics.",
225− "values": [
226− 1,
227− 2,
228− 3,
229− 4,
230− null
231− ],
232− "default": null,
233− "type": "enum"
234− },
235− {
236− "key": "haskell.plugin.tactics.config.max_use_ctor_actions",
237− "title": "Max number of constructors",
238− "type": "number",
239− "default": 5,
240− "description": "Maximum number of `Use constructor <x>` code actions that can appear"
241− },
242− {
243− "key": "haskell.plugin.tactics.config.timeout_duration",
244− "title": "Timeout",
245− "description": "The timeout for Wingman actions, in seconds",
246− "default": 2,
247− "type": "number"
248− },
249− {
250− "key": "haskell.plugin.tactics.config.proofstate_styling",
251− "title": "Proof states",
252− "description": "Should Wingman emit styling markup when showing metaprogram proof states?",
253− "default": true,
254− "type": "boolean"
164+ }, {
165+ "title": "Configuration",
166+ "type": "section",
167+ "children": [{
168+ "key": "haskell.plugin.tactics.config.auto_gas",
169+ "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.",
171+ "default": 4,
172+ "type": "number"
173+ }, {
174+ "key": "haskell.plugin.tactics.config.hole_severity",
175+ "title": "Hole severity",
176+ "description": "The severity to use when showing hole diagnostics.",
177+ "values": [
178+ 1,
179+ 2,
180+ 3,
181+ 4,
182+ null
183+ ],
184+ "default": null,
185+ "type": "enum"
186+ }, {
187+ "key": "haskell.plugin.tactics.config.max_use_ctor_actions",
188+ "title": "Max number of constructors",
189+ "type": "number",
190+ "default": 5,
191+ "description": "Maximum number of `Use constructor <x>` code actions that can appear"
192+ }, {
193+ "key": "haskell.plugin.tactics.config.timeout_duration",
194+ "title": "Timeout",
195+ "description": "The timeout for Wingman actions, in seconds",
196+ "default": 2,
197+ "type": "number"
198+ }, {
199+ "key": "haskell.plugin.tactics.config.proofstate_styling",
200+ "title": "Proof states",
201+ "description": "Should Wingman emit styling markup when showing metaprogram proof states?",
202+ "default": true,
203+ "type": "boolean"
204+ }]
255205 }]
256− },
257− {
206+ }, {
258207 "title": "Pragmas",
259208 "type": "section",
260− "children": [
261− {
209+ "children": [{
262210 "key": "haskell.plugin.pragmas.codeActionsOn",
263211 "title": "Enable code actions",
264212 "type": "boolean",
265213 "default": true,
266214 "description": "Enables pragmas code actions"
267− },
268− {
215+ }, {
269216 "key": "haskell.plugin.pragmas.completionOn",
270217 "title": "Enable completions",
271218 "type": "boolean",
272219 "default": true,
273220 "description": "Enables pragmas completions"
274221 }]
275− },
276− {
277− "title": "Type lenses",
222+ }, {
223+ "title": "Completions",
224+ "type": "section",
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+ }, {
278243 "description": "Not currently implemented in Nova",
279244 "type": "section",
280− "children": [
281− {
245+ "children": [{
282246 "key": "haskell.plugin.ghcide-type-lenses.globalOn",
283247 "title": "Enable",
284248 "type": "boolean",
285249 "default": true,
286250 "description": "Enables type lenses plugin"
287− },
288− {
289− "key": "haskell.plugin.ghcide-type-lenses.config.mode",
290− "title": "Mode",
291− "type": "enum",
292− "default": true,
293− "description": "Control how type lenses are shown",
294− "values": ["always", "exported", "diagnostics"]
251+ }, {
252+ "title": "Configuration",
253+ "type": "section",
254+ "children": [{
255+ "key": "haskell.plugin.ghcide-type-lenses.config.mode",
256+ "title": "Mode",
257+ "type": "enum",
258+ "default": true,
259+ "description": "Control how type lenses are shown",
260+ "values": ["always", "exported", "diagnostics"]
261+ }]
295262 }]
296− },
297− {
263+ }, {
298264 "title": "Refine imports",
299265 "type": "section",
300− "children": [
301− {
266+ "children": [{
302267 "key": "haskell.plugin.refineImports.globalOn",
303268 "title": "Enable",
304269 "type": "boolean",
305270 "default": true,
306271 "description": "Enables refine imports plugin"
307272 }]
308− }
309− ]
273+ }]
274+ }]
310275 }],
311276 "activationEvents": ["onLanguage:haskell", "onLanguage:hs"],
312− "commands":
313− {
314− "editor": [
315− {
277+ "commands": {
278+ "editor": [{
316279 "title": "Format file with Haskell Language Server",
317280 "command": "format",
318281 "when": "editorSyntax == 'haskell' && editorHasFocus",
319− "filters":
320− {
282+ "filters": {
321283 "syntaxes": ["haskell"]
322284 }
323285 }],
324− "extensions": [
325− {
286+ "extensions": [{
326287 "title": "Stop",
327288 "paletteTitle": "Stop Haskell Language Server",
328289 "command": "stop"
329− },
330− {
290+ }, {
331291 "title": "Restart",
332292 "paletteTitle": "Restart Haskell Language Server",
333293 "command": "restart"
334− },
335− {
294+ }, {
336295 "title": "Clear cached versions",
337296 "paletteTitle": "Clear cached versions of Haskell Language Server",
338297 "command": "clear-cache"