mbeditor 0.8.0 → 0.8.1
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/CHANGELOG.md +16 -0
- data/lib/mbeditor/ruby_lsp_client.rb +16 -1
- data/lib/mbeditor/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: 2f74579627da44a31db150cb5de08c5060ccad0a68e9ac47603039b84849fff2
|
|
4
|
+
data.tar.gz: d2fa6b611b1a1804e26748281f367bd3f2dfc20796d0459defb9b05d65583fa1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ab9d1c840c0153f07f3f1989874bca8025d59921615597be5eae9ba83b5eb9c536a554d50bb934c4d2c6202d8d89b119179241cba67c4c21bdf81f98491546d3
|
|
7
|
+
data.tar.gz: e5328c15e5c250c55a0d02eba2a38e2d752bf8c813d9e740181cd3e0ff86e5d79fa1bfb2e5cb5ad566328cd6b17b23faf2952edc0eed4564ec1311b86ef649f3
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.8.1] - 2026-07-22
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **ruby-lsp features never started on Ruby 3.0 and 3.1.** The client waited
|
|
12
|
+
for responses with `Queue#pop(timeout:)`, which only accepts that keyword
|
|
13
|
+
from Ruby 3.2 — so the initialize handshake raised on older rubies and every
|
|
14
|
+
ruby-lsp request fell back to the built-in services. The gemspec supports
|
|
15
|
+
Ruby >= 3.0; the wait now uses a portable path there. Both branches are
|
|
16
|
+
covered by tests regardless of which Ruby runs the suite.
|
|
17
|
+
- The gem's own `mini_racer`/`ruby-lsp` development dependencies are gated on
|
|
18
|
+
Ruby >= 3.2 — mini_racer's native extension fails to build on 3.0/3.1, which
|
|
19
|
+
broke `bundle install` for contributors on those versions. Neither gem is
|
|
20
|
+
needed by the suite.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
8
24
|
## [0.8.0] - 2026-07-22
|
|
9
25
|
|
|
10
26
|
### Added
|
|
@@ -4,6 +4,7 @@ require "open3"
|
|
|
4
4
|
require "json"
|
|
5
5
|
require "digest"
|
|
6
6
|
require "shellwords"
|
|
7
|
+
require "timeout"
|
|
7
8
|
|
|
8
9
|
module Mbeditor
|
|
9
10
|
# Manages a persistent ruby-lsp process per workspace and speaks the
|
|
@@ -110,7 +111,7 @@ module Mbeditor
|
|
|
110
111
|
|
|
111
112
|
write_message({ jsonrpc: "2.0", id: id, method: method, params: params })
|
|
112
113
|
|
|
113
|
-
msg = queue
|
|
114
|
+
msg = pop_with_timeout(queue, timeout)
|
|
114
115
|
raise TimeoutError, "#{method} timed out after #{timeout}s" if msg.nil?
|
|
115
116
|
raise Error, msg["error"]["message"].to_s if msg["error"]
|
|
116
117
|
|
|
@@ -119,6 +120,20 @@ module Mbeditor
|
|
|
119
120
|
@pending_mutex.synchronize { @pending.delete(id) } if id
|
|
120
121
|
end
|
|
121
122
|
|
|
123
|
+
# Queue#pop only accepts a timeout: keyword from Ruby 3.2 onwards, and the
|
|
124
|
+
# gem supports 3.0. Returns nil on timeout either way.
|
|
125
|
+
QUEUE_POP_SUPPORTS_TIMEOUT = RUBY_VERSION >= "3.2"
|
|
126
|
+
|
|
127
|
+
def pop_with_timeout(queue, timeout)
|
|
128
|
+
return queue.pop(timeout: timeout) if QUEUE_POP_SUPPORTS_TIMEOUT
|
|
129
|
+
|
|
130
|
+
begin
|
|
131
|
+
Timeout.timeout(timeout) { queue.pop }
|
|
132
|
+
rescue Timeout::Error
|
|
133
|
+
nil
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
122
137
|
def stop
|
|
123
138
|
@state_mutex.synchronize do
|
|
124
139
|
next unless @wait_thr
|
data/lib/mbeditor/version.rb
CHANGED