ruby-lsp 0.23.1 → 0.23.2
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/VERSION +1 -1
- data/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb +59 -30
- data/lib/ruby_indexer/lib/ruby_indexer/index.rb +21 -10
- data/lib/ruby_indexer/lib/ruby_indexer/visibility_scope.rb +36 -0
- data/lib/ruby_indexer/ruby_indexer.rb +1 -0
- data/lib/ruby_indexer/test/index_test.rb +2 -1
- data/lib/ruby_indexer/test/instance_variables_test.rb +20 -0
- data/lib/ruby_indexer/test/method_test.rb +71 -8
- data/lib/ruby_lsp/base_server.rb +8 -13
- data/lib/ruby_lsp/document.rb +74 -19
- data/lib/ruby_lsp/erb_document.rb +5 -3
- data/lib/ruby_lsp/global_state.rb +9 -0
- data/lib/ruby_lsp/rbs_document.rb +2 -2
- data/lib/ruby_lsp/requests/code_action_resolve.rb +2 -6
- data/lib/ruby_lsp/requests/completion.rb +2 -1
- data/lib/ruby_lsp/requests/definition.rb +1 -1
- data/lib/ruby_lsp/requests/document_highlight.rb +1 -1
- data/lib/ruby_lsp/requests/hover.rb +1 -1
- data/lib/ruby_lsp/requests/prepare_rename.rb +1 -1
- data/lib/ruby_lsp/requests/references.rb +1 -1
- data/lib/ruby_lsp/requests/rename.rb +1 -1
- data/lib/ruby_lsp/requests/show_syntax_tree.rb +1 -4
- data/lib/ruby_lsp/requests/signature_help.rb +1 -1
- data/lib/ruby_lsp/ruby_document.rb +75 -6
- data/lib/ruby_lsp/server.rb +95 -81
- data/lib/ruby_lsp/store.rb +16 -12
- data/lib/ruby_lsp/type_inferrer.rb +39 -17
- data/lib/ruby_lsp/utils.rb +43 -0
- metadata +3 -2
    
        data/lib/ruby_lsp/utils.rb
    CHANGED
    
    | @@ -142,6 +142,20 @@ module RubyLsp | |
| 142 142 | 
             
                      ),
         | 
| 143 143 | 
             
                    )
         | 
| 144 144 | 
             
                  end
         | 
| 145 | 
            +
             | 
| 146 | 
            +
                  sig do
         | 
| 147 | 
            +
                    params(
         | 
| 148 | 
            +
                      uri: String,
         | 
| 149 | 
            +
                      diagnostics: T::Array[Interface::Diagnostic],
         | 
| 150 | 
            +
                      version: T.nilable(Integer),
         | 
| 151 | 
            +
                    ).returns(Notification)
         | 
| 152 | 
            +
                  end
         | 
| 153 | 
            +
                  def publish_diagnostics(uri, diagnostics, version: nil)
         | 
| 154 | 
            +
                    new(
         | 
| 155 | 
            +
                      method: "textDocument/publishDiagnostics",
         | 
| 156 | 
            +
                      params: Interface::PublishDiagnosticsParams.new(uri: uri, diagnostics: diagnostics, version: version),
         | 
| 157 | 
            +
                    )
         | 
| 158 | 
            +
                  end
         | 
| 145 159 | 
             
                end
         | 
| 146 160 |  | 
| 147 161 | 
             
                extend T::Sig
         | 
| @@ -155,6 +169,35 @@ module RubyLsp | |
| 155 169 | 
             
              class Request < Message
         | 
| 156 170 | 
             
                extend T::Sig
         | 
| 157 171 |  | 
| 172 | 
            +
                class << self
         | 
| 173 | 
            +
                  extend T::Sig
         | 
| 174 | 
            +
             | 
| 175 | 
            +
                  sig { params(id: Integer, pattern: T.any(Interface::RelativePattern, String), kind: Integer).returns(Request) }
         | 
| 176 | 
            +
                  def register_watched_files(
         | 
| 177 | 
            +
                    id,
         | 
| 178 | 
            +
                    pattern,
         | 
| 179 | 
            +
                    kind: Constant::WatchKind::CREATE | Constant::WatchKind::CHANGE | Constant::WatchKind::DELETE
         | 
| 180 | 
            +
                  )
         | 
| 181 | 
            +
                    new(
         | 
| 182 | 
            +
                      id: id,
         | 
| 183 | 
            +
                      method: "client/registerCapability",
         | 
| 184 | 
            +
                      params: Interface::RegistrationParams.new(
         | 
| 185 | 
            +
                        registrations: [
         | 
| 186 | 
            +
                          Interface::Registration.new(
         | 
| 187 | 
            +
                            id: "workspace/didChangeWatchedFiles",
         | 
| 188 | 
            +
                            method: "workspace/didChangeWatchedFiles",
         | 
| 189 | 
            +
                            register_options: Interface::DidChangeWatchedFilesRegistrationOptions.new(
         | 
| 190 | 
            +
                              watchers: [
         | 
| 191 | 
            +
                                Interface::FileSystemWatcher.new(glob_pattern: pattern, kind: kind),
         | 
| 192 | 
            +
                              ],
         | 
| 193 | 
            +
                            ),
         | 
| 194 | 
            +
                          ),
         | 
| 195 | 
            +
                        ],
         | 
| 196 | 
            +
                      ),
         | 
| 197 | 
            +
                    )
         | 
| 198 | 
            +
                  end
         | 
| 199 | 
            +
                end
         | 
| 200 | 
            +
             | 
| 158 201 | 
             
                sig { params(id: T.any(Integer, String), method: String, params: Object).void }
         | 
| 159 202 | 
             
                def initialize(id:, method:, params:)
         | 
| 160 203 | 
             
                  @id = id
         | 
    
        metadata
    CHANGED
    
    | @@ -1,13 +1,13 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: ruby-lsp
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.23. | 
| 4 | 
            +
              version: 0.23.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Shopify
         | 
| 8 8 | 
             
            bindir: exe
         | 
| 9 9 | 
             
            cert_chain: []
         | 
| 10 | 
            -
            date: 2025-01- | 
| 10 | 
            +
            date: 2025-01-08 00:00:00.000000000 Z
         | 
| 11 11 | 
             
            dependencies:
         | 
| 12 12 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 13 13 | 
             
              name: language_server-protocol
         | 
| @@ -106,6 +106,7 @@ files: | |
| 106 106 | 
             
            - lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb
         | 
| 107 107 | 
             
            - lib/ruby_indexer/lib/ruby_indexer/reference_finder.rb
         | 
| 108 108 | 
             
            - lib/ruby_indexer/lib/ruby_indexer/uri.rb
         | 
| 109 | 
            +
            - lib/ruby_indexer/lib/ruby_indexer/visibility_scope.rb
         | 
| 109 110 | 
             
            - lib/ruby_indexer/ruby_indexer.rb
         | 
| 110 111 | 
             
            - lib/ruby_indexer/test/class_variables_test.rb
         | 
| 111 112 | 
             
            - lib/ruby_indexer/test/classes_and_modules_test.rb
         |