From nobody Sun May 19 17:35:54 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vj7CH5zFgz5KmhB; Sun, 19 May 2024 17:35:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vj7CG4tSjz4DZW; Sun, 19 May 2024 17:35:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716140154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S0mhNyOrsk9C1gp4YH8MV4UdVoBDUdoTQBj22oNTe94=; b=oZ9vtLobqWaLEaAAND0kgU1Xe/mQi6RA57vItRRx16Q4DwZnymvs9cZvWHMceIg9X/C5p8 4PXHigk0eCSVca1wxI/Zm+0ng90epIaHunqtty8SrobXtRD95K+/o19ZXcJgXegG9yXMk0 Fj6ZsRsvuZfhGXzmuSCViSJe2pYPpGItuTXJV0mX+GQDtZLKO5o4z4Dptm0E4e1f/BYWOG qz1qA6g3RfO5Y/eytNcO+Y0jslzyG0rRyhB8MTl3AZWwoQmMy0C52xnTSmUiWpZ/+YoMiS JSYUYAe8z2r/gi+6qmiqCa9pa6lPLXpAUt2wCB0v3Ztj9xpCQkvLWksmvAeKXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716140154; a=rsa-sha256; cv=none; b=IRPJby5MfwBvASewbiJ3HikBRSfArpNAYso61uywLiWms629esvpyvZOyEkS1K6KG1y3Jd D5a2Rx4/mEUc66GfMug8G2LLVNEUcZ8WXLOt47K45JT4Arsu1Ugh/mVB8JIHR6B8p4/bTY M/gmxSP8Xvmw1piNL91F02oK/ZzXEN7UywbMObc/JzpeHarItYKV6v+XwjPzLbV1dgWp05 H5kKbr5Ona+QwhfVrhLJbSklWK1xRqDzlEzL7vpkjXmZqDCCX2CeNILIGaWB3XSpm5qcES 6IVDrvz3B6M+H5YpeCsG/ryEd74ha6WBY8h7nI2g5qQNzMz35Kxxw+6lo2IvzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716140154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S0mhNyOrsk9C1gp4YH8MV4UdVoBDUdoTQBj22oNTe94=; b=SKQO4J5rta23uWnrI1G1mPeJWSJSoL0t1IIBCzNw2FupBwQskUHoQp01Q0Adc38ssQgq5L H4kWjXdBmS1DVrn6LwCZh5YKN2/MfgyFMwLC+94y3/eL+xtP+f586ykxzKzwVKgqA3/lYS 0GUYzFB3Lz6lJPqKXmT2ngFgXReKRTat9Hr+IiROuPIhlfwYnQQeWm6sA6exQWhjrwwf40 NwUnA3XS4RnWsNMaMw2J1j+mq6a9wIxI+KpSmmKMuT3jdl9KdZa4RdRANirgTRpH6cTnee lxOJSGiuE+utTUgJ9RTgXzY9zrxBQq8DcsG4Mrt/kb67DzhaaNFMnPreOKnpWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vj7CG4Trmz1JYf; Sun, 19 May 2024 17:35:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44JHZscm000647; Sun, 19 May 2024 17:35:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44JHZsM1000644; Sun, 19 May 2024 17:35:54 GMT (envelope-from git) Date: Sun, 19 May 2024 17:35:54 GMT Message-Id: <202405191735.44JHZsM1000644@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 60e289a279a1 - main - devel/rubygem-ruby-lsp: Update to 0.16.6 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 60e289a279a16d4ded7b5fe69d432ada5eb41d11 Auto-Submitted: auto-generated The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=60e289a279a16d4ded7b5fe69d432ada5eb41d11 commit 60e289a279a16d4ded7b5fe69d432ada5eb41d11 Author: Po-Chuan Hsieh AuthorDate: 2024-05-19 16:26:17 +0000 Commit: Po-Chuan Hsieh CommitDate: 2024-05-19 17:18:06 +0000 devel/rubygem-ruby-lsp: Update to 0.16.6 - Allow build with rubygem-prism 0.29.0 Changes: https://github.com/Shopify/ruby-lsp/releases Obtained from: https://github.com/Shopify/ruby-lsp/commit/e3c0f201239b56f47c5c6bdd3d034ea6b0bda5f9 https://github.com/Shopify/ruby-lsp/commit/70f7d59827d4e6c0c8c9ebb3aa85e0bdc07e25e2 --- devel/rubygem-ruby-lsp/Makefile | 5 +- devel/rubygem-ruby-lsp/distinfo | 6 +- devel/rubygem-ruby-lsp/files/patch-gemspec | 9 +- devel/rubygem-ruby-lsp/files/patch-prism | 215 +++++++++++++++++++---------- 4 files changed, 156 insertions(+), 79 deletions(-) diff --git a/devel/rubygem-ruby-lsp/Makefile b/devel/rubygem-ruby-lsp/Makefile index 74031bb8cf80..51551b245d06 100644 --- a/devel/rubygem-ruby-lsp/Makefile +++ b/devel/rubygem-ruby-lsp/Makefile @@ -1,6 +1,5 @@ PORTNAME= ruby-lsp -PORTVERSION= 0.16.4 -PORTREVISION= 1 +PORTVERSION= 0.16.6 CATEGORIES= devel rubygems MASTER_SITES= RG @@ -13,7 +12,7 @@ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE.txt RUN_DEPENDS= rubygem-language_server-protocol>=3.17.0<3.18:devel/rubygem-language_server-protocol \ - rubygem-prism>=0.22.0<0.27:textproc/rubygem-prism \ + rubygem-prism>=0.29.0<0.30:textproc/rubygem-prism \ rubygem-sorbet-runtime>=0.5.10782:devel/rubygem-sorbet-runtime USES= gem diff --git a/devel/rubygem-ruby-lsp/distinfo b/devel/rubygem-ruby-lsp/distinfo index 22f54338ab49..2631626f934a 100644 --- a/devel/rubygem-ruby-lsp/distinfo +++ b/devel/rubygem-ruby-lsp/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1713001208 -SHA256 (rubygem/ruby-lsp-0.16.4.gem) = 0120fb411469230019c8eaf16a0ec3e075f7a3b3acb87e1f67388b99ee9b248e -SIZE (rubygem/ruby-lsp-0.16.4.gem) = 86016 +TIMESTAMP = 1715843722 +SHA256 (rubygem/ruby-lsp-0.16.6.gem) = eefd337ca6ff51b5ccf8a6b82161fde1477a36e75d78295ad6294318db5495cc +SIZE (rubygem/ruby-lsp-0.16.6.gem) = 87040 diff --git a/devel/rubygem-ruby-lsp/files/patch-gemspec b/devel/rubygem-ruby-lsp/files/patch-gemspec index c2bad8bc2a23..819f6170860f 100644 --- a/devel/rubygem-ruby-lsp/files/patch-gemspec +++ b/devel/rubygem-ruby-lsp/files/patch-gemspec @@ -1,11 +1,14 @@ ---- ruby-lsp.gemspec.orig 2024-04-06 18:29:06 UTC +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.freeze, ["~> 3.17.0".freeze]) -- s.add_runtime_dependency(%q.freeze, [">= 0.22.0".freeze, "< 0.25".freeze]) -+ s.add_runtime_dependency(%q.freeze, [">= 0.22.0".freeze, "< 0.27".freeze]) +- s.add_runtime_dependency(%q.freeze, [">= 0.23.0".freeze, "< 0.28".freeze]) ++ s.add_runtime_dependency(%q.freeze, [">= 0.29.0".freeze, "< 0.30".freeze]) s.add_runtime_dependency(%q.freeze, [">= 0.5.10782".freeze]) end diff --git a/devel/rubygem-ruby-lsp/files/patch-prism b/devel/rubygem-ruby-lsp/files/patch-prism index 509624b3c918..f41efbe1ce42 100644 --- a/devel/rubygem-ruby-lsp/files/patch-prism +++ b/devel/rubygem-ruby-lsp/files/patch-prism @@ -1,81 +1,156 @@ -Obtained from: https://github.com/Shopify/ruby-lsp/pull/1953 +Obtained from: https://github.com/Shopify/ruby-lsp/commit/e3c0f201239b56f47c5c6bdd3d034ea6b0bda5f9 ---- lib/ruby_indexer/lib/ruby_indexer/collector.rb.orig 2024-04-20 14:51:21 UTC -+++ lib/ruby_indexer/lib/ruby_indexer/collector.rb -@@ -7,7 +7,7 @@ module RubyIndexer +--- 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) - LEAVE_EVENT = T.let(Object.new.freeze, Object) +- add_highlight(Constant::DocumentHighlightKind::READ, node.location) ++ add_highlight(Constant::DocumentHighlightKind::READ, node.name_loc) + end -- sig { params(index: Index, parse_result: Prism::ParseResult, file_path: String).void } -+ sig { params(index: Index, parse_result: Prism::ParseResult[Prism::ProgramNode], file_path: String).void } - def initialize(index, parse_result, file_path) - @index = index - @file_path = file_path ---- lib/ruby_lsp/document.rb.orig 2024-04-20 14:51:21 UTC -+++ lib/ruby_lsp/document.rb -@@ -8,7 +8,7 @@ module RubyLsp - - abstract! - -- sig { returns(Prism::ParseResult) } -+ sig { returns(Prism::ParseResult[Prism::ProgramNode]) } - attr_reader :parse_result - - sig { returns(String) } -@@ -31,7 +31,7 @@ module RubyLsp - @version = T.let(version, Integer) - @uri = T.let(uri, URI::Generic) - @needs_parsing = T.let(true, T::Boolean) -- @parse_result = T.let(parse, Prism::ParseResult) -+ @parse_result = T.let(parse, Prism::ParseResult[Prism::ProgramNode]) - end - - sig { returns(Prism::ProgramNode) } -@@ -93,7 +93,7 @@ module RubyLsp - @cache.clear - 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] = {} -- sig { abstract.returns(Prism::ParseResult) } -+ sig { abstract.returns(Prism::ParseResult[Prism::ProgramNode]) } - def parse; end +- 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) - sig { returns(T::Boolean) } ---- lib/ruby_lsp/internal.rb.orig 2024-04-20 14:51:21 UTC -+++ lib/ruby_lsp/internal.rb -@@ -19,6 +19,14 @@ require "language_server-protocol" - require "prism/visitor" - require "language_server-protocol" +- @response_builder.add_token(node.constant_path.location, :class, [:declaration]) ++ constant_path = node.constant_path -+# Prism v0.26.0 introduced generics for ParseResult, but it causes some problems so the intention is to remove it. -+# Once that is done, we can remove this patch. -+module Prism -+ class ParseResult -+ extend T::Generic -+ end -+end ++ 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 + - require "ruby-lsp" - require "ruby_lsp/base_server" - require "ruby_indexer/ruby_indexer" ---- lib/ruby_lsp/listeners/document_link.rb.orig 2024-04-20 14:51:21 UTC -+++ lib/ruby_lsp/listeners/document_link.rb -@@ -124,7 +124,7 @@ module RubyLsp - match = comment.location.slice.match(%r{source://.*#\d+$}) - return unless match ++ @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 -- uri = T.cast(URI(T.must(match[0])), URI::Source) -+ uri = T.cast(URI(match[0]), URI::Source) - gem_version = resolve_version(uri) - return if gem_version.nil? + sig { params(node: Prism::ModuleNode).void } + def on_module_node_enter(node) + return unless visible?(node, @range) ---- lib/ruby_lsp/ruby_document.rb.orig 2024-04-20 14:51:21 UTC -+++ lib/ruby_lsp/ruby_document.rb -@@ -3,7 +3,7 @@ module RubyLsp +- @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 - module RubyLsp - class RubyDocument < Document -- sig { override.returns(Prism::ParseResult) } -+ sig { override.returns(Prism::ParseResult[Prism::ProgramNode]) } - def parse - return @parse_result unless @needs_parsing + 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