on d174941 help sign in
5 files changed+1394−464
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+1227−125 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+1227−125
@@ -1,9 +1,9 @@
11<?xml version="1.0" encoding="UTF-8"?>
22<syntax name="haskell">
33 <meta>
4− <name>Haskell</name>
5− <type>compiled</type>
6− <preferred-file-extension>hs</preferred-file-extension>
4+ <name>Haskell</name>
5+ <type>compiled</type>
6+ <preferred-file-extension>hs</preferred-file-extension>
77 </meta>
88
99 <detectors>
@@ -57,6 +57,7 @@
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" /> -->
6061 <include syntax="self" collection="GADT-definition" />
6162 <include syntax="self" collection="instance" />
6263 <include syntax="self" collection="typeclass" />
@@ -65,6 +66,7 @@
6566
6667 <template-scopes>
6768 <include syntax="self" collection="Quote" />
69+ <include syntax="self" collection="comments" />
6870 </template-scopes>
6971
7072 <collections>
@@ -77,27 +79,51 @@
7779 </collection>
7880
7981 <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" />
82+ <include syntax="self" collection="do-bind" />
9083 <include syntax="self" collection="literal" />
9184 <include syntax="self" collection="operators" />
92− <include syntax="self" collection="record-match" />
9385 <include syntax="self" collection="list" />
94− <include syntax="self" collection="view-pattern" />
9586 <include syntax="self" collection="lambda-case" />
9687 <include syntax="self" collection="lambda-head" />
97− <include syntax="self" collection="case-expression" />
98− <include syntax="self" collection="qconid" />
88+ <include syntax="self" collection="type-applications" />
89+ <include syntax="self" collection="outer-case-expression" />
9990 <include syntax="self" collection="qvarid" />
10091 <include syntax="self" collection="tuple" />
92+
93+
94+ <!-- Needed for do binds -->
95+ <!-- <include syntax="self" collection="pattern-match" /> -->
96+ </collection>
97+
98+ <collection name="pattern-match">
99+ <include syntax="self" collection="literal" />
100+ <include syntax="self" collection="tuple-match" />
101+ <!-- <include syntax="self" collection="at-pattern" /> -->
102+ <include syntax="self" collection="varid" />
103+ <include syntax="self" collection="qconid" />
104+ <include syntax="self" collection="record-match" />
105+ <include syntax="self" collection="list-pattern" />
106+ <include syntax="self" collection="view-pattern" />
107+ </collection>
108+
109+ <collection name="type-applications">
110+ <scope name="type-applications">
111+ <starts-with>
112+ <expression>(\s@)\(</expression>
113+ <capture number="1" name="haskell.keyword.operator.typeapplication" />
114+ </starts-with>
115+ <ends-with>
116+ <expression>)</expression>
117+ </ends-with>
118+ <subscopes>
119+ <include syntax="self" collection="type" />
120+ </subscopes>
121+ </scope>
122+ <scope name="type-applications-single">
123+ <expression>(@)(\w+)</expression>
124+ <capture number="1" name="haskell.keyword.operator.typeapplication" />
125+ <capture number="2" name="haskell.identifier.type" />
126+ </scope>
101127 </collection>
102128
103129 <collection name="Quote">
@@ -136,8 +162,8 @@
136162 <capture number="1" name="haskell.pattern.record.bracket" />
137163 </ends-with>
138164 <subscopes>
139− <include syntax="self" collection="comments" />
140− <include syntax="self" collection="expressions" />
165+ <include syntax="self" collection="pattern-match" />
166+ <include syntax="self" collection="varid" />
141167 <scope name="record-sep">
142168 <expression>=</expression>
143169 </scope>
@@ -159,7 +185,6 @@
159185 <capture number="1" name="haskell.pattern.record.bracket" />
160186 </ends-with>
161187 <subscopes>
162− <include syntax="self" collection="comments" />
163188 <scope name="haskell.pattern.record.wildcard">
164189 <expression>\.\.</expression>
165190 </scope>
@@ -186,12 +211,29 @@
186211 <capture number="1" name="haskell.list.bracket" />
187212 </ends-with>
188213 <subscopes>
189− <include syntax="self" collection="comments" />
190214 <include syntax="self" collection="expressions" />
191215 </subscopes>
192216 </scope>
193217 </collection>
194218
219+ <collection name="list-pattern">
220+ <symbol type="expression" />
221+ <scope name="haskell.pattern.list">
222+ <starts-with>
223+ <expression>(\[)</expression>
224+ <capture number="1" name="haskell.pattern.list.bracket" />
225+ </starts-with>
226+ <ends-with>
227+ <expression>(\])</expression>
228+ <capture number="1" name="haskell.pattern.list.bracket" />
229+ </ends-with>
230+ <subscopes>
231+ <include syntax="self" collection="pattern-match" />
232+ </subscopes>
233+ </scope>
234+ </collection>
235+
236+
195237 <collection name="view-pattern">
196238 <scope name="haskell.pattern.view">
197239 <symbol type="expression" />
@@ -208,7 +250,24 @@
208250 <scope name="haskell.pattern.view.operator.arrow">
209251 <expression>-&gt;</expression>
210252 </scope>
211− <include syntax="self" collection="expressions" />
253+ <include syntax="self" collection="pattern-match" />
254+ </subscopes>
255+ </scope>
256+ </collection>
257+
258+ <collection name="tuple-match">
259+ <symbol type="expression" />
260+ <scope name="haskell.pattern.tuple">
261+ <starts-with>
262+ <expression>(\()</expression>
263+ <capture number="1" name="haskell.pattern.tuple.bracket" />
264+ </starts-with>
265+ <ends-with>
266+ <expression>(\))</expression>
267+ <capture number="1" name="haskell.pattern.tuple.bracket" />
268+ </ends-with>
269+ <subscopes>
270+ <include syntax="self" collection="pattern-match" />
212271 </subscopes>
213272 </scope>
214273 </collection>
@@ -224,11 +283,53 @@
224283 <capture number="1" name="haskell.case.keyword.condition" />
225284 </ends-with>
226285 <subscopes anchored="true">
286+ <include syntax="self" collection="pattern-match" />
287+ </subscopes>
288+ </scope>
289+ </collection>
290+
291+ <collection name="case-match">
292+ <scope name="case-match">
293+ <starts-with>
294+ <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
295+ </starts-with>
296+ <ends-with>
297+ <expression>-&gt;</expression>
298+ </ends-with>
299+ <subscopes anchored="true">
300+ <include syntax="self" collection="pattern-match" />
301+ </subscopes>
302+ </scope>
303+ </collection>
304+
305+ <collection name="inner-case-expressions">
306+ <scope name="inner-case-expressions">
307+ <starts-with>
308+ <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
309+ </starts-with>
310+ <ends-with>
311+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
312+ </ends-with>
313+ <subscopes>
314+ <include syntax="self" collection="case-match" />
227315 <include syntax="self" collection="expressions" />
228316 </subscopes>
229317 </scope>
230318 </collection>
231319
320+ <collection name="outer-case-expression">
321+ <scope name="outer-case-expression">
322+ <starts-with>
323+ <expression>(?=case)</expression>
324+ </starts-with>
325+ <ends-with />
326+ <subscopes anchored="true" skip-whitespace="false">
327+ <include syntax="self" collection="case-expression" />
328+ <include syntax="self" collection="inner-case-expressions" repeat="true" />
329+ </subscopes>
330+ </scope>
331+ </collection>
332+
232333 <collection name="tuple">
233334 <symbol type="expression" />
234335 <scope name="haskell.tuple">
@@ -241,73 +342,60 @@
241342 <capture number="1" name="haskell.tuple.bracket" />
242343 </ends-with>
243344 <subscopes>
244− <include syntax="self" collection="comments" />
245345 <include syntax="self" collection="expressions" />
246346 </subscopes>
247347 </scope>
248348 </collection>
249349
250350 <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>
351+ <symbol type="interface" />
352+ <scope name="haskell.definition.class">
255353 <starts-with>
256354 <expression>^(\h*)(class)($|\h)</expression>
257355 <capture number="2" name="haskell.keyword.construct.class" />
258356 </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">
357+ <ends-with>
358+ <template>^(?!\s+\1\S)(?!\s*$)</template>
359+ </ends-with>
360+ <subscopes>
361+ <scope name="haskell.keyword.construct.where">
274362 <expression>where</expression>
275363 </scope>
364+ <include syntax="self" collection="type" />
365+ <include syntax="self" collection="type-definition" />
366+ <!-- <include syntax="self" collection="type-annotation" /> -->
367+ <include syntax="self" collection="definition" />
276368 </subscopes>
277369 </scope>
278370 </collection>
279371
280372 <collection name="instance">
281373 <scope name="haskell.instance">
282− <symbol type="category" name-selector="haskell.keyword.construct.instance.name">
283− <context behavior="whitespace" foldable="true" />
284− </symbol>
374+ <symbol type="category" />
285375 <starts-with>
286376 <expression>^(\h*)(instance)($|\h)</expression>
287377 <capture number="2" name="haskell.keyword.construct.instance" />
288378 </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">
379+ <ends-with>
380+ <template>^(?!\s+\1\S)(?!\s*$)</template>
381+ </ends-with>
382+ <subscopes>
383+ <scope name="haskell.keyword.construct.where">
303384 <expression>where</expression>
304385 </scope>
386+ <include syntax="self" collection="type" />
387+ <include syntax="self" collection="type-definition" />
388+ <include syntax="self" collection="type-annotation" />
389+ <include syntax="self" collection="definition" />
305390 </subscopes>
306391 </scope>
307392 </collection>
308393
309394 <collection name="type-family-definition">
310395 <scope name="haskell.definition.type-family.type">
396+ <symbol type="type">
397+ <context behavior="subtree" foldable="false" />
398+ </symbol>
311399 <starts-with>
312400 <expression>^(\h*)(type\h+family)</expression>
313401 <capture number="2" name="haskell.keyword.construct.type-family" />
@@ -346,7 +434,6 @@
346434 <template>^(?!\s+\1\S)(?!\s*$)</template>
347435 </ends-with>
348436 <subscopes>
349− <include syntax="self" collection="comments" />
350437 <include syntax="self" collection="type" optional="true" repeat="true" />
351438 <scope>
352439 <expression>=</expression>
@@ -359,26 +446,65 @@
359446 <collection name="definition">
360447 <scope name="haskell.definition.type.function">
361448 <symbol type="function">
362− <context behavior="whitespace" foldable="true" />
449+ <display-name>
450+ <component selector="haskell.definition.type.function" />
451+ </display-name>
452+
363453 </symbol>
364454 <starts-with>
365455 <expression>^(?=(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h))</expression>
366456 <capture number="2" name="haskell.keyword.construct.default" />
367− <capture number="3" name="haskell.identifier.function.name" />
457+ <capture number="3" name="haskell.identifier.function" />
368458 </starts-with>
369459 <ends-with>
370460 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
371461 </ends-with>
372462 <subscopes>
373− <include syntax="self" collection="comments" />
374463 <include syntax="self" collection="type-annotation" />
375464 <include syntax="self" collection="implementation" />
376465 </subscopes>
377466 </scope>
378467 </collection>
379468
469+ <collection name="do-bind">
470+ <scope name="do-bind">
471+ <starts-with>
472+ <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
473+ </starts-with>
474+ <ends-with>
475+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
476+ </ends-with>
477+ <subscopes>
478+ <include syntax="self" collection="do-pattern" />
479+ <include syntax="self" collection="expressions" />
480+ <!-- <scope name="bind-arrow">
481+ <expression>&lt;-</expression>
482+ </scope> -->
483+ </subscopes>
484+ </scope>
485+ </collection>
486+
487+ <collection name="do-pattern">
488+ <scope name="do-pattern">
489+ <starts-with>
490+ <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
491+ </starts-with>
492+ <ends-with>
493+ <expression>&lt;-</expression>
494+ </ends-with>
495+ <subscopes>
496+ <include syntax="self" collection="pattern-match" />
497+ <!-- <scope name="bind-arrow">
498+ <expression>&lt;-</expression>
499+ </scope>
500+ <include syntax="self" collection="expressions" repeat="true" /> -->
501+ </subscopes>
502+ </scope>
503+ </collection>
504+
380505 <collection name="implementation">
381− <scope name="haskell.definition.type.function.implementation">
506+ <scope name="haskell.definition.type.function">
507+ <local scope="within-construct" />
382508 <starts-with>
383509 <expression>^(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h)</expression>
384510 <capture number="2" name="haskell.keyword.construct.default" />
@@ -388,20 +514,14 @@
388514 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
389515 </ends-with>
390516 <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" />
517+ <include syntax="self" collection="where-clause" />
518+ <include syntax="self" collection="expressions" />
399519 </subscopes>
400520 </scope>
401521 </collection>
402522
403523 <collection name="type-annotation">
404− <scope name="haskell.definition.type.function.type-signature">
524+ <scope name="haskell.definition.type.function">
405525 <starts-with>
406526 <expression>^(\h*)`?(\w(\w|')*)`?\h*::($|\h)</expression>
407527 <capture number="2" name="haskell.identifier.function" />
@@ -410,7 +530,6 @@
410530 <template>^(?!\s+\1\S)(?!\s*$)</template>
411531 </ends-with>
412532 <subscopes>
413− <include syntax="self" collection="comments" />
414533 <include syntax="self" collection="type" />
415534 </subscopes>
416535 </scope>
@@ -418,19 +537,15 @@
418537
419538 <collection name="type-definition">
420539 <scope name="haskell.definition.type">
421− <symbol type="type" scope="global">
422− <context behavior="whitespace" foldable="true" />
423− </symbol>
424540 <starts-with>
425541 <expression>^(\h*)(type)\h+(\w(\w|')*)</expression>
426542 <capture number="2" name="haskell.keyword.construct.type" />
427− <capture number="3" name="haskell.identifier.type.name" />
543+ <capture number="3" name="haskell.identifier.type" />
428544 </starts-with>
429545 <ends-with>
430546 <template>^(?!\s+\1\S)(?!\s*$)</template>
431547 </ends-with>
432548 <subscopes>
433− <include syntax="self" collection="comments" />
434549 <include syntax="self" collection="type" />
435550 </subscopes>
436551 </scope>
@@ -438,7 +553,7 @@
438553
439554 <collection name="GADT-definition">
440555 <scope name="haskell.definition.struct.GADT">
441− <symbol type="struct" scope="global">
556+ <symbol type="struct">
442557 <context behavior="subtree" foldable="false" />
443558 </symbol>
444559 <starts-with>
@@ -450,7 +565,6 @@
450565 <template>^(?!\s+\1\S)(?!\s*$)</template>
451566 </ends-with>
452567 <subscopes>
453− <include syntax="self" collection="comments" />
454568 <scope name="haskell.keyword.construct.where">
455569 <expression>where</expression>
456570 </scope>
@@ -466,26 +580,21 @@
466580 <collection name="gadt-constructor">
467581 <scope name="haskell.identifier.type.struct.data.constructor">
468582 <symbol type="constructor">
469− <context behavior="subtree" foldable="true" />
583+ <context behavior="whitespace" />
470584 </symbol>
471− <starts-with>
472− <expression>(^|=|\||^)\h+([A-Z](\w|')*)</expression>
473− <capture number="2" name="haskell.identifier.data.name" />
474− </starts-with>
475− <ends-with />
476− <subscopes anchored="true">
477− <include syntax="self" collection="record-definition" />
478− </subscopes>
585+ <expression>(^|=|\|)\h+([A-Z](\w|')*)</expression>
586+ <capture number="2" name="haskell.identifier.data.name" />
587+ </scope>
588+ <scope name="identifier.type.struct.GADT.constructor">
589+ <symbol type="constructor"></symbol>
590+ <expression>^\h+([A-Z](\w|')*)</expression>
591+ <capture number="1" name="haskell.identifier.data.name" />
479592 </scope>
480593 </collection>
481594
482595 <collection name="deriving-clause">
483596 <scope name="haskell.record.construct.deriving.keyword">
484− <expression>deriving(\h+(newtype|stock|anyclass))?</expression>
485− </scope>
486− <scope name="haskell.record.construct.deriving.keyword">
487− <include syntax="self" collection="comments" />
488− <expression>via</expression>
597+ <expression>deriving\h+(newtype|stock|anyclass)</expression>
489598 </scope>
490599 </collection>
491600
@@ -503,7 +612,6 @@
503612 <capture number="1" name="haskell.record.bracket" />
504613 </ends-with>
505614 <subscopes>
506− <include syntax="self" collection="comments" />
507615 <include syntax="self" collection="record-definition-field-name" />
508616 <include syntax="self" collection="type" />
509617 </subscopes>
@@ -520,13 +628,6 @@
520628 </collection>
521629
522630 <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" />
530631 <scope name="haskell.type.construct.tuple">
531632 <starts-with>
532633 <expression>\(</expression>
@@ -535,7 +636,6 @@
535636 <expression>\)</expression>
536637 </ends-with>
537638 <subscopes>
538− <include syntax="self" collection="comments" />
539639 <scope name="haskell.construct.type.typle.comma">
540640 <expression>\,</expression>
541641 </scope>
@@ -550,7 +650,6 @@
550650 <expression>\]</expression>
551651 </ends-with>
552652 <subscopes>
553− <include syntax="self" collection="comments" />
554653 <include syntax="self" collection="type" />
555654 </subscopes>
556655 </scope>
@@ -562,7 +661,7 @@
562661 </scope>
563662 <include syntax="self" collection="type-list" />
564663 <scope>
565− <expression>(([A-Z](\w|')*\.)*)'*\!?([A-Z](\w|')*)</expression>
664+ <expression>(([A-Z](\w|')*\.)*)'*([A-Z](\w|')*)</expression>
566665 <capture number="1" name="haskell.identifier.package.module" />
567666 <capture number="4" name="haskell.identifier.type" />
568667 </scope>
@@ -570,7 +669,13 @@
570669 <expression>forall</expression>
571670 </scope>
572671 <scope name="haskell.identifier.type.variable">
573− <expression>(?!where)(?!=)((?!(\(|\)|\,|\!))\S)((?!(\(|\)|\,))\w)*</expression>
672+ <expression>(?!=)((?!(\(|\)|\,))\S)((?!(\(|\)|\,))\S)*</expression>
673+ </scope>
674+ <scope name="haskell.keyword.construct.function-arrow">
675+ <expression>-&gt;</expression>
676+ </scope>
677+ <scope name="haskell.keyword.construct.fat-arrow">
678+ <expression>=&gt;</expression>
574679 </scope>
575680 </collection>
576681
@@ -585,7 +690,6 @@
585690 <template>^(?!\s+\1\S)(?!\s*$)</template>
586691 </ends-with>
587692 <subscopes>
588− <include syntax="self" collection="comments" />
589693 <scope name="haskell.keyword.construct.where">
590694 <expression>where</expression>
591695 </scope>
@@ -605,7 +709,6 @@
605709 <capture number="1" name="haskell.type-list.bracket" />
606710 </ends-with>
607711 <subscopes>
608− <include syntax="self" collection="comments" />
609712 <include syntax="self" collection="type" />
610713 </subscopes>
611714 </scope>
@@ -622,7 +725,6 @@
622725 <capture number="1" name="haskell.keyword.construct.lambda" />
623726 </ends-with>
624727 <subscopes>
625− <include syntax="self" collection="comments" />
626728 <include syntax="self" collection="pattern-match" />
627729 </subscopes>
628730 </scope>
@@ -636,6 +738,7 @@
636738
637739 <collection name="where-clause">
638740 <scope name="haskell.construct.where">
741+ <local scope="within-parent" />
639742 <starts-with>
640743 <expression>^(\h*)(where)</expression>
641744 <capture number="2" name="haskell.construct.keyword.where" />
@@ -644,7 +747,6 @@
644747 <template>^(?!\1\s*\S)(?!s*$)</template>
645748 </ends-with>
646749 <subscopes>
647− <include syntax="self" collection="comments" />
648750 <include syntax="self" collection="definition" />
649751 </subscopes>
650752 </scope>
@@ -684,12 +786,12 @@
684786
685787
686788 <collection name="strings">
687− <scope name="haskell.string.double-quoted" spell-check="true">
789+ <scope name="haskell.string.double-quoted">
688790 <starts-with>
689− <expression>&quot;</expression>
791+ <expression>"</expression>
690792 </starts-with>
691793 <ends-with>
692− <expression>&quot;</expression>
794+ <expression>"</expression>
693795 </ends-with>
694796 <subscopes>
695797 <scope name="haskell.string.escape-sequences">
@@ -726,7 +828,6 @@
726828 </ends-with>
727829 <subscopes>
728830 <scope name="identifier.haskell.type">
729− <symbol type="expression" />
730831 <symbol type="expression" />
731832 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
732833 <capture number="1" name="identifier.type" />
@@ -751,7 +852,6 @@
751852 </ends-with>
752853 <subscopes>
753854 <scope name="haskell.construct.qualified">
754− <symbol type="expression" />
755855 <expression>qualified</expression>
756856 <capture number="0" name="haskell.construct.keyword.qualified" />
757857 </scope>
@@ -769,7 +869,6 @@
769869 </ends-with>
770870 <subscopes anchored="true">
771871 <include syntax="self" collection="import-list" />
772− <symbol type="expression" />
773872 </subscopes>
774873 </scope>
775874
@@ -803,7 +902,6 @@
803902 </ends-with>
804903 <subscopes>
805904 <scope name="haskell.identifier.struct">
806− <symbol type="expression" />
807905 <symbol type="reference" scope="local" />
808906 <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
809907 <capture number="1" name="haskell.import-list.identifier.type.name" />
@@ -817,6 +915,13 @@
817915 </scope>
818916 </collection>
819917
918+ <!-- <collection name="special">
919+ <scope>
920+ <expression>(;|,)</expression>
921+ </scope>
922+ </collection> -->
923+
924+
820925 <collection name="reservedop">
821926 <scope name="keyword.operator">
822927 <expression>(\.\.|:|::|=|\\|\||&lt;-|-&gt;|@|~|=>)</expression>
@@ -824,11 +929,10 @@
824929 </collection>
825930
826931 <collection name="keywords">
827− <scope name="haskell.keyword.self">
932+ <scope name="haskell.keyword.modifier">
828933 <symbol type="keyword" />
829934 <strings>
830935 <string>do</string>
831− <string>mdo</string>
832936 <string>in</string>
833937 <string>infix</string>
834938 <string>infixl</string>
@@ -866,18 +970,1016 @@
866970 <strings>
867971 <string>undefined</string>
868972 <string>_</string>
869− <string>@</string>
870973 </strings>
871974 </scope>
872975 </collection>
873976
874977 <collection name="comments">
875978 <scope name="haskell.comment.single" spell-check="true">
876− <symbol type="comment" />
877− <expression> --.*$</expression>
979+ <starts-with>
980+ <expression>--</expression>
981+ </starts-with>
982+ <ends-with>
983+ <expression>$</expression>
984+ </ends-with>
985+ </scope>
986+ <scope name="haskell.comment.block" spell-check="true">
987+ <starts-with>
988+ <expression>{-</expression>
989+ </starts-with>
990+ <ends-with>
991+ <expression>-}</expression>
992+ </ends-with>
993+ </scope>
994+ </collection>
995+
996+
997+ </collections>
998+</syntax><?xml version="1.0" encoding="UTF-8"?>
999+<syntax name="haskell">
1000+ <meta>
1001+ <name>Haskell</name>
1002+ <type>compiled</type>
1003+ <preferred-file-extension>hs</preferred-file-extension>
1004+ </meta>
1005+
1006+ <detectors>
1007+ <extension priority="1.0">hs</extension>
1008+ </detectors>
1009+
1010+ <comments>
1011+ <single>
1012+ <expression>--</expression>
1013+ </single>
1014+ <multiline>
1015+ <starts-with>
1016+ <expression>{-</expression>
1017+ </starts-with>
1018+ <ends-with>
1019+ <expression>-}</expression>
1020+ </ends-with>
1021+ </multiline>
1022+ </comments>
1023+
1024+ <brackets>
1025+ <pair open="{" close="}" />
1026+ <pair open="[" close="]" />
1027+ <pair open="(" close=")" />
1028+ </brackets>
1029+
1030+ <surrounding-pairs>
1031+ <pair open="[" close="]" />
1032+ <pair open="(" close=")" />
1033+ <pair open="&apos;" close="&apos;" />
1034+ <pair open="&quot;" close="&quot;" />
1035+ <pair open="`" close="`" />
1036+ </surrounding-pairs>
1037+
1038+ <indentation>
1039+ <increase>
1040+ <expression>
1041+ (case|class|do|let|where|=).*
1042+ </expression>
1043+ </increase>
1044+ <decrease>
1045+ <expression>^\\s*(end|done|with|in|else)\\b|^\\s*;;</expression>
1046+ </decrease>
1047+ </indentation>
1048+
1049+
1050+ <scopes>
1051+ <include syntax="self" collection="comments" />
1052+ <include syntax="self" collection="module" />
1053+ <include syntax="self" collection="import" />
1054+ <include syntax="self" collection="type-family-definition" />
1055+ <include syntax="self" collection="pattern-definition" />
1056+ <include syntax="self" collection="type-definition" />
1057+ <!-- <include syntax="self" collection="type-annotation" /> -->
1058+ <include syntax="self" collection="GADT-definition" />
1059+ <include syntax="self" collection="instance" />
1060+ <include syntax="self" collection="typeclass" />
1061+ <include syntax="self" collection="definition" />
1062+ </scopes>
1063+
1064+ <template-scopes>
1065+ <include syntax="self" collection="Quote" />
1066+ <include syntax="self" collection="comments" />
1067+ </template-scopes>
1068+
1069+ <collections>
1070+
1071+
1072+ <collection name="operators">
1073+ <scope name="keyword.modifier">
1074+ <expression>(!|#|\$|%|&amp;|⋆|\+|\.|/|&lt;|=|&gt;|\?|@|\\|\^|\||-|~|:)+</expression>
1075+ </scope>
1076+ </collection>
1077+
1078+ <collection name="expressions">
1079+ <include syntax="self" collection="do-bind" />
1080+ <include syntax="self" collection="literal" />
1081+ <include syntax="self" collection="operators" />
1082+ <include syntax="self" collection="list" />
1083+ <include syntax="self" collection="lambda-case" />
1084+ <include syntax="self" collection="lambda-head" />
1085+ <include syntax="self" collection="type-applications" />
1086+ <include syntax="self" collection="outer-case-expression" />
1087+ <include syntax="self" collection="qvarid" />
1088+ <include syntax="self" collection="tuple" />
1089+
1090+
1091+ <!-- Needed for do binds -->
1092+ <!-- <include syntax="self" collection="pattern-match" /> -->
1093+ </collection>
1094+
1095+ <collection name="pattern-match">
1096+ <include syntax="self" collection="literal" />
1097+ <include syntax="self" collection="tuple-match" />
1098+ <!-- <include syntax="self" collection="at-pattern" /> -->
1099+ <include syntax="self" collection="varid" />
1100+ <include syntax="self" collection="qconid" />
1101+ <include syntax="self" collection="record-match" />
1102+ <include syntax="self" collection="list-pattern" />
1103+ <include syntax="self" collection="view-pattern" />
1104+ </collection>
1105+
1106+ <collection name="type-applications">
1107+ <scope name="type-applications">
1108+ <starts-with>
1109+ <expression>(\s@)\(</expression>
1110+ <capture number="1" name="haskell.keyword.operator.typeapplication" />
1111+ </starts-with>
1112+ <ends-with>
1113+ <expression>)</expression>
1114+ </ends-with>
1115+ <subscopes>
1116+ <include syntax="self" collection="type" />
1117+ </subscopes>
1118+ </scope>
1119+ <scope name="type-applications-single">
1120+ <expression>(@)(\w+)</expression>
1121+ <capture number="1" name="haskell.keyword.operator.typeapplication" />
1122+ <capture number="2" name="haskell.identifier.type" />
1123+ </scope>
1124+ </collection>
1125+
1126+ <collection name="Quote">
1127+ <scope name="haskell.quasiquote.string-template">
1128+ <starts-with>
1129+ <expression>\[((?:\w|')+)\|</expression>
1130+ <capture number="1" name="haskell.identifier.constant" />
1131+ </starts-with>
1132+ <ends-with>
1133+ <expression>\|\]</expression>
1134+ </ends-with>
1135+ <subscopes>
1136+ <scope name="haskell.quasiquote.string-template.value">
1137+ <expression>.+?</expression>
1138+ </scope>
1139+ </subscopes>
1140+ </scope>
1141+ </collection>
1142+
1143+ <collection name="record-match">
1144+ <include syntax="self" collection="qconid" />
1145+ <include syntax="self" collection="record-fields-match" />
1146+ <include syntax="self" collection="record-fields-match-all" />
1147+ </collection>
1148+
1149+
1150+ <collection name="record-fields-match">
1151+ <scope name="record-fields-match">
1152+ <symbol type="expression" />
1153+ <starts-with>
1154+ <expression>(\{)</expression>
1155+ <capture number="1" name="haskell.pattern.record.bracket" />
1156+ </starts-with>
1157+ <ends-with>
1158+ <expression>(\})</expression>
1159+ <capture number="1" name="haskell.pattern.record.bracket" />
1160+ </ends-with>
1161+ <subscopes>
1162+ <include syntax="self" collection="pattern-match" />
1163+ <include syntax="self" collection="varid" />
1164+ <scope name="record-sep">
1165+ <expression>=</expression>
1166+ </scope>
1167+ <scope name="record-sep">
1168+ <expression>,</expression>
1169+ </scope>
1170+ </subscopes>
1171+ </scope>
1172+ </collection>
1173+
1174+ <collection name="record-fields-match-wildcard">
1175+ <scope name="record-fields-match-all">
1176+ <starts-with>
1177+ <expression>(\{)</expression>
1178+ <capture number="1" name="haskell.pattern.record.bracket" />
1179+ </starts-with>
1180+ <ends-with>
1181+ <expression>(\})</expression>
1182+ <capture number="1" name="haskell.pattern.record.bracket" />
1183+ </ends-with>
1184+ <subscopes>
1185+ <scope name="haskell.pattern.record.wildcard">
1186+ <expression>\.\.</expression>
1187+ </scope>
1188+ </subscopes>
1189+ </scope>
1190+ </collection>
1191+
1192+ <collection name="bind-arrow">
1193+ <scope name="haskell.operator.bind-arrow">
1194+ <expression>&lt;-</expression>
1195+ </scope>
1196+ </collection>
1197+
1198+
1199+ <collection name="list">
1200+ <symbol type="expression" />
1201+ <scope name="haskell.list">
1202+ <starts-with>
1203+ <expression>(\[)</expression>
1204+ <capture number="1" name="haskell.list.bracket" />
1205+ </starts-with>
1206+ <ends-with>
1207+ <expression>(\])</expression>
1208+ <capture number="1" name="haskell.list.bracket" />
1209+ </ends-with>
1210+ <subscopes>
1211+ <include syntax="self" collection="expressions" />
1212+ </subscopes>
1213+ </scope>
1214+ </collection>
1215+
1216+ <collection name="list-pattern">
1217+ <symbol type="expression" />
1218+ <scope name="haskell.pattern.list">
1219+ <starts-with>
1220+ <expression>(\[)</expression>
1221+ <capture number="1" name="haskell.pattern.list.bracket" />
1222+ </starts-with>
1223+ <ends-with>
1224+ <expression>(\])</expression>
1225+ <capture number="1" name="haskell.pattern.list.bracket" />
1226+ </ends-with>
1227+ <subscopes>
1228+ <include syntax="self" collection="pattern-match" />
1229+ </subscopes>
1230+ </scope>
1231+ </collection>
1232+
1233+
1234+ <collection name="view-pattern">
1235+ <scope name="haskell.pattern.view">
1236+ <symbol type="expression" />
1237+ <starts-with>
1238+ <expression>(\()</expression>
1239+ <capture number="1" name="haskell.pattern.view.bracket" />
1240+ </starts-with>
1241+ <ends-with>
1242+ <expression>(\))</expression>
1243+ <capture number="1" name="haskell.pattern.view.bracket" />
1244+ </ends-with>
1245+ <subscopes anchored="true">
1246+ <include syntax="self" collection="expressions" />
1247+ <scope name="haskell.pattern.view.operator.arrow">
1248+ <expression>-&gt;</expression>
1249+ </scope>
1250+ <include syntax="self" collection="pattern-match" />
1251+ </subscopes>
1252+ </scope>
1253+ </collection>
1254+
1255+ <collection name="tuple-match">
1256+ <symbol type="expression" />
1257+ <scope name="haskell.pattern.tuple">
1258+ <starts-with>
1259+ <expression>(\()</expression>
1260+ <capture number="1" name="haskell.pattern.tuple.bracket" />
1261+ </starts-with>
1262+ <ends-with>
1263+ <expression>(\))</expression>
1264+ <capture number="1" name="haskell.pattern.tuple.bracket" />
1265+ </ends-with>
1266+ <subscopes>
1267+ <include syntax="self" collection="pattern-match" />
1268+ </subscopes>
1269+ </scope>
1270+ </collection>
1271+
1272+ <collection name="case-expression">
1273+ <scope name="haskell.case">
1274+ <starts-with>
1275+ <expression>(case)</expression>
1276+ <capture number="1" name="haskell.case.keyword.condition" />
1277+ </starts-with>
1278+ <ends-with>
1279+ <expression>(of)</expression>
1280+ <capture number="1" name="haskell.case.keyword.condition" />
1281+ </ends-with>
1282+ <subscopes anchored="true">
1283+ <include syntax="self" collection="pattern-match" />
1284+ </subscopes>
1285+ </scope>
1286+ </collection>
1287+
1288+ <collection name="case-match">
1289+ <scope name="case-match">
1290+ <starts-with>
1291+ <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
1292+ </starts-with>
1293+ <ends-with>
1294+ <expression>-&gt;</expression>
1295+ </ends-with>
1296+ <subscopes anchored="true">
1297+ <include syntax="self" collection="pattern-match" />
1298+ </subscopes>
1299+ </scope>
1300+ </collection>
1301+
1302+ <collection name="inner-case-expressions">
1303+ <scope name="inner-case-expressions">
1304+ <starts-with>
1305+ <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
1306+ </starts-with>
1307+ <ends-with>
1308+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
1309+ </ends-with>
1310+ <subscopes>
1311+ <include syntax="self" collection="case-match" />
1312+ <include syntax="self" collection="expressions" />
1313+ </subscopes>
1314+ </scope>
1315+ </collection>
1316+
1317+ <collection name="outer-case-expression">
1318+ <scope name="outer-case-expression">
1319+ <starts-with>
1320+ <expression>(?=case)</expression>
1321+ </starts-with>
1322+ <ends-with />
1323+ <subscopes anchored="true" skip-whitespace="false">
1324+ <include syntax="self" collection="case-expression" />
1325+ <include syntax="self" collection="inner-case-expressions" repeat="true" />
1326+ </subscopes>
1327+ </scope>
1328+ </collection>
1329+
1330+ <collection name="tuple">
1331+ <symbol type="expression" />
1332+ <scope name="haskell.tuple">
1333+ <starts-with>
1334+ <expression>(\()</expression>
1335+ <capture number="1" name="haskell.tuple.bracket" />
1336+ </starts-with>
1337+ <ends-with>
1338+ <expression>(\))</expression>
1339+ <capture number="1" name="haskell.tuple.bracket" />
1340+ </ends-with>
1341+ <subscopes>
1342+ <include syntax="self" collection="expressions" />
1343+ </subscopes>
1344+ </scope>
1345+ </collection>
1346+
1347+ <collection name="typeclass">
1348+ <symbol type="interface" />
1349+ <scope name="haskell.definition.class">
1350+ <starts-with>
1351+ <expression>^(\h*)(class)($|\h)</expression>
1352+ <capture number="2" name="haskell.keyword.construct.class" />
1353+ </starts-with>
1354+ <ends-with>
1355+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1356+ </ends-with>
1357+ <subscopes>
1358+ <scope name="haskell.keyword.construct.where">
1359+ <expression>where</expression>
1360+ </scope>
1361+ <include syntax="self" collection="type" />
1362+ <include syntax="self" collection="type-definition" />
1363+ <!-- <include syntax="self" collection="type-annotation" /> -->
1364+ <include syntax="self" collection="definition" />
1365+ </subscopes>
1366+ </scope>
1367+ </collection>
1368+
1369+ <collection name="instance">
1370+ <scope name="haskell.instance">
1371+ <symbol type="category" />
1372+ <starts-with>
1373+ <expression>^(\h*)(instance)($|\h)</expression>
1374+ <capture number="2" name="haskell.keyword.construct.instance" />
1375+ </starts-with>
1376+ <ends-with>
1377+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1378+ </ends-with>
1379+ <subscopes>
1380+ <scope name="haskell.keyword.construct.where">
1381+ <expression>where</expression>
1382+ </scope>
1383+ <include syntax="self" collection="type" />
1384+ <include syntax="self" collection="type-definition" />
1385+ <include syntax="self" collection="type-annotation" />
1386+ <include syntax="self" collection="definition" />
1387+ </subscopes>
1388+ </scope>
1389+ </collection>
1390+
1391+ <collection name="type-family-definition">
1392+ <scope name="haskell.definition.type-family.type">
1393+ <symbol type="type">
1394+ <context behavior="subtree" foldable="false" />
1395+ </symbol>
1396+ <starts-with>
1397+ <expression>^(\h*)(type\h+family)</expression>
1398+ <capture number="2" name="haskell.keyword.construct.type-family" />
1399+ </starts-with>
1400+ <ends-with>
1401+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1402+ </ends-with>
1403+ <subscopes anchored="true" skip-whitespace="false">
1404+ <scope name="haskell.type-family.head">
1405+ <starts-with>
1406+ <expression></expression>
1407+ </starts-with>
1408+ <ends-with>
1409+ <expression>where</expression>
1410+ <capture number="0" name="haskell.keyword.construct.where" />
1411+ </ends-with>
1412+ <subscopes anchored="true">
1413+ <scope name="haskell.identifier.type-family.type.name">
1414+ <expression>\S+</expression>
1415+ </scope>
1416+ <include syntax="self" collection="type" repeat="true" optional="true" />
1417+ </subscopes>
1418+ </scope>
1419+
1420+ <include syntax="self" collection="type-family-case-definition" optional="true" repeat="true" />
1421+ </subscopes>
1422+ </scope>
1423+ </collection>
1424+
1425+ <collection name="type-family-case-definition">
1426+ <scope name="haskell.definition.type-family.type.case">
1427+ <starts-with>
1428+ <expression>^(\h*)(?=\S)</expression>
1429+ </starts-with>
1430+ <ends-with>
1431+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1432+ </ends-with>
1433+ <subscopes>
1434+ <include syntax="self" collection="type" optional="true" repeat="true" />
1435+ <scope>
1436+ <expression>=</expression>
1437+ </scope>
1438+ <include syntax="self" collection="type" optional="true" repeat="true" />
1439+ </subscopes>
1440+ </scope>
1441+ </collection>
1442+
1443+ <collection name="definition">
1444+ <scope name="haskell.definition.type.function">
1445+ <symbol type="function">
1446+ <display-name>
1447+ <component selector="haskell.definition.type.function" />
1448+ </display-name>
1449+
1450+ </symbol>
1451+ <starts-with>
1452+ <expression>^(?=(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h))</expression>
1453+ <capture number="2" name="haskell.keyword.construct.default" />
1454+ <capture number="3" name="haskell.identifier.function" />
1455+ </starts-with>
1456+ <ends-with>
1457+ <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
1458+ </ends-with>
1459+ <subscopes>
1460+ <include syntax="self" collection="type-annotation" />
1461+ <include syntax="self" collection="implementation" />
1462+ </subscopes>
1463+ </scope>
1464+ </collection>
1465+
1466+ <collection name="do-bind">
1467+ <scope name="do-bind">
1468+ <starts-with>
1469+ <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
1470+ </starts-with>
1471+ <ends-with>
1472+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
1473+ </ends-with>
1474+ <subscopes>
1475+ <include syntax="self" collection="do-pattern" />
1476+ <include syntax="self" collection="expressions" />
1477+ <!-- <scope name="bind-arrow">
1478+ <expression>&lt;-</expression>
1479+ </scope> -->
1480+ </subscopes>
1481+ </scope>
1482+ </collection>
1483+
1484+ <collection name="do-pattern">
1485+ <scope name="do-pattern">
1486+ <starts-with>
1487+ <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
1488+ </starts-with>
1489+ <ends-with>
1490+ <expression>&lt;-</expression>
1491+ </ends-with>
1492+ <subscopes>
1493+ <include syntax="self" collection="pattern-match" />
1494+ <!-- <scope name="bind-arrow">
1495+ <expression>&lt;-</expression>
1496+ </scope>
1497+ <include syntax="self" collection="expressions" repeat="true" /> -->
1498+ </subscopes>
1499+ </scope>
1500+ </collection>
1501+
1502+ <collection name="implementation">
1503+ <scope name="haskell.definition.type.function">
1504+ <local scope="within-construct" />
1505+ <starts-with>
1506+ <expression>^(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h)</expression>
1507+ <capture number="2" name="haskell.keyword.construct.default" />
1508+ <capture number="3" name="haskell.identifier.function" />
1509+ </starts-with>
1510+ <ends-with>
1511+ <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
1512+ </ends-with>
1513+ <subscopes>
1514+ <include syntax="self" collection="where-clause" />
1515+ <include syntax="self" collection="expressions" />
1516+ </subscopes>
1517+ </scope>
1518+ </collection>
1519+
1520+ <collection name="type-annotation">
1521+ <scope name="haskell.definition.type.function">
1522+ <starts-with>
1523+ <expression>^(\h*)`?(\w(\w|')*)`?\h*::($|\h)</expression>
1524+ <capture number="2" name="haskell.identifier.function" />
1525+ </starts-with>
1526+ <ends-with>
1527+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1528+ </ends-with>
1529+ <subscopes>
1530+ <include syntax="self" collection="type" />
1531+ </subscopes>
1532+ </scope>
1533+ </collection>
1534+
1535+ <collection name="type-definition">
1536+ <scope name="haskell.definition.type">
1537+ <starts-with>
1538+ <expression>^(\h*)(type)\h+(\w(\w|')*)</expression>
1539+ <capture number="2" name="haskell.keyword.construct.type" />
1540+ <capture number="3" name="haskell.identifier.type" />
1541+ </starts-with>
1542+ <ends-with>
1543+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1544+ </ends-with>
1545+ <subscopes>
1546+ <include syntax="self" collection="type" />
1547+ </subscopes>
1548+ </scope>
1549+ </collection>
1550+
1551+ <collection name="GADT-definition">
1552+ <scope name="haskell.definition.struct.GADT">
1553+ <symbol type="struct">
1554+ <context behavior="subtree" foldable="false" />
1555+ </symbol>
1556+ <starts-with>
1557+ <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
1558+ <capture number="2" name="haskell.keyword.construct.data.GADT" />
1559+ <capture number="3" name="haskell.identifier.data.type.name" />
1560+ </starts-with>
1561+ <ends-with>
1562+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1563+ </ends-with>
1564+ <subscopes>
1565+ <scope name="haskell.keyword.construct.where">
1566+ <expression>where</expression>
1567+ </scope>
1568+
1569+ <include syntax="self" collection="deriving-clause" />
1570+ <include syntax="self" collection="record-definition" />
1571+ <include syntax="self" collection="gadt-constructor" />
1572+ <include syntax="self" collection="type" />
1573+ </subscopes>
1574+ </scope>
1575+ </collection>
1576+
1577+ <collection name="gadt-constructor">
1578+ <scope name="haskell.identifier.type.struct.data.constructor">
1579+ <symbol type="constructor">
1580+ <context behavior="whitespace" />
1581+ </symbol>
1582+ <expression>(^|=|\|)\h+([A-Z](\w|')*)</expression>
1583+ <capture number="2" name="haskell.identifier.data.name" />
1584+ </scope>
1585+ <scope name="identifier.type.struct.GADT.constructor">
1586+ <symbol type="constructor"></symbol>
1587+ <expression>^\h+([A-Z](\w|')*)</expression>
1588+ <capture number="1" name="haskell.identifier.data.name" />
1589+ </scope>
1590+ </collection>
1591+
1592+ <collection name="deriving-clause">
1593+ <scope name="haskell.record.construct.deriving.keyword">
1594+ <expression>deriving\h+(newtype|stock|anyclass)</expression>
1595+ </scope>
1596+ </collection>
1597+
1598+ <collection name="record-definition">
1599+ <scope name="haskell.record">
1600+ <symbol>
1601+ <context behavior="subtree" foldable="true" />
1602+ </symbol>
1603+ <starts-with>
1604+ <expression>(?=\{)</expression>
1605+ <capture number="0" name="haskell.record.bracket" />
1606+ </starts-with>
1607+ <ends-with>
1608+ <expression>(\})</expression>
1609+ <capture number="1" name="haskell.record.bracket" />
1610+ </ends-with>
1611+ <subscopes>
1612+ <include syntax="self" collection="record-definition-field-name" />
1613+ <include syntax="self" collection="type" />
1614+ </subscopes>
1615+ </scope>
1616+ </collection>
1617+
1618+ <collection name="record-definition-field-name">
1619+ <scope name="haskell.record.definition.property">
1620+ <symbol type="property" />
1621+ <expression>(((?![A-Z])\w(\w|')*)\h*::|(^|\{|,)\h*((?![A-Z])\w(\w|')*))</expression>
1622+ <capture number="5" name="haskell.record.definition.property.field.property.name" />
1623+ <capture number="2" name="haskell.record.definition.property.field.property.name" />
1624+ </scope>
1625+ </collection>
1626+
1627+ <collection name="type">
1628+ <scope name="haskell.type.construct.tuple">
1629+ <starts-with>
1630+ <expression>\(</expression>
1631+ </starts-with>
1632+ <ends-with>
1633+ <expression>\)</expression>
1634+ </ends-with>
1635+ <subscopes>
1636+ <scope name="haskell.construct.type.typle.comma">
1637+ <expression>\,</expression>
1638+ </scope>
1639+ <include syntax="self" collection="type" />
1640+ </subscopes>
1641+ </scope>
1642+ <scope name="haskell.type.list">
1643+ <starts-with>
1644+ <expression>'?\[</expression>
1645+ </starts-with>
1646+ <ends-with>
1647+ <expression>\]</expression>
1648+ </ends-with>
1649+ <subscopes>
1650+ <include syntax="self" collection="type" />
1651+ </subscopes>
1652+ </scope>
1653+ <scope name="haskell.type.star">
1654+ <expression>\*</expression>
1655+ </scope>
1656+ <scope name="haskell.keyword.construct.type-annotation-operator">
1657+ <expression>::</expression>
1658+ </scope>
1659+ <include syntax="self" collection="type-list" />
1660+ <scope>
1661+ <expression>(([A-Z](\w|')*\.)*)'*([A-Z](\w|')*)</expression>
1662+ <capture number="1" name="haskell.identifier.package.module" />
1663+ <capture number="4" name="haskell.identifier.type" />
1664+ </scope>
1665+ <scope name="haskell.keyword.construct.forall">
1666+ <expression>forall</expression>
1667+ </scope>
1668+ <scope name="haskell.identifier.type.variable">
1669+ <expression>(?!=)((?!(\(|\)|\,))\S)((?!(\(|\)|\,))\S)*</expression>
1670+ </scope>
1671+ <scope name="haskell.keyword.construct.function-arrow">
1672+ <expression>-&gt;</expression>
1673+ </scope>
1674+ <scope name="haskell.keyword.construct.fat-arrow">
1675+ <expression>=&gt;</expression>
1676+ </scope>
1677+ </collection>
1678+
1679+ <collection name="pattern-definition">
1680+ <scope name="haskell.pattern">
1681+ <starts-with>
1682+ <expression>^(\h*)(pattern)\h+(\w(\w|')*)</expression>
1683+ <capture number="2" name="haskell.keyword.construct.pattern" />
1684+ <capture number="3" name="haskell.identifier.decorator.pattern" />
1685+ </starts-with>
1686+ <ends-with>
1687+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1688+ </ends-with>
1689+ <subscopes>
1690+ <scope name="haskell.keyword.construct.where">
1691+ <expression>where</expression>
1692+ </scope>
1693+ <include syntax="self" collection="expressions" />
1694+ </subscopes>
1695+ </scope>
1696+ </collection>
1697+
1698+ <collection name="type-list">
1699+ <scope name="haskell.type-list">
1700+ <starts-with>
1701+ <expression>('\[)</expression>
1702+ <capture number="1" name="haskell.type-list.bracket" />
1703+ </starts-with>
1704+ <ends-with>
1705+ <expression>(\])</expression>
1706+ <capture number="1" name="haskell.type-list.bracket" />
1707+ </ends-with>
1708+ <subscopes>
1709+ <include syntax="self" collection="type" />
1710+ </subscopes>
1711+ </scope>
1712+ </collection>
1713+
1714+ <collection name="lambda-head">
1715+ <scope name="haskell.lambda">
1716+ <starts-with>
1717+ <expression>(\\)</expression>
1718+ <capture number="1" name="haskell.keyword.construct.lambda" />
1719+ </starts-with>
1720+ <ends-with>
1721+ <expression>(-&gt;)</expression>
1722+ <capture number="1" name="haskell.keyword.construct.lambda" />
1723+ </ends-with>
1724+ <subscopes>
1725+ <include syntax="self" collection="pattern-match" />
1726+ </subscopes>
1727+ </scope>
1728+ </collection>
1729+
1730+ <collection name="lambda-case">
1731+ <scope name="haskell.keyword.condition.lambda-case">
1732+ <expression>\\case</expression>
1733+ </scope>
1734+ </collection>
1735+
1736+ <collection name="where-clause">
1737+ <scope name="haskell.construct.where">
1738+ <local scope="within-parent" />
1739+ <starts-with>
1740+ <expression>^(\h*)(where)</expression>
1741+ <capture number="2" name="haskell.construct.keyword.where" />
1742+ </starts-with>
1743+ <ends-with>
1744+ <template>^(?!\1\s*\S)(?!s*$)</template>
1745+ </ends-with>
1746+ <subscopes>
1747+ <include syntax="self" collection="definition" />
1748+ </subscopes>
1749+ </scope>
1750+ </collection>
1751+
1752+
1753+ <collection name="qvarid">
1754+ <scope name="haskell.identifier.function">
1755+ <expression>(([A-Z](\w|')*\.)*)(\w(\w|')*)</expression>
1756+ <capture number="1" name="haskell.identifier.package.module" />
1757+ <capture number="4" name="haskell.identifier.type" />
1758+ </scope>
1759+ </collection>
1760+
1761+ <collection name="varid">
1762+ <scope name="haskell.identifier.variable">
1763+ <expression>\w(\w|')*</expression>
1764+ </scope>
1765+ </collection>
1766+
1767+ <collection name="qconid">
1768+ <scope name="haskell.identifier.type.struct.constructor">
1769+ <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
1770+ </scope>
1771+ </collection>
1772+
1773+ <collection name="qconsym">
1774+ <scope name="haskell.identifier.decorator.pattern">
1775+ <expression>([A-Z](\w|')*\.):(\w|')*</expression>
1776+ </scope>
1777+ </collection>
1778+
1779+ <collection name="literal">
1780+ <include syntax="self" collection="number" />
1781+ <include syntax="self" collection="strings" />
1782+ </collection>
1783+
1784+
1785+ <collection name="strings">
1786+ <scope name="haskell.string.double-quoted">
1787+ <starts-with>
1788+ <expression>"</expression>
1789+ </starts-with>
1790+ <ends-with>
1791+ <expression>"</expression>
1792+ </ends-with>
1793+ <subscopes>
1794+ <scope name="haskell.string.escape-sequences">
1795+ <expression>\\.</expression>
1796+ </scope>
1797+ </subscopes>
1798+ </scope>
1799+ <scope name="haskell.string.single-quoted">
1800+ <expression>'([^'\\]|\\.)'</expression>
1801+ </scope>
1802+ </collection>
1803+
1804+
1805+ <collection name="number">
1806+ <scope name="haskell.value.number">
1807+ <expression>(0x|0o|0O|0X)?\d+(\d|_)*(\.[\d|_]+)?((e|E)(\+|-)?\d+)?</expression>
1808+ </scope>
1809+ </collection>
1810+
1811+
1812+ <collection name="module">
1813+ <scope name="haskell.definition.module.package">
1814+ <symbol type="package">
1815+ <context behavior="subtree" foldable="true" export-local="true" />
1816+ </symbol>
1817+ <starts-with>
1818+ <expression>^(module)\s+((\w|\.)+)</expression>
1819+ <capture number="1" name="haskell.construct.keyword.module" />
1820+ <capture number="2" name="haskell.definition.module.package" />
1821+ </starts-with>
1822+ <ends-with>
1823+ <expression>(where)</expression>
1824+ <capture number="1" name="haskell.construct.keyword.module" />
1825+ </ends-with>
1826+ <subscopes>
1827+ <scope name="identifier.haskell.type">
1828+ <symbol type="expression" />
1829+ <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
1830+ <capture number="1" name="identifier.type" />
1831+ </scope>
1832+ <scope name="identifier.variable">
1833+ <symbol type="expression" />
1834+ <expression>(\w|')+</expression>
1835+ <capture number="0" name="identifier.haskell.function" />
1836+ </scope>
1837+ </subscopes>
1838+ </scope>
1839+ </collection>
1840+
1841+ <collection name="import">
1842+ <scope name="haskell.construct.import">
1843+ <starts-with>
1844+ <expression>^(import)\s</expression>
1845+ <capture number="1" name="haskell.construct.keyword.import" />
1846+ </starts-with>
1847+ <ends-with>
1848+ <expression>(?=^\S)</expression>
1849+ </ends-with>
1850+ <subscopes>
1851+ <scope name="haskell.construct.qualified">
1852+ <expression>qualified</expression>
1853+ <capture number="0" name="haskell.construct.keyword.qualified" />
1854+ </scope>
1855+
1856+ <scope name="haskell.construct.hiding">
1857+ <symbol type="keyword">
1858+ <context behavior="subtree" />
1859+ </symbol>
1860+ <starts-with>
1861+ <expression>(hiding)\h*(?=\()</expression>
1862+ <capture number="1" name="haskell.construct.keyword.hiding" />
1863+ </starts-with>
1864+ <ends-with>
1865+ <expression>(?=\))</expression>
1866+ </ends-with>
1867+ <subscopes anchored="true">
1868+ <include syntax="self" collection="import-list" />
1869+ </subscopes>
1870+ </scope>
1871+
1872+ <scope name="haskell.construct.keyword.as">
1873+ <symbol type="package" />
1874+ <expression>as(\h+([A-Z]\w*))?</expression>
1875+ <capture number="2" name="haskell.package.qualified.name" />
1876+ </scope>
1877+ <scope name="haskell.identifier.module.package">
1878+ <symbol type="package" />
1879+ <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
1880+ <capture number="0" name="haskell.package.name" />
1881+ </scope>
1882+ <include syntax="self" collection="import-list" />
1883+ </subscopes>
1884+ </scope>
1885+ </collection>
1886+
1887+ <collection name="import-list">
1888+ <scope name="import-list">
1889+ <symbol>
1890+ <context behavior="subtree" export-local="true" />
1891+ </symbol>
1892+ <starts-with>
1893+ <expression>(\()</expression>
1894+ <capture number="1" name="haskell.import-list.bracket" />
1895+ </starts-with>
1896+ <ends-with>
1897+ <expression>(\))</expression>
1898+ <capture number="1" name="haskell.import-list.bracket" />
1899+ </ends-with>
1900+ <subscopes>
1901+ <scope name="haskell.identifier.struct">
1902+ <symbol type="reference" scope="local" />
1903+ <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
1904+ <capture number="1" name="haskell.import-list.identifier.type.name" />
1905+ </scope>
1906+ <scope name="haskell.identifier.function">
1907+ <symbol type="reference" scope="local" />
1908+ <expression>(\w|')+</expression>
1909+ <capture number="0" name="haskell.import-list.function.name" />
1910+ </scope>
1911+ </subscopes>
1912+ </scope>
1913+ </collection>
1914+
1915+ <!-- <collection name="special">
1916+ <scope>
1917+ <expression>(;|,)</expression>
1918+ </scope>
1919+ </collection> -->
1920+
1921+
1922+ <collection name="reservedop">
1923+ <scope name="keyword.operator">
1924+ <expression>(\.\.|:|::|=|\\|\||&lt;-|-&gt;|@|~|=>)</expression>
1925+ </scope>
1926+ </collection>
1927+
1928+ <collection name="keywords">
1929+ <scope name="haskell.keyword.modifier">
1930+ <symbol type="keyword" />
1931+ <strings>
1932+ <string>do</string>
1933+ <string>in</string>
1934+ <string>infix</string>
1935+ <string>infixl</string>
1936+ <string>infixr</string>
1937+ <string>where</string>
1938+ <string>let</string>
1939+ </strings>
1940+ </scope>
1941+ <scope name="haskell.keyword.condition">
1942+ <symbol type="keyword" />
1943+ <strings>
1944+ <string>of</string>
1945+ <string>case</string>
1946+ <string>else</string>
1947+ <string>if</string>
1948+ <string>then</string>
1949+ </strings>
1950+ </scope>
1951+ <scope name="haskell.keyword.keyword.construct">
1952+ <symbol type="keyword" />
1953+ <strings>
1954+ <string>instance</string>
1955+ <string>module</string>
1956+ <string>type</string>
1957+ <string>class</string>
1958+ <string>data</string>
1959+ <string>default</string>
1960+ <string>deriving</string>
1961+ <string>foreign</string>
1962+ </strings>
1963+ </scope>
1964+ <scope name="haskell.keyword.self">
1965+ <symbol type="keyword" />
1966+ <strings>
1967+ <string>undefined</string>
1968+ <string>_</string>
1969+ </strings>
1970+ </scope>
1971+ </collection>
1972+
1973+ <collection name="comments">
1974+ <scope name="haskell.comment.single" spell-check="true">
1975+ <starts-with>
1976+ <expression>--</expression>
1977+ </starts-with>
1978+ <ends-with>
1979+ <expression>$</expression>
1980+ </ends-with>
8781981 </scope>
8791982 <scope name="haskell.comment.block" spell-check="true">
880− <symbol type="comment" />
8811983 <starts-with>
8821984 <expression>{-</expression>
8831985 </starts-with>
@@ -889,4 +1991,4 @@
8891991
8901992
8911993 </collections>
892−</syntax>
1994+</syntax>
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"