Skip to content

Commit d8cf62d

Browse files
committed
Langoustine 0.1.0
1 parent 56aedd3 commit d8cf62d

3 files changed

Lines changed: 32 additions & 26 deletions

File tree

LSP.scala

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ object QuickmaffsLSP:
111111
Diagnostic(
112112
range = span.toRange,
113113
message = msg,
114-
severity = Opt(DiagnosticSeverity.Error)
114+
severity = Some(DiagnosticSeverity.Error)
115115
)
116116
}
117117

@@ -123,7 +123,7 @@ object QuickmaffsLSP:
123123
Diagnostic(
124124
range = Span(parseError.caret, parseError.caret).toRange,
125125
message = "Parsing failed",
126-
severity = Opt(DiagnosticSeverity.Error)
126+
severity = Some(DiagnosticSeverity.Error)
127127
)
128128
)
129129
)
@@ -134,7 +134,7 @@ object QuickmaffsLSP:
134134
Diagnostic(
135135
range = Range(Position(zero, zero), Position(zero, zero)),
136136
message = s"Runtime: ${err.message}",
137-
severity = Opt(DiagnosticSeverity.Error)
137+
severity = Some(DiagnosticSeverity.Error)
138138
)
139139
)
140140
)
@@ -174,26 +174,26 @@ object QuickmaffsLSP:
174174
IO {
175175
InitializeResult(
176176
ServerCapabilities(
177-
hoverProvider = Opt(true),
178-
definitionProvider = Opt(true),
179-
documentSymbolProvider = Opt(true),
180-
renameProvider = Opt(true),
181-
semanticTokensProvider = Opt(
177+
hoverProvider = Some(true),
178+
definitionProvider = Some(true),
179+
documentSymbolProvider = Some(true),
180+
renameProvider = Some(true),
181+
semanticTokensProvider = Some(
182182
SemanticTokensOptions(
183183
legend = encoder.legend,
184-
full = Opt(true)
184+
full = Some(true)
185185
)
186186
),
187-
textDocumentSync = Opt(
187+
textDocumentSync = Some(
188188
TextDocumentSyncOptions(
189-
openClose = Opt(true),
190-
save = Opt(true)
189+
openClose = Some(true),
190+
save = Some(true)
191191
)
192192
)
193193
),
194-
Opt(
194+
Some(
195195
InitializeResult
196-
.ServerInfo(name = "Quickmaffs LSP", version = Opt("0.0.1"))
196+
.ServerInfo(name = "Quickmaffs LSP", version = Some("0.0.1"))
197197
)
198198
)
199199
}
@@ -259,7 +259,7 @@ object QuickmaffsLSP:
259259
.errorln(
260260
s"Sending over the following tokens: ${tokens.result().map(_.toString)}"
261261
) *>
262-
IO.fromEither(encoder.encode(tokens.result())).map(Opt(_))
262+
IO.fromEither(encoder.encode(tokens.result())).map(Some(_))
263263

264264
case other =>
265265
IO.consoleForIO
@@ -276,7 +276,7 @@ object QuickmaffsLSP:
276276
foundMaybe
277277
.map(_._2)
278278
.map { vdf =>
279-
Opt(
279+
Some(
280280
Definition(
281281
Location(in.textDocument.uri, vdf.definedAt.toRange)
282282
)
@@ -334,7 +334,7 @@ object QuickmaffsLSP:
334334
}
335335
}
336336

337-
case _ => Opt(Vector.empty)
337+
case _ => Some(Vector.empty)
338338
}
339339
}
340340
.handleRequest(textDocument.rename) { (in, back) =>
@@ -348,15 +348,15 @@ object QuickmaffsLSP:
348348

349349
Opt {
350350
WorkspaceEdit(
351-
changes = Opt(
351+
changes = Some(
352352
Map(
353353
in.textDocument.uri -> edits
354354
)
355355
)
356356
)
357357
}
358358
}
359-
.getOrElse(Opt.empty)
359+
.getOrElse(None)
360360
}
361361
}
362362
end server

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,20 @@ setup:
88
scala-cli setup-ide *.scala
99

1010

11-
bin/repl:
11+
bin/repl: *.scala
1212
mkdir -p bin
1313
scala-cli package . --main-class REPL --force --output bin/repl
1414

15-
bin/lsp:
15+
bin/lsp: *.scala
1616
mkdir -p bin
1717
scala-cli package . --main-class LSP --force --output bin/lsp
1818

19-
bin/quickmaffs:
19+
bin/lsp-native: *.scala
20+
mkdir -p bin
21+
scala-cli package . --main-class LSP --force --output bin/lsp-native --native
22+
23+
24+
bin/quickmaffs: *.scala
2025
mkdir -p bin
2126
scala-cli package . --main-class INTERPRETER --force --output bin/quickmaffs
2227

project.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
//> using scala "3.2.2"
2-
//> using repository "sonatype-s01:snapshots"
3-
//> using lib "tech.neander::langoustine-app::0.0.19"
4-
//> using lib "org.typelevel::cats-parse::0.3.9"
1+
// Main
2+
//> using scala 3.8.3
3+
//> using nativeVersion 0.5.11
4+
//> using dependency org.typelevel::cats-parse::1.1.0 tech.neander::langoustine-app::0.1.0
5+

0 commit comments

Comments
 (0)