git: f3ecda044594 - main - devel/rubygem-ruby-lsp: Update to 0.16.7
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 28 May 2024 10:24:18 UTC
The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=f3ecda044594f14f22ae7e4ac193baa3b7037381 commit f3ecda044594f14f22ae7e4ac193baa3b7037381 Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org> AuthorDate: 2024-05-28 10:01:26 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2024-05-28 10:21:46 +0000 devel/rubygem-ruby-lsp: Update to 0.16.7 Changes: https://github.com/Shopify/ruby-lsp/releases --- devel/rubygem-ruby-lsp/Makefile | 2 +- devel/rubygem-ruby-lsp/distinfo | 6 +- devel/rubygem-ruby-lsp/files/patch-gemspec | 14 --- devel/rubygem-ruby-lsp/files/patch-prism | 156 ----------------------------- 4 files changed, 4 insertions(+), 174 deletions(-) diff --git a/devel/rubygem-ruby-lsp/Makefile b/devel/rubygem-ruby-lsp/Makefile index 51551b245d06..be6174f4dd74 100644 --- a/devel/rubygem-ruby-lsp/Makefile +++ b/devel/rubygem-ruby-lsp/Makefile @@ -1,5 +1,5 @@ PORTNAME= ruby-lsp -PORTVERSION= 0.16.6 +PORTVERSION= 0.16.7 CATEGORIES= devel rubygems MASTER_SITES= RG diff --git a/devel/rubygem-ruby-lsp/distinfo b/devel/rubygem-ruby-lsp/distinfo index 2631626f934a..7d4f2447df92 100644 --- a/devel/rubygem-ruby-lsp/distinfo +++ b/devel/rubygem-ruby-lsp/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1715843722 -SHA256 (rubygem/ruby-lsp-0.16.6.gem) = eefd337ca6ff51b5ccf8a6b82161fde1477a36e75d78295ad6294318db5495cc -SIZE (rubygem/ruby-lsp-0.16.6.gem) = 87040 +TIMESTAMP = 1716448802 +SHA256 (rubygem/ruby-lsp-0.16.7.gem) = c3d555463f04b50288afed9514a33a0df3e79b12f5c7507a533134a7c230601c +SIZE (rubygem/ruby-lsp-0.16.7.gem) = 88576 diff --git a/devel/rubygem-ruby-lsp/files/patch-gemspec b/devel/rubygem-ruby-lsp/files/patch-gemspec deleted file mode 100644 index 819f6170860f..000000000000 --- a/devel/rubygem-ruby-lsp/files/patch-gemspec +++ /dev/null @@ -1,14 +0,0 @@ -Obtained from: https://github.com/Shopify/ruby-lsp/commit/e3c0f201239b56f47c5c6bdd3d034ea6b0bda5f9 - https://github.com/Shopify/ruby-lsp/commit/70f7d59827d4e6c0c8c9ebb3aa85e0bdc07e25e2 - ---- ruby-lsp.gemspec.orig 2024-05-17 18:30:23 UTC -+++ ruby-lsp.gemspec -@@ -24,7 +24,7 @@ Gem::Specification.new do |s| - s.specification_version = 4 - - s.add_runtime_dependency(%q<language_server-protocol>.freeze, ["~> 3.17.0".freeze]) -- s.add_runtime_dependency(%q<prism>.freeze, [">= 0.23.0".freeze, "< 0.28".freeze]) -+ s.add_runtime_dependency(%q<prism>.freeze, [">= 0.29.0".freeze, "< 0.30".freeze]) - s.add_runtime_dependency(%q<sorbet-runtime>.freeze, [">= 0.5.10782".freeze]) - end - diff --git a/devel/rubygem-ruby-lsp/files/patch-prism b/devel/rubygem-ruby-lsp/files/patch-prism deleted file mode 100644 index f41efbe1ce42..000000000000 --- a/devel/rubygem-ruby-lsp/files/patch-prism +++ /dev/null @@ -1,156 +0,0 @@ -Obtained from: https://github.com/Shopify/ruby-lsp/commit/e3c0f201239b56f47c5c6bdd3d034ea6b0bda5f9 - ---- lib/core_ext/uri.rb.orig 2024-05-17 18:30:23 UTC -+++ lib/core_ext/uri.rb -@@ -11,6 +11,9 @@ module URI - # On Windows, if the path begins with the disk name, we need to add a leading slash to make it a valid URI - escaped_path = if /^[A-Z]:/i.match?(path) - DEFAULT_PARSER.escape("/#{path}") -+ elsif path.start_with?("//?/") -+ # Some paths on Windows start with "//?/". This is a special prefix that allows for long file paths -+ DEFAULT_PARSER.escape(path.delete_prefix("//?")) - else - DEFAULT_PARSER.escape(path) - end ---- lib/ruby_lsp/listeners/document_highlight.rb.orig 2024-05-17 18:30:23 UTC -+++ lib/ruby_lsp/listeners/document_highlight.rb -@@ -271,7 +271,7 @@ module RubyLsp - def on_constant_path_node_enter(node) - return unless matches?(node, CONSTANT_PATH_NODES) - -- add_highlight(Constant::DocumentHighlightKind::READ, node.location) -+ add_highlight(Constant::DocumentHighlightKind::READ, node.name_loc) - end - - sig { params(node: Prism::ConstantReadNode).void } ---- lib/ruby_lsp/listeners/document_link.rb.orig 2024-05-17 18:30:23 UTC -+++ lib/ruby_lsp/listeners/document_link.rb -@@ -30,7 +30,7 @@ module RubyLsp - lookup[spec.name] = {} - lookup[spec.name][spec.version.to_s] = {} - -- Dir.glob("**/*.rb", base: "#{spec.full_gem_path}/").each do |path| -+ Dir.glob("**/*.rb", base: "#{spec.full_gem_path.delete_prefix("//?/")}/").each do |path| - lookup[spec.name][spec.version.to_s][path] = "#{spec.full_gem_path}/#{path}" - end - end ---- lib/ruby_lsp/listeners/semantic_highlighting.rb.orig 2024-05-17 18:30:23 UTC -+++ lib/ruby_lsp/listeners/semantic_highlighting.rb -@@ -58,6 +58,7 @@ module RubyLsp - :on_constant_operator_write_node_enter, - :on_constant_or_write_node_enter, - :on_constant_target_node_enter, -+ :on_constant_path_node_enter, - :on_local_variable_and_write_node_enter, - :on_local_variable_operator_write_node_enter, - :on_local_variable_or_write_node_enter, -@@ -302,17 +303,64 @@ module RubyLsp - def on_class_node_enter(node) - return unless visible?(node, @range) - -- @response_builder.add_token(node.constant_path.location, :class, [:declaration]) -+ constant_path = node.constant_path - -+ if constant_path.is_a?(Prism::ConstantReadNode) -+ @response_builder.add_token(constant_path.location, :class, [:declaration]) -+ else -+ each_constant_path_part(constant_path) do |part| -+ loc = case part -+ when Prism::ConstantPathNode -+ part.name_loc -+ when Prism::ConstantReadNode -+ part.location -+ end -+ next unless loc -+ -+ @response_builder.add_token(loc, :class, [:declaration]) -+ end -+ end -+ - superclass = node.superclass -- @response_builder.add_token(superclass.location, :class) if superclass -+ -+ if superclass.is_a?(Prism::ConstantReadNode) -+ @response_builder.add_token(superclass.location, :class) -+ elsif superclass -+ each_constant_path_part(superclass) do |part| -+ loc = case part -+ when Prism::ConstantPathNode -+ part.name_loc -+ when Prism::ConstantReadNode -+ part.location -+ end -+ next unless loc -+ -+ @response_builder.add_token(loc, :class) -+ end -+ end - end - - sig { params(node: Prism::ModuleNode).void } - def on_module_node_enter(node) - return unless visible?(node, @range) - -- @response_builder.add_token(node.constant_path.location, :namespace, [:declaration]) -+ constant_path = node.constant_path -+ -+ if constant_path.is_a?(Prism::ConstantReadNode) -+ @response_builder.add_token(constant_path.location, :namespace, [:declaration]) -+ else -+ each_constant_path_part(constant_path) do |part| -+ loc = case part -+ when Prism::ConstantPathNode -+ part.name_loc -+ when Prism::ConstantReadNode -+ part.location -+ end -+ next unless loc -+ -+ @response_builder.add_token(loc, :namespace, [:declaration]) -+ end -+ end - end - - sig { params(node: Prism::ImplicitNode).void } -@@ -325,6 +373,14 @@ module RubyLsp - sig { params(node: Prism::ImplicitNode).void } - def on_implicit_node_leave(node) - @inside_implicit_node = false -+ end -+ -+ sig { params(node: Prism::ConstantPathNode).void } -+ def on_constant_path_node_enter(node) -+ return if @inside_implicit_node -+ return unless visible?(node, @range) -+ -+ @response_builder.add_token(node.name_loc, :namespace) - end - - private ---- lib/ruby_lsp/requests/support/common.rb.orig 2024-05-17 18:30:23 UTC -+++ lib/ruby_lsp/requests/support/common.rb -@@ -167,6 +167,24 @@ module RubyLsp - constant_name(path) - end - end -+ -+ # Iterates over each part of a constant path, so that we can easily push response items for each section of the -+ # name. For example, for `Foo::Bar::Baz`, this method will invoke the block with `Foo`, then `Bar` and finally -+ # `Baz`. -+ sig do -+ params( -+ node: Prism::Node, -+ block: T.proc.params(part: Prism::Node).void, -+ ).void -+ end -+ def each_constant_path_part(node, &block) -+ current = T.let(node, T.nilable(Prism::Node)) -+ -+ while current.is_a?(Prism::ConstantPathNode) -+ block.call(current) -+ current = current.parent -+ end -+ end - end - end - end