t-ruby 0.0.6 → 0.0.7
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.
- checksums.yaml +4 -4
- data/lib/t_ruby/lsp_server.rb +17 -0
- data/lib/t_ruby/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 054211b0b7c63b2f1b66b3cfed976385174c1b3f5904ea04357599b3c7440e8f
|
|
4
|
+
data.tar.gz: 0aa86d48811cff1bc7d7652155055f5041c0bef8e372b9dcec4a06a716534799
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 73ba77dc237a8455dd60b0c098de4372cd6e9f76e00619a54669af04fd46deca80c8c6fb1c3322114442ea38a471f18f722fc66018ad14cf31469ed153c11bc8
|
|
7
|
+
data.tar.gz: 5b6c3d2d3a895f941949d79407cb2e0ce91c3d1b3a13d7e113cd02be1a8fbdd9a82fb86bf6ac1d99832d4e331861c8657b516836b334aa73c8175273835c6da5
|
data/lib/t_ruby/lsp_server.rb
CHANGED
|
@@ -234,6 +234,8 @@ module TRuby
|
|
|
234
234
|
handle_definition(params)
|
|
235
235
|
when "textDocument/semanticTokens/full"
|
|
236
236
|
handle_semantic_tokens_full(params)
|
|
237
|
+
when "textDocument/diagnostic"
|
|
238
|
+
handle_diagnostic(params)
|
|
237
239
|
else
|
|
238
240
|
{ error: { code: ErrorCodes::METHOD_NOT_FOUND, message: "Method not found: #{method}" } }
|
|
239
241
|
end
|
|
@@ -342,6 +344,21 @@ module TRuby
|
|
|
342
344
|
|
|
343
345
|
# === Diagnostics ===
|
|
344
346
|
|
|
347
|
+
# Handle pull-based diagnostics (LSP 3.17+)
|
|
348
|
+
def handle_diagnostic(params)
|
|
349
|
+
uri = params.dig("textDocument", "uri")
|
|
350
|
+
return { "kind" => "full", "items" => [] } unless uri
|
|
351
|
+
|
|
352
|
+
doc = @documents[uri]
|
|
353
|
+
return { "kind" => "full", "items" => [] } unless doc
|
|
354
|
+
|
|
355
|
+
text = doc[:text]
|
|
356
|
+
return { "kind" => "full", "items" => [] } unless text
|
|
357
|
+
|
|
358
|
+
diagnostics = analyze_document(text)
|
|
359
|
+
{ "kind" => "full", "items" => diagnostics }
|
|
360
|
+
end
|
|
361
|
+
|
|
345
362
|
def publish_diagnostics(uri, text)
|
|
346
363
|
diagnostics = analyze_document(text)
|
|
347
364
|
|
data/lib/t_ruby/version.rb
CHANGED