firefly-compiler 0.5.35 → 0.5.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.hintrc +4 -4
- package/.vscode/settings.json +4 -4
- package/bin/Release.ff +157 -154
- package/bin/firefly.mjs +1 -1
- package/compiler/Builder.ff +275 -277
- package/compiler/Compiler.ff +234 -233
- package/compiler/Dependencies.ff +186 -187
- package/compiler/DependencyLock.ff +17 -17
- package/compiler/Deriver.ff +23 -31
- package/compiler/Dictionaries.ff +1 -1
- package/compiler/Inference.ff +43 -20
- package/compiler/JsEmitter.ff +1437 -1282
- package/compiler/LspHook.ff +202 -202
- package/compiler/Main.ff +25 -24
- package/compiler/ModuleCache.ff +178 -178
- package/compiler/Parser.ff +36 -109
- package/compiler/Resolver.ff +5 -8
- package/compiler/Substitution.ff +1 -1
- package/compiler/Syntax.ff +1 -16
- package/compiler/Token.ff +9 -0
- package/compiler/Tokenizer.ff +4 -0
- package/compiler/Workspace.ff +88 -88
- package/core/.firefly/include/package.json +5 -5
- package/core/.firefly/package.ff +2 -2
- package/core/Any.ff +26 -30
- package/core/Array.ff +298 -265
- package/core/Atomic.ff +63 -64
- package/core/Box.ff +7 -7
- package/core/BrowserSystem.ff +40 -40
- package/core/Buffer.ff +185 -152
- package/core/BuildSystem.ff +156 -148
- package/core/Channel.ff +95 -92
- package/core/Char.ff +3 -2
- package/core/Core.ff +16 -23
- package/core/Crypto.ff +94 -96
- package/core/Equal.ff +41 -36
- package/core/Error.ff +15 -10
- package/core/FileHandle.ff +45 -37
- package/core/Float.ff +176 -200
- package/core/HttpClient.ff +142 -148
- package/core/Instant.ff +6 -8
- package/core/Int.ff +40 -24
- package/core/IntMap.ff +61 -39
- package/core/Js.ff +305 -0
- package/core/JsSystem.ff +135 -114
- package/core/JsValue.ff +303 -159
- package/core/Json.ff +423 -443
- package/core/List.ff +482 -486
- package/core/Lock.ff +108 -144
- package/core/Log.ff +25 -14
- package/core/NodeSystem.ff +198 -191
- package/core/Ordering.ff +160 -161
- package/core/Path.ff +377 -409
- package/core/Queue.ff +90 -0
- package/core/Random.ff +140 -134
- package/core/RbMap.ff +216 -216
- package/core/Serializable.ff +16 -13
- package/core/Show.ff +44 -43
- package/core/SourceLocation.ff +68 -68
- package/core/Stream.ff +1 -1
- package/core/String.ff +224 -202
- package/core/StringMap.ff +58 -36
- package/core/Task.ff +165 -149
- package/experimental/benchmarks/ListGrab.ff +23 -23
- package/experimental/benchmarks/ListGrab.java +55 -55
- package/experimental/benchmarks/Pyrotek45.ff +30 -30
- package/experimental/benchmarks/Pyrotek45.java +64 -64
- package/experimental/bidirectional/Bidi.ff +88 -88
- package/experimental/lines/Main.ff +40 -0
- package/experimental/random/Index.ff +53 -53
- package/experimental/random/Process.ff +120 -120
- package/experimental/random/RunLength.ff +65 -65
- package/experimental/random/Scrape.ff +51 -51
- package/experimental/random/Symbols.ff +73 -73
- package/experimental/random/Tensor.ff +52 -52
- package/experimental/random/Units.ff +36 -36
- package/experimental/s3/S3TestAuthorizationHeader.ff +39 -39
- package/experimental/s3/S3TestPut.ff +16 -16
- package/experimental/tests/TestJson.ff +26 -26
- package/firefly.sh +0 -0
- package/fireflysite/.firefly/package.ff +4 -4
- package/fireflysite/CommunityOverview.ff +20 -20
- package/fireflysite/CountingButtonDemo.ff +58 -58
- package/fireflysite/DocumentParser.ff +325 -331
- package/fireflysite/ExamplesOverview.ff +40 -40
- package/fireflysite/FrontPage.ff +344 -344
- package/fireflysite/GettingStarted.ff +45 -45
- package/fireflysite/Guide.ff +456 -456
- package/fireflysite/Main.ff +163 -152
- package/fireflysite/MatchingPasswordsDemo.ff +82 -82
- package/fireflysite/PackagesOverview.ff +49 -49
- package/fireflysite/PostgresqlDemo.ff +34 -34
- package/fireflysite/ReferenceAll.ff +18 -18
- package/fireflysite/ReferenceIntroduction.ff +11 -11
- package/fireflysite/Styles.ff +567 -567
- package/fireflysite/Test.ff +121 -62
- package/fireflysite/assets/markdown/reference/BaseTypes.md +209 -209
- package/fireflysite/assets/markdown/reference/EmittedJavascript.md +65 -65
- package/fireflysite/assets/markdown/reference/Exceptions.md +101 -101
- package/fireflysite/assets/markdown/reference/FunctionsAndMethods.md +364 -364
- package/fireflysite/assets/markdown/reference/JavascriptInterop.md +235 -172
- package/fireflysite/assets/markdown/reference/ModulesAndPackages.md +162 -162
- package/fireflysite/assets/markdown/reference/OldStructuredConcurrency.md +48 -48
- package/fireflysite/assets/markdown/reference/PatternMatching.md +224 -224
- package/fireflysite/assets/markdown/reference/StatementsAndExpressions.md +86 -86
- package/fireflysite/assets/markdown/reference/StructuredConcurrency.md +99 -99
- package/fireflysite/assets/markdown/reference/TraitsAndInstances.md +100 -100
- package/fireflysite/assets/markdown/reference/UserDefinedTypes.md +184 -184
- package/fireflysite/assets/markdown/scratch/ControlFlow.md +136 -136
- package/fireflysite/assets/markdown/scratch/Toc.md +40 -40
- package/lsp/.firefly/package.ff +1 -1
- package/lsp/CompletionHandler.ff +827 -827
- package/lsp/Handler.ff +714 -714
- package/lsp/HoverHandler.ff +79 -79
- package/lsp/LanguageServer.ff +272 -272
- package/lsp/SignatureHelpHandler.ff +55 -55
- package/lsp/SymbolHandler.ff +181 -181
- package/lsp/TestReferences.ff +17 -17
- package/lsp/TestReferencesCase.ff +7 -7
- package/lsp/stderr.txt +1 -1
- package/lsp/stdout.txt +34 -34
- package/lux/.firefly/package.ff +1 -1
- package/lux/Css.ff +648 -648
- package/lux/CssTest.ff +48 -48
- package/lux/Lux.ff +608 -617
- package/lux/LuxEvent.ff +79 -116
- package/lux/Main.ff +123 -123
- package/lux/Main2.ff +143 -143
- package/lux/TestDry.ff +28 -28
- package/output/js/ff/compiler/Builder.mjs +72 -71
- package/output/js/ff/compiler/Compiler.mjs +19 -13
- package/output/js/ff/compiler/Dependencies.mjs +8 -7
- package/output/js/ff/compiler/DependencyLock.mjs +6 -4
- package/output/js/ff/compiler/Deriver.mjs +26 -24
- package/output/js/ff/compiler/Dictionaries.mjs +14 -18
- package/output/js/ff/compiler/Environment.mjs +6 -4
- package/output/js/ff/compiler/Inference.mjs +238 -164
- package/output/js/ff/compiler/JsEmitter.mjs +1160 -350
- package/output/js/ff/compiler/JsImporter.mjs +20 -18
- package/output/js/ff/compiler/LspHook.mjs +12 -10
- package/output/js/ff/compiler/Main.mjs +61 -41
- package/output/js/ff/compiler/ModuleCache.mjs +10 -8
- package/output/js/ff/compiler/Parser.mjs +153 -669
- package/output/js/ff/compiler/Patterns.mjs +12 -10
- package/output/js/ff/compiler/Resolver.mjs +52 -78
- package/output/js/ff/compiler/Substitution.mjs +12 -16
- package/output/js/ff/compiler/Syntax.mjs +50 -341
- package/output/js/ff/compiler/Token.mjs +126 -4
- package/output/js/ff/compiler/Tokenizer.mjs +62 -52
- package/output/js/ff/compiler/Unification.mjs +74 -90
- package/output/js/ff/compiler/Wildcards.mjs +4 -2
- package/output/js/ff/compiler/Workspace.mjs +26 -20
- package/output/js/ff/core/Any.mjs +20 -20
- package/output/js/ff/core/Array.mjs +268 -175
- package/output/js/ff/core/AssetSystem.mjs +8 -6
- package/output/js/ff/core/Atomic.mjs +84 -52
- package/output/js/ff/core/Bool.mjs +6 -4
- package/output/js/ff/core/BrowserSystem.mjs +38 -29
- package/output/js/ff/core/Buffer.mjs +285 -133
- package/output/js/ff/core/BuildSystem.mjs +36 -56
- package/output/js/ff/core/Channel.mjs +250 -97
- package/output/js/ff/core/Char.mjs +5 -3
- package/output/js/ff/core/Core.mjs +28 -34
- package/output/js/ff/core/Crypto.mjs +30 -52
- package/output/js/ff/core/Duration.mjs +4 -2
- package/output/js/ff/core/Equal.mjs +14 -12
- package/output/js/ff/core/Error.mjs +17 -11
- package/output/js/ff/core/FileHandle.mjs +76 -38
- package/output/js/ff/core/Float.mjs +92 -160
- package/output/js/ff/core/HttpClient.mjs +208 -76
- package/output/js/ff/core/Instant.mjs +8 -10
- package/output/js/ff/core/Int.mjs +36 -26
- package/output/js/ff/core/IntMap.mjs +79 -33
- package/output/js/ff/core/Js.mjs +751 -0
- package/output/js/ff/core/JsSystem.mjs +54 -60
- package/output/js/ff/core/JsValue.mjs +294 -143
- package/output/js/ff/core/Json.mjs +443 -253
- package/output/js/ff/core/List.mjs +262 -214
- package/output/js/ff/core/Lock.mjs +156 -125
- package/output/js/ff/core/Log.mjs +20 -10
- package/output/js/ff/core/Map.mjs +10 -8
- package/output/js/ff/core/NodeSystem.mjs +189 -123
- package/output/js/ff/core/Nothing.mjs +4 -2
- package/output/js/ff/core/Option.mjs +40 -38
- package/output/js/ff/core/Ordering.mjs +26 -20
- package/output/js/ff/core/Pair.mjs +4 -2
- package/output/js/ff/core/Path.mjs +517 -315
- package/output/js/ff/core/Queue.mjs +306 -0
- package/output/js/ff/core/Random.mjs +141 -77
- package/output/js/ff/core/RbMap.mjs +36 -34
- package/output/js/ff/core/Serializable.mjs +44 -28
- package/output/js/ff/core/Set.mjs +6 -4
- package/output/js/ff/core/Show.mjs +8 -6
- package/output/js/ff/core/SourceLocation.mjs +4 -2
- package/output/js/ff/core/Stream.mjs +30 -50
- package/output/js/ff/core/String.mjs +263 -172
- package/output/js/ff/core/StringMap.mjs +77 -31
- package/output/js/ff/core/Task.mjs +91 -76
- package/output/js/ff/core/Try.mjs +20 -18
- package/output/js/ff/core/Unit.mjs +4 -2
- package/package.json +1 -1
- package/postgresql/Pg.ff +53 -59
- package/rpc/.firefly/package.ff +1 -1
- package/rpc/Rpc.ff +70 -70
- package/s3/.firefly/package.ff +1 -1
- package/s3/S3.ff +92 -94
- package/vscode/LICENSE.txt +21 -21
- package/vscode/Prepublish.ff +15 -15
- package/vscode/README.md +16 -16
- package/vscode/client/package-lock.json +544 -544
- package/vscode/client/package.json +22 -22
- package/vscode/client/src/extension.ts +104 -104
- package/vscode/icons/firefly-icon.svg +10 -10
- package/vscode/language-configuration.json +61 -61
- package/vscode/package-lock.json +3623 -3623
- package/vscode/package.json +1 -1
- package/vscode/snippets.json +241 -241
- package/vscode/syntaxes/firefly-markdown-injection.json +45 -45
- package/webserver/.firefly/include/package.json +5 -5
- package/webserver/.firefly/package.ff +2 -2
- package/webserver/WebServer.ff +647 -685
- package/websocket/.firefly/package.ff +1 -1
- package/websocket/WebSocket.ff +100 -131
- package/core/UnsafeJs.ff +0 -42
- package/output/js/ff/core/UnsafeJs.mjs +0 -191
package/lsp/LanguageServer.ff
CHANGED
|
@@ -1,272 +1,272 @@
|
|
|
1
|
-
import ModuleCache from ff:compiler
|
|
2
|
-
import DependencyLock from ff:compiler
|
|
3
|
-
import Handler
|
|
4
|
-
|
|
5
|
-
class LanguageServer(
|
|
6
|
-
mutable openFiles: Map[String, String]
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
data BadRequestException(reason: String)
|
|
10
|
-
|
|
11
|
-
data Request(
|
|
12
|
-
headers: Map[String, String]
|
|
13
|
-
object: Json
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
data RequestMessage(
|
|
17
|
-
id: Option[MessageId] // None when the request is a Notification Message
|
|
18
|
-
method: String
|
|
19
|
-
parameters: Map[String, Json]
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
logMessages = False
|
|
23
|
-
|
|
24
|
-
main(system: NodeSystem) {
|
|
25
|
-
let logDirectory = if(logMessages) {
|
|
26
|
-
let directory = system.path(".").slash("messages")
|
|
27
|
-
if(directory.isDirectory()) {directory.delete()}
|
|
28
|
-
directory.createDirectory()
|
|
29
|
-
directory
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
let fireflyPath = system.path(".")
|
|
33
|
-
let cache = ModuleCache.new(0)
|
|
34
|
-
let handler = Handler(
|
|
35
|
-
fireflyPath = fireflyPath
|
|
36
|
-
rootPath = None
|
|
37
|
-
virtualFiles = Map.new()
|
|
38
|
-
cancelledRequests = [].toSet()
|
|
39
|
-
responseCache = Map.new()
|
|
40
|
-
fileSymbolsCache = Map.new()
|
|
41
|
-
moduleCache = cache
|
|
42
|
-
dependencyLock = DependencyLock.new(system.mainTask())
|
|
43
|
-
)
|
|
44
|
-
try {
|
|
45
|
-
mutable input = system.readStream()
|
|
46
|
-
let responseChannel: Channel[Pair[Json, String]] = system.mainTask().channel()
|
|
47
|
-
system.mainTask().spawn {_ =>
|
|
48
|
-
while {True} {
|
|
49
|
-
let body = responseChannel.read()
|
|
50
|
-
let json = body.first.write(Some(" ")).toBuffer()
|
|
51
|
-
logDirectory.each {logMessage(_, "response", body.first, body.second)}
|
|
52
|
-
system.writeText("Content-Length: " + json.size() + "\r\n\r\n")
|
|
53
|
-
system.writeBuffer(json)
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
taskGroup(system.mainTask()) {spawn, abort =>
|
|
57
|
-
mutable version = 1
|
|
58
|
-
while {True} {
|
|
59
|
-
version += 1
|
|
60
|
-
let requestPair = parseRequest(system, input)
|
|
61
|
-
input = requestPair.second
|
|
62
|
-
let request = requestPair.first
|
|
63
|
-
let message = parseRequestMessage(request.object)
|
|
64
|
-
logDirectory.each {logMessage(_, "request", request.object, message.method)}
|
|
65
|
-
spawn(message.id) {_ =>
|
|
66
|
-
if(message.method == "$/cancelRequest") {
|
|
67
|
-
abort(Some(parseMessageId(message.parameters.grab("id"))))
|
|
68
|
-
}
|
|
69
|
-
try {
|
|
70
|
-
handleRequestMessage(system, handler, message, version).each {body =>
|
|
71
|
-
responseChannel.write(Pair(body, message.method))
|
|
72
|
-
}
|
|
73
|
-
} catchAny {error =>
|
|
74
|
-
let problem = if(error.name() == "AbortError") {
|
|
75
|
-
Error(-32800, "Request cancelled")
|
|
76
|
-
} else {
|
|
77
|
-
Log.trace("ERROR: " + error.message())
|
|
78
|
-
Log.trace(error.stack())
|
|
79
|
-
Error(-32603, "Internal error")
|
|
80
|
-
}
|
|
81
|
-
message.id.each {id =>
|
|
82
|
-
let body = makeResponseMessage(id, problem)
|
|
83
|
-
responseChannel.write(Pair(body, message.method))
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
} catch {| BadRequestException(reason), error =>
|
|
90
|
-
Log.trace(reason)
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
taskGroup[K: Order, R](
|
|
95
|
-
parentTask: Task,
|
|
96
|
-
groupBody: ((K, Task => Unit) => Task, K => Unit) => R
|
|
97
|
-
): R {
|
|
98
|
-
let lock = parentTask.lock()
|
|
99
|
-
mutable tasks = [].toMap()
|
|
100
|
-
function spawn(key: K, body: Task => Unit): Task {
|
|
101
|
-
let body2 = {task =>
|
|
102
|
-
lock.do
|
|
103
|
-
try {
|
|
104
|
-
body(task)
|
|
105
|
-
} finally {
|
|
106
|
-
lock.do
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
parentTask.spawn(body2)
|
|
110
|
-
}
|
|
111
|
-
function abort(key: K): Unit {
|
|
112
|
-
lock.do
|
|
113
|
-
}
|
|
114
|
-
groupBody(spawn, abort)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
parseRequest(system: NodeSystem, input: Stream[Buffer]): Pair[Request, Stream[Buffer]] {
|
|
118
|
-
let headersPair = parseRequestHeaders(input)
|
|
119
|
-
let headers = headersPair.first
|
|
120
|
-
let contentLength = headers
|
|
121
|
-
.get("content-length").else {throw(BadRequestException("'content-length' header is missing"))}
|
|
122
|
-
.trim().getInt().else {throw(BadRequestException("Value for 'content-length' is not an integer"))}
|
|
123
|
-
let bodyPair = parseRequestBody(contentLength, headersPair.second)
|
|
124
|
-
bodyPair.mapFirst {body => Request(headers, body)}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
parseRequestHeaders(input: Stream[Buffer]): Pair[Map[String, String], Stream[Buffer]] {
|
|
128
|
-
let buffers = Array.new()
|
|
129
|
-
mutable buffer = input.next().else {
|
|
130
|
-
throw(BadRequestException("End of input while parsing request headers"))
|
|
131
|
-
}
|
|
132
|
-
mutable offset = 0
|
|
133
|
-
mutable droppingInitialNewlines = True
|
|
134
|
-
mutable lastWasNewline = False
|
|
135
|
-
mutable done = False
|
|
136
|
-
while {!done} {
|
|
137
|
-
if(offset == buffer.size()) {
|
|
138
|
-
offset = 0
|
|
139
|
-
buffers.push(buffer)
|
|
140
|
-
buffer = input.next().else {
|
|
141
|
-
throw(BadRequestException("End of input while parsing request headers"))
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
let byte = buffer.grabUint8(offset)
|
|
145
|
-
if(droppingInitialNewlines && (byte == '\n'.codeUnit || byte == '\r'.codeUnit)) {
|
|
146
|
-
// Skip
|
|
147
|
-
} elseIf {byte == '\n'.codeUnit} {
|
|
148
|
-
if(lastWasNewline) {
|
|
149
|
-
done = True
|
|
150
|
-
} else {
|
|
151
|
-
lastWasNewline = True
|
|
152
|
-
}
|
|
153
|
-
} elseIf {byte != '\r'.codeUnit && lastWasNewline} {
|
|
154
|
-
lastWasNewline = False
|
|
155
|
-
} else {
|
|
156
|
-
droppingInitialNewlines = False
|
|
157
|
-
}
|
|
158
|
-
offset += 1
|
|
159
|
-
}
|
|
160
|
-
buffers.push(buffer.view(0, offset))
|
|
161
|
-
let headers = Buffer.fromBufferList(buffers.drain()).toString()
|
|
162
|
-
let map = headers.lines().pairs().filter {_.second.size() != 0}.map {| Pair(i, line) =>
|
|
163
|
-
line.splitFirst(':').else {
|
|
164
|
-
throw(BadRequestException("Invalid header at line " + i + " '" + line + "'"))
|
|
165
|
-
}.mapFirst {_.lower()} //.mapSecond {_.trim()}
|
|
166
|
-
}.toMap()
|
|
167
|
-
Pair(map, [buffer.view(offset, buffer.size())].toStream().addAll(input))
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
parseRequestBody(contentLength: Int, input: Stream[Buffer]): Pair[Json, Stream[Buffer]] {
|
|
171
|
-
let bodyPair = try {
|
|
172
|
-
input.readBytes(contentLength) // Should Stream.readBytes return an option?
|
|
173
|
-
} catchAny {error =>
|
|
174
|
-
throw(BadRequestException("End of input while parsing request body"))
|
|
175
|
-
}
|
|
176
|
-
let body = Buffer.fromBufferList(bodyPair.first).toString()
|
|
177
|
-
let json = Json.read(body).else {
|
|
178
|
-
throw(BadRequestException("Invalid JSON in request body: " + body))
|
|
179
|
-
}
|
|
180
|
-
Pair(json, bodyPair.second)
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
parseRequestMessage(object: Json): RequestMessage {
|
|
184
|
-
let id = object.getField("id").map {parseMessageId(_)}
|
|
185
|
-
|
|
186
|
-
let method = object.getField("method").{
|
|
187
|
-
| None => throw(BadRequestException("Bad JSON-RPC, missing method"))
|
|
188
|
-
| Some(m) {!m.isString()} => throw(BadRequestException("Bad JSON-RPC method, string expected"))
|
|
189
|
-
| Some(m) => m.grabString()
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
let parameters = object.getField("params").{
|
|
193
|
-
| None => [].toMap()
|
|
194
|
-
| Some(o) {!o.isObject()} => throw(BadRequestException("Bad JSON-RPC params, object expected"))
|
|
195
|
-
| Some(o) => o.grabMap()
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
RequestMessage(id, method, parameters)
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
parseMessageId(id: Json): MessageId {
|
|
202
|
-
if(id.isInt()) {
|
|
203
|
-
MessageIdInt(id.grabInt())
|
|
204
|
-
} elseIf {id.isString()} {
|
|
205
|
-
MessageIdString(id.grabString())
|
|
206
|
-
} else {
|
|
207
|
-
throw(BadRequestException("Bad JSON-RPC id, int or string expected"))
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
handleRequestMessage(system: NodeSystem, handler: Handler, message: RequestMessage, version: Int): List[Json] {
|
|
212
|
-
try {
|
|
213
|
-
message.id.{
|
|
214
|
-
| None {message.method == "$/cancelRequest"} => // TODO: Needs to read ahead to cancel anything
|
|
215
|
-
handler.cancelledRequests = handler.cancelledRequests.add(
|
|
216
|
-
parseMessageId(message.parameters.grab("id"))
|
|
217
|
-
)
|
|
218
|
-
[]
|
|
219
|
-
| None =>
|
|
220
|
-
let notification = handler.handleNotification(system, message.method, message.parameters, version)
|
|
221
|
-
notification.map {| Pair(method, params) => makeNotificationMessage(method, params)}
|
|
222
|
-
| Some(id) {handler.cancelledRequests.contains(id)} =>
|
|
223
|
-
handler.cancelledRequests = handler.cancelledRequests.remove(id)
|
|
224
|
-
[makeResponseMessage(id, Error(-32800, "Request cancelled"))]
|
|
225
|
-
| Some(id) =>
|
|
226
|
-
let result = handler.handleRequest(system, message.method, message.parameters, version)
|
|
227
|
-
[makeResponseMessage(id, result)]
|
|
228
|
-
}
|
|
229
|
-
} catchAny {error =>
|
|
230
|
-
//system.files().writeText("lsp-failure.txt", error.name() + ": " + error.message())
|
|
231
|
-
error.rethrow()
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
makeResponseMessage(id: MessageId, result: ResultOrError): Json {
|
|
236
|
-
mutable o = Json.object().with("jsonrpc", "2.0")
|
|
237
|
-
id.{
|
|
238
|
-
| MessageIdInt(id) => o = o.with("id", id)
|
|
239
|
-
| MessageIdString(id) => o = o.with("id", id)
|
|
240
|
-
}
|
|
241
|
-
result.{
|
|
242
|
-
| Result(result) =>
|
|
243
|
-
o = o.with("result", Json.read(result).grab())
|
|
244
|
-
| Error(code, message) =>
|
|
245
|
-
let e = Json.object()
|
|
246
|
-
.with("code", code)
|
|
247
|
-
.with("message", message)
|
|
248
|
-
o = o.with("error", e)
|
|
249
|
-
}
|
|
250
|
-
o
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
makeNotificationMessage(method: String, params: Json): Json {
|
|
254
|
-
Json.object()
|
|
255
|
-
.with("jsonrpc", "2.0")
|
|
256
|
-
.with("method", method)
|
|
257
|
-
.with("params", params)
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
logMessage(directory: Path, messageType: String, body: Json, method: String) {
|
|
261
|
-
let id = if(method == "$/cancelRequest") {
|
|
262
|
-
Some(body.field("params").field("id").grabInt())
|
|
263
|
-
} else {
|
|
264
|
-
body.field("id").getInt()
|
|
265
|
-
}
|
|
266
|
-
let number = directory.entries().toList().size()
|
|
267
|
-
let idName = id.map {_ + ""}.else {"_"}
|
|
268
|
-
let methodName = method.replace("$", "notification").replace("/", "_")
|
|
269
|
-
let fileName = number + "-id-" + idName + "-" + messageType + "-" + methodName + ".json"
|
|
270
|
-
let path = directory.slash(fileName)
|
|
271
|
-
path.writeText(body.write(Some(" ")))
|
|
272
|
-
}
|
|
1
|
+
import ModuleCache from ff:compiler
|
|
2
|
+
import DependencyLock from ff:compiler
|
|
3
|
+
import Handler
|
|
4
|
+
|
|
5
|
+
class LanguageServer(
|
|
6
|
+
mutable openFiles: Map[String, String]
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
data BadRequestException(reason: String)
|
|
10
|
+
|
|
11
|
+
data Request(
|
|
12
|
+
headers: Map[String, String]
|
|
13
|
+
object: Json
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
data RequestMessage(
|
|
17
|
+
id: Option[MessageId] // None when the request is a Notification Message
|
|
18
|
+
method: String
|
|
19
|
+
parameters: Map[String, Json]
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
logMessages = False
|
|
23
|
+
|
|
24
|
+
main(system: NodeSystem) {
|
|
25
|
+
let logDirectory = if(logMessages) {
|
|
26
|
+
let directory = system.path(".").slash("messages")
|
|
27
|
+
if(directory.isDirectory()) {directory.delete()}
|
|
28
|
+
directory.createDirectory()
|
|
29
|
+
directory
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let fireflyPath = system.path(".")
|
|
33
|
+
let cache = ModuleCache.new(0)
|
|
34
|
+
let handler = Handler(
|
|
35
|
+
fireflyPath = fireflyPath
|
|
36
|
+
rootPath = None
|
|
37
|
+
virtualFiles = Map.new()
|
|
38
|
+
cancelledRequests = [].toSet()
|
|
39
|
+
responseCache = Map.new()
|
|
40
|
+
fileSymbolsCache = Map.new()
|
|
41
|
+
moduleCache = cache
|
|
42
|
+
dependencyLock = DependencyLock.new(system.mainTask())
|
|
43
|
+
)
|
|
44
|
+
try {
|
|
45
|
+
mutable input = system.readStream()
|
|
46
|
+
let responseChannel: Channel[Pair[Json, String]] = system.mainTask().channel()
|
|
47
|
+
system.mainTask().spawn {_ =>
|
|
48
|
+
while {True} {
|
|
49
|
+
let body = responseChannel.read()
|
|
50
|
+
let json = body.first.write(Some(" ")).toBuffer()
|
|
51
|
+
logDirectory.each {logMessage(_, "response", body.first, body.second)}
|
|
52
|
+
system.writeText("Content-Length: " + json.size() + "\r\n\r\n")
|
|
53
|
+
system.writeBuffer(json)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
taskGroup(system.mainTask()) {spawn, abort =>
|
|
57
|
+
mutable version = 1
|
|
58
|
+
while {True} {
|
|
59
|
+
version += 1
|
|
60
|
+
let requestPair = parseRequest(system, input)
|
|
61
|
+
input = requestPair.second
|
|
62
|
+
let request = requestPair.first
|
|
63
|
+
let message = parseRequestMessage(request.object)
|
|
64
|
+
logDirectory.each {logMessage(_, "request", request.object, message.method)}
|
|
65
|
+
spawn(message.id) {_ =>
|
|
66
|
+
if(message.method == "$/cancelRequest") {
|
|
67
|
+
abort(Some(parseMessageId(message.parameters.grab("id"))))
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
handleRequestMessage(system, handler, message, version).each {body =>
|
|
71
|
+
responseChannel.write(Pair(body, message.method))
|
|
72
|
+
}
|
|
73
|
+
} catchAny {error =>
|
|
74
|
+
let problem = if(error.name() == "AbortError") {
|
|
75
|
+
Error(-32800, "Request cancelled")
|
|
76
|
+
} else {
|
|
77
|
+
Log.trace("ERROR: " + error.message())
|
|
78
|
+
Log.trace(error.stack())
|
|
79
|
+
Error(-32603, "Internal error")
|
|
80
|
+
}
|
|
81
|
+
message.id.each {id =>
|
|
82
|
+
let body = makeResponseMessage(id, problem)
|
|
83
|
+
responseChannel.write(Pair(body, message.method))
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
} catch {| BadRequestException(reason), error =>
|
|
90
|
+
Log.trace(reason)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
taskGroup[K: Order, R](
|
|
95
|
+
parentTask: Task,
|
|
96
|
+
groupBody: ((K, Task => Unit) => Task, K => Unit) => R
|
|
97
|
+
): R {
|
|
98
|
+
let lock = parentTask.lock()
|
|
99
|
+
mutable tasks = [].toMap()
|
|
100
|
+
function spawn(key: K, body: Task => Unit): Task {
|
|
101
|
+
let body2 = {task =>
|
|
102
|
+
lock.do {tasks = tasks.add(key, task)}
|
|
103
|
+
try {
|
|
104
|
+
body(task)
|
|
105
|
+
} finally {
|
|
106
|
+
lock.do {tasks = tasks.remove(key)}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
parentTask.spawn(body2)
|
|
110
|
+
}
|
|
111
|
+
function abort(key: K): Unit {
|
|
112
|
+
lock.do {tasks.get(key).each {_.abort()}}
|
|
113
|
+
}
|
|
114
|
+
groupBody(spawn, abort)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
parseRequest(system: NodeSystem, input: Stream[Buffer]): Pair[Request, Stream[Buffer]] {
|
|
118
|
+
let headersPair = parseRequestHeaders(input)
|
|
119
|
+
let headers = headersPair.first
|
|
120
|
+
let contentLength = headers
|
|
121
|
+
.get("content-length").else {throw(BadRequestException("'content-length' header is missing"))}
|
|
122
|
+
.trim().getInt().else {throw(BadRequestException("Value for 'content-length' is not an integer"))}
|
|
123
|
+
let bodyPair = parseRequestBody(contentLength, headersPair.second)
|
|
124
|
+
bodyPair.mapFirst {body => Request(headers, body)}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
parseRequestHeaders(input: Stream[Buffer]): Pair[Map[String, String], Stream[Buffer]] {
|
|
128
|
+
let buffers = Array.new()
|
|
129
|
+
mutable buffer = input.next().else {
|
|
130
|
+
throw(BadRequestException("End of input while parsing request headers"))
|
|
131
|
+
}
|
|
132
|
+
mutable offset = 0
|
|
133
|
+
mutable droppingInitialNewlines = True
|
|
134
|
+
mutable lastWasNewline = False
|
|
135
|
+
mutable done = False
|
|
136
|
+
while {!done} {
|
|
137
|
+
if(offset == buffer.size()) {
|
|
138
|
+
offset = 0
|
|
139
|
+
buffers.push(buffer)
|
|
140
|
+
buffer = input.next().else {
|
|
141
|
+
throw(BadRequestException("End of input while parsing request headers"))
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
let byte = buffer.grabUint8(offset)
|
|
145
|
+
if(droppingInitialNewlines && (byte == '\n'.codeUnit || byte == '\r'.codeUnit)) {
|
|
146
|
+
// Skip
|
|
147
|
+
} elseIf {byte == '\n'.codeUnit} {
|
|
148
|
+
if(lastWasNewline) {
|
|
149
|
+
done = True
|
|
150
|
+
} else {
|
|
151
|
+
lastWasNewline = True
|
|
152
|
+
}
|
|
153
|
+
} elseIf {byte != '\r'.codeUnit && lastWasNewline} {
|
|
154
|
+
lastWasNewline = False
|
|
155
|
+
} else {
|
|
156
|
+
droppingInitialNewlines = False
|
|
157
|
+
}
|
|
158
|
+
offset += 1
|
|
159
|
+
}
|
|
160
|
+
buffers.push(buffer.view(0, offset))
|
|
161
|
+
let headers = Buffer.fromBufferList(buffers.drain()).toString()
|
|
162
|
+
let map = headers.lines().pairs().filter {_.second.size() != 0}.map {| Pair(i, line) =>
|
|
163
|
+
line.splitFirst(':').else {
|
|
164
|
+
throw(BadRequestException("Invalid header at line " + i + " '" + line + "'"))
|
|
165
|
+
}.mapFirst {_.lower()} //.mapSecond {_.trim()}
|
|
166
|
+
}.toMap()
|
|
167
|
+
Pair(map, [buffer.view(offset, buffer.size())].toStream().addAll(input))
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
parseRequestBody(contentLength: Int, input: Stream[Buffer]): Pair[Json, Stream[Buffer]] {
|
|
171
|
+
let bodyPair = try {
|
|
172
|
+
input.readBytes(contentLength) // Should Stream.readBytes return an option?
|
|
173
|
+
} catchAny {error =>
|
|
174
|
+
throw(BadRequestException("End of input while parsing request body"))
|
|
175
|
+
}
|
|
176
|
+
let body = Buffer.fromBufferList(bodyPair.first).toString()
|
|
177
|
+
let json = Json.read(body).else {
|
|
178
|
+
throw(BadRequestException("Invalid JSON in request body: " + body))
|
|
179
|
+
}
|
|
180
|
+
Pair(json, bodyPair.second)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
parseRequestMessage(object: Json): RequestMessage {
|
|
184
|
+
let id = object.getField("id").map {parseMessageId(_)}
|
|
185
|
+
|
|
186
|
+
let method = object.getField("method").{
|
|
187
|
+
| None => throw(BadRequestException("Bad JSON-RPC, missing method"))
|
|
188
|
+
| Some(m) {!m.isString()} => throw(BadRequestException("Bad JSON-RPC method, string expected"))
|
|
189
|
+
| Some(m) => m.grabString()
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
let parameters = object.getField("params").{
|
|
193
|
+
| None => [].toMap()
|
|
194
|
+
| Some(o) {!o.isObject()} => throw(BadRequestException("Bad JSON-RPC params, object expected"))
|
|
195
|
+
| Some(o) => o.grabMap()
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
RequestMessage(id, method, parameters)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
parseMessageId(id: Json): MessageId {
|
|
202
|
+
if(id.isInt()) {
|
|
203
|
+
MessageIdInt(id.grabInt())
|
|
204
|
+
} elseIf {id.isString()} {
|
|
205
|
+
MessageIdString(id.grabString())
|
|
206
|
+
} else {
|
|
207
|
+
throw(BadRequestException("Bad JSON-RPC id, int or string expected"))
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
handleRequestMessage(system: NodeSystem, handler: Handler, message: RequestMessage, version: Int): List[Json] {
|
|
212
|
+
try {
|
|
213
|
+
message.id.{
|
|
214
|
+
| None {message.method == "$/cancelRequest"} => // TODO: Needs to read ahead to cancel anything
|
|
215
|
+
handler.cancelledRequests = handler.cancelledRequests.add(
|
|
216
|
+
parseMessageId(message.parameters.grab("id"))
|
|
217
|
+
)
|
|
218
|
+
[]
|
|
219
|
+
| None =>
|
|
220
|
+
let notification = handler.handleNotification(system, message.method, message.parameters, version)
|
|
221
|
+
notification.map {| Pair(method, params) => makeNotificationMessage(method, params)}
|
|
222
|
+
| Some(id) {handler.cancelledRequests.contains(id)} =>
|
|
223
|
+
handler.cancelledRequests = handler.cancelledRequests.remove(id)
|
|
224
|
+
[makeResponseMessage(id, Error(-32800, "Request cancelled"))]
|
|
225
|
+
| Some(id) =>
|
|
226
|
+
let result = handler.handleRequest(system, message.method, message.parameters, version)
|
|
227
|
+
[makeResponseMessage(id, result)]
|
|
228
|
+
}
|
|
229
|
+
} catchAny {error =>
|
|
230
|
+
//system.files().writeText("lsp-failure.txt", error.name() + ": " + error.message())
|
|
231
|
+
error.rethrow()
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
makeResponseMessage(id: MessageId, result: ResultOrError): Json {
|
|
236
|
+
mutable o = Json.object().with("jsonrpc", "2.0")
|
|
237
|
+
id.{
|
|
238
|
+
| MessageIdInt(id) => o = o.with("id", id)
|
|
239
|
+
| MessageIdString(id) => o = o.with("id", id)
|
|
240
|
+
}
|
|
241
|
+
result.{
|
|
242
|
+
| Result(result) =>
|
|
243
|
+
o = o.with("result", Json.read(result).grab())
|
|
244
|
+
| Error(code, message) =>
|
|
245
|
+
let e = Json.object()
|
|
246
|
+
.with("code", code)
|
|
247
|
+
.with("message", message)
|
|
248
|
+
o = o.with("error", e)
|
|
249
|
+
}
|
|
250
|
+
o
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
makeNotificationMessage(method: String, params: Json): Json {
|
|
254
|
+
Json.object()
|
|
255
|
+
.with("jsonrpc", "2.0")
|
|
256
|
+
.with("method", method)
|
|
257
|
+
.with("params", params)
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
logMessage(directory: Path, messageType: String, body: Json, method: String) {
|
|
261
|
+
let id = if(method == "$/cancelRequest") {
|
|
262
|
+
Some(body.field("params").field("id").grabInt())
|
|
263
|
+
} else {
|
|
264
|
+
body.field("id").getInt()
|
|
265
|
+
}
|
|
266
|
+
let number = directory.entries().toList().size()
|
|
267
|
+
let idName = id.map {_ + ""}.else {"_"}
|
|
268
|
+
let methodName = method.replace("$", "notification").replace("/", "_")
|
|
269
|
+
let fileName = number + "-id-" + idName + "-" + messageType + "-" + methodName + ".json"
|
|
270
|
+
let path = directory.slash(fileName)
|
|
271
|
+
path.writeText(body.write(Some(" ")))
|
|
272
|
+
}
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import LspHook from ff:compiler
|
|
2
|
-
import Unification from ff:compiler
|
|
3
|
-
import Environment from ff:compiler
|
|
4
|
-
import Syntax from ff:compiler
|
|
5
|
-
import Handler
|
|
6
|
-
import CompletionHandler
|
|
7
|
-
|
|
8
|
-
handleSignatureHelp(system: NodeSystem, lspHook: LspHook): Json {
|
|
9
|
-
let signatureAndUnification = lspHook.results().collectFirst {
|
|
10
|
-
| InferLookupHook h =>
|
|
11
|
-
let isMember = h.symbol.value.qualifiedName.contains("_")
|
|
12
|
-
h.instantiated.value.map {i =>
|
|
13
|
-
let signature = if(!isMember) {i.scheme.signature} else {
|
|
14
|
-
i.scheme.signature.Signature(parameters = i.scheme.signature.parameters.dropFirst())
|
|
15
|
-
}
|
|
16
|
-
Pair(signature, h.unification)
|
|
17
|
-
}
|
|
18
|
-
| _ => None
|
|
19
|
-
}
|
|
20
|
-
signatureAndUnification.map {| Pair(s, unification) =>
|
|
21
|
-
let shownTypes = [...s.parameters.map {_.valueType}, s.returnType].map {unification.substitute(_)}
|
|
22
|
-
let realGenerics = s.generics.filter {_ != "Q$"}
|
|
23
|
-
let generics = if(realGenerics.isEmpty()) {""} else {"[" + realGenerics.join(", ") + "]"}
|
|
24
|
-
// TODO only instantiate acording to self. Eg. Some("foo").map {...}
|
|
25
|
-
let parameters = s.parameters.map {p =>
|
|
26
|
-
CompletionHandler.showCompletionParameter("", p.Parameter(valueType = unification.substitute(p.valueType)))
|
|
27
|
-
}
|
|
28
|
-
let label =
|
|
29
|
-
s.name + generics + "(" + parameters.join(", ") + "): " + unification.substitute(s.returnType).show(shownTypes)
|
|
30
|
-
Json.object()
|
|
31
|
-
.with("signatures", [Json.object()
|
|
32
|
-
.with("label", label)
|
|
33
|
-
.with("parameters", [
|
|
34
|
-
...parameters.map {p =>
|
|
35
|
-
Json.object().with("label", p)
|
|
36
|
-
}
|
|
37
|
-
// Fake parameter to trick the client into remembering the call position
|
|
38
|
-
Json.object().with("label", "/* Call " + lspHook.at.show() + " */")
|
|
39
|
-
])
|
|
40
|
-
])
|
|
41
|
-
.with("activeSignature", 0)
|
|
42
|
-
}.else {Json.null()}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
pickActiveParameter(help: Json, argumentIndex: Int, parameterName: Option[String]): Json {
|
|
46
|
-
parameterName.flatMap {name =>
|
|
47
|
-
help.field("signatures").index(0).field("parameters").getArray().flatMap {parameters =>
|
|
48
|
-
parameters.pairs().collectFirst {| Pair(i, p) =>
|
|
49
|
-
if(name == p.field("label").grabString().takeWhile {_.isAsciiLetterOrDigit()}) {
|
|
50
|
-
help.with("activeParameter", i)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}.else {help.with("activeParameter", argumentIndex)}
|
|
55
|
-
}
|
|
1
|
+
import LspHook from ff:compiler
|
|
2
|
+
import Unification from ff:compiler
|
|
3
|
+
import Environment from ff:compiler
|
|
4
|
+
import Syntax from ff:compiler
|
|
5
|
+
import Handler
|
|
6
|
+
import CompletionHandler
|
|
7
|
+
|
|
8
|
+
handleSignatureHelp(system: NodeSystem, lspHook: LspHook): Json {
|
|
9
|
+
let signatureAndUnification = lspHook.results().collectFirst {
|
|
10
|
+
| InferLookupHook h =>
|
|
11
|
+
let isMember = h.symbol.value.qualifiedName.contains("_")
|
|
12
|
+
h.instantiated.value.map {i =>
|
|
13
|
+
let signature = if(!isMember) {i.scheme.signature} else {
|
|
14
|
+
i.scheme.signature.Signature(parameters = i.scheme.signature.parameters.dropFirst())
|
|
15
|
+
}
|
|
16
|
+
Pair(signature, h.unification)
|
|
17
|
+
}
|
|
18
|
+
| _ => None
|
|
19
|
+
}
|
|
20
|
+
signatureAndUnification.map {| Pair(s, unification) =>
|
|
21
|
+
let shownTypes = [...s.parameters.map {_.valueType}, s.returnType].map {unification.substitute(_)}
|
|
22
|
+
let realGenerics = s.generics.filter {_ != "Q$"}
|
|
23
|
+
let generics = if(realGenerics.isEmpty()) {""} else {"[" + realGenerics.join(", ") + "]"}
|
|
24
|
+
// TODO only instantiate acording to self. Eg. Some("foo").map {...}
|
|
25
|
+
let parameters = s.parameters.map {p =>
|
|
26
|
+
CompletionHandler.showCompletionParameter("", p.Parameter(valueType = unification.substitute(p.valueType)))
|
|
27
|
+
}
|
|
28
|
+
let label =
|
|
29
|
+
s.name + generics + "(" + parameters.join(", ") + "): " + unification.substitute(s.returnType).show(shownTypes)
|
|
30
|
+
Json.object()
|
|
31
|
+
.with("signatures", [Json.object()
|
|
32
|
+
.with("label", label)
|
|
33
|
+
.with("parameters", [
|
|
34
|
+
...parameters.map {p =>
|
|
35
|
+
Json.object().with("label", p)
|
|
36
|
+
}
|
|
37
|
+
// Fake parameter to trick the client into remembering the call position
|
|
38
|
+
Json.object().with("label", "/* Call " + lspHook.at.show() + " */")
|
|
39
|
+
])
|
|
40
|
+
])
|
|
41
|
+
.with("activeSignature", 0)
|
|
42
|
+
}.else {Json.null()}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
pickActiveParameter(help: Json, argumentIndex: Int, parameterName: Option[String]): Json {
|
|
46
|
+
parameterName.flatMap {name =>
|
|
47
|
+
help.field("signatures").index(0).field("parameters").getArray().flatMap {parameters =>
|
|
48
|
+
parameters.pairs().collectFirst {| Pair(i, p) =>
|
|
49
|
+
if(name == p.field("label").grabString().takeWhile {_.isAsciiLetterOrDigit()}) {
|
|
50
|
+
help.with("activeParameter", i)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}.else {help.with("activeParameter", argumentIndex)}
|
|
55
|
+
}
|