ruby-lsp-typeprof 0.1.1 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 362ea4289e3e11f4e540ae7704ccf26f5da5331003c940d307bff0f0cd1b78d1
4
- data.tar.gz: 34e69521810c62ab1fec6375b5b40f32678477e8575098a7e1411aafeb989fad
3
+ metadata.gz: e970087c448a7fdf79627b8023da3d4172f5882709cfaa22ceebc61d627cae39
4
+ data.tar.gz: a2ab61b7d4a2b16db5b3e8d4788b016f92c258a083f1d39b3d697f672678ca86
5
5
  SHA512:
6
- metadata.gz: 461e4f0e66eec8fbf4fac406a4939796fbed526030a1e82b887eae2722858a13a319ca83b80ee62d71dbc6878133e1e701fee7212ec4985715ceccd61f4c71fb
7
- data.tar.gz: 9077bc7fe7f67ffbe447f2bb38b78614fca73b0a5edb6624cbba77878db37c1b9cc81d704253749acdc890863e0e1568ddf5c2278bac1b2bca86f95de8d9d806
6
+ metadata.gz: 9b2fc7138694f993b4e80f98fc3496a914cbe4d03ae67bddc5a16ff6792709561a8f51a42d45b0041b3dca45975ef1cb677eb908503c8584334ae603148e2b38
7
+ data.tar.gz: 97a2e1aaf9d0e9c6fec4211764dbd26ea5a0e862b3ee3b099e6d863ae48da35e6edbfde577edda4dca8e1b0510221683317f7116ec198f3d22587876e58eb19a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [v0.3.0](https://github.com/sinsoku/ruby-lsp-typeprof/compare/v0.2.0...v0.3.0) - 2026-05-08
2
+ - feat: Add enabled setting to toggle the entire add-on by @sinsoku in https://github.com/sinsoku/ruby-lsp-typeprof/pull/5
3
+
4
+ ## [v0.2.0](https://github.com/sinsoku/ruby-lsp-typeprof/compare/v0.1.1...v0.2.0) - 2026-05-03
5
+ - feat: Add enableCodeLens setting via addonSettings by @sinsoku in https://github.com/sinsoku/ruby-lsp-typeprof/pull/4
6
+
1
7
  ## [v0.1.1](https://github.com/sinsoku/ruby-lsp-typeprof/compare/v0.1.0...v0.1.1) - 2026-04-27
2
8
 
3
9
  ## [0.1.0] - 2026-04-27
data/README.md CHANGED
@@ -17,6 +17,38 @@ end
17
17
 
18
18
  After running `bundle install`, restart Ruby LSP.
19
19
 
20
+ ## Configuration
21
+
22
+ The add-on reads its settings from Ruby LSP's `addonSettings` mechanism.
23
+ Configure them in VS Code's `settings.json`:
24
+
25
+ ```jsonc
26
+ {
27
+ "rubyLsp.addonSettings": {
28
+ "TypeProf": {
29
+ "enabled": false,
30
+ "enableCodeLens": false
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ You can place this configuration in either:
37
+
38
+ - **Workspace settings** (`.vscode/settings.json` at the repository root) —
39
+ applies only to this project.
40
+ - **User settings** — applies to every workspace. See
41
+ [User and Workspace Settings](https://code.visualstudio.com/docs/configure/settings)
42
+ for the file location on each OS.
43
+
44
+ | Key | Type | Default | Description |
45
+ | --- | --- | --- | --- |
46
+ | `enabled` | boolean | `true` | Master switch. When `false`, the add-on skips loading TypeProf entirely and disables every feature. |
47
+ | `enableCodeLens` | boolean | `true` | Show inferred type signatures as code lens above method definitions. Has no effect when `enabled` is `false`. |
48
+
49
+ After changing the setting, restart Ruby LSP via the "Ruby LSP: Restart"
50
+ command for it to take effect.
51
+
20
52
  ## Development
21
53
 
22
54
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -13,11 +13,18 @@ module RubyLsp
13
13
  super
14
14
  @service = nil
15
15
  @mutex = Mutex.new
16
+ @enabled = true
17
+ @code_lens_enabled = true
16
18
  end
17
19
 
18
20
  def activate(global_state, _outgoing_queue)
21
+ settings = global_state.settings_for_addon(name)
22
+ @enabled = settings&.dig(:enabled) != false
23
+ return unless @enabled
24
+
19
25
  require "typeprof"
20
26
 
27
+ @code_lens_enabled = settings&.dig(:enableCodeLens) != false
21
28
  @service = build_service(global_state.workspace_path)
22
29
  rescue StandardError => e
23
30
  warn "ruby-lsp-typeprof: Failed to activate: #{e.message}"
@@ -37,6 +44,7 @@ module RubyLsp
37
44
 
38
45
  def create_code_lens_listener(response_builder, uri, dispatcher)
39
46
  return unless @service
47
+ return unless @code_lens_enabled
40
48
 
41
49
  CodeLensListener.new(response_builder, uri, dispatcher, @service, @mutex)
42
50
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RubyLsp
4
4
  module Typeprof
5
- VERSION = "0.1.1"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lsp-typeprof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takumi Shotoku
@@ -60,8 +60,8 @@ licenses:
60
60
  - MIT
61
61
  metadata:
62
62
  homepage_uri: https://github.com/sinsoku/ruby-lsp-typeprof
63
- source_code_uri: https://github.com/sinsoku/ruby-lsp-typeprof/tree/v0.1.1
64
- changelog_uri: https://github.com/sinsoku/ruby-lsp-typeprof/blob/v0.1.1/CHANGELOG.md
63
+ source_code_uri: https://github.com/sinsoku/ruby-lsp-typeprof/tree/v0.3.0
64
+ changelog_uri: https://github.com/sinsoku/ruby-lsp-typeprof/blob/v0.3.0/CHANGELOG.md
65
65
  rubygems_mfa_required: 'true'
66
66
  rdoc_options: []
67
67
  require_paths: