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