Skip to content

Commit bf99bb8

Browse files
committed
Add the typeprof.enableToggleButton notification
The toggle button is not displayed in vscode-typeprof because there is no `typeprof.enableToggleButton` notification. refs: https://github.com/ruby/vscode-typeprof/blob/7431f0ea6775e5013fb47bc96b74ad5d4d91584a/src/extension.ts#L287-L289 This notification was in v0.21.11 but is no longer there. refs: https://github.com/ruby/typeprof/blob/v0.21.11/lib/typeprof/lsp.rb#L355 Add a notification to display the toggle button.
1 parent 8d796e0 commit bf99bb8

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

lib/typeprof/lsp/messages.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def run
137137
text = Text.new(path, text, version)
138138
@server.open_texts[uri] = text
139139
@server.update_file(text.path, text.string)
140+
notify("typeprof.enableToggleButton")
140141
@server.send_request("workspace/codeLens/refresh")
141142
@server.publish_updated_diagnostics
142143
end

test/lsp/lsp_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def foo(nnn)
9494
END
9595
)
9696

97+
expect_notification("typeprof.enableToggleButton") {|json| }
9798
expect_request("workspace/codeLens/refresh") {|json| }
9899

99100
notify(
@@ -116,6 +117,7 @@ def foo(nnn)
116117
END
117118
)
118119

120+
expect_notification("typeprof.enableToggleButton") {|json| }
119121
expect_request("workspace/codeLens/refresh") {|json| }
120122

121123
id = request(
@@ -165,6 +167,7 @@ def foo(nnn)
165167
END
166168
)
167169

170+
expect_notification("typeprof.enableToggleButton") {|json| }
168171
expect_request("workspace/codeLens/refresh") {|json| }
169172
expect_notification("textDocument/publishDiagnostics") do |json|
170173
assert_equal({
@@ -195,6 +198,7 @@ def check(nnn)
195198
end
196199
END
197200
)
201+
expect_notification("typeprof.enableToggleButton") {|json| }
198202
expect_request("workspace/codeLens/refresh") {|json| }
199203

200204
notify(
@@ -204,6 +208,7 @@ def check(nnn)
204208
END
205209
)
206210

211+
expect_notification("typeprof.enableToggleButton") {|json| }
207212
expect_request("workspace/codeLens/refresh") {|json| }
208213
expect_notification("textDocument/publishDiagnostics") do |json|
209214
assert_equal({
@@ -263,6 +268,7 @@ def test(x)
263268
END
264269
)
265270

271+
expect_notification("typeprof.enableToggleButton") {|json| }
266272
expect_request("workspace/codeLens/refresh") {|json| }
267273

268274
id = request(

0 commit comments

Comments
 (0)