From nobody Tue Nov 14 17:21:47 2023 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 4SVClJ4cwZz51ZNl; Tue, 14 Nov 2023 17:21:48 +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 4SVClJ2lNYz4g2B; Tue, 14 Nov 2023 17:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699982508; 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=KSYCANQEkXDO3Q6gUl0WmcGC3bnDgjwGnyrSMkcp4sM=; b=qVsznS7q4baJ6ALCCag6061DcgrCLwM3tozjuJ3zpluXm4SfrgxECkqwIYrQHSHKzau28G CkLPVWYtQU8V6yr6XMn61/kE8XHdLf0h4Fm8uCqUPE9k3jYQy3QJmOFY0ZoXCPGSHzj7gS jb54h8T/6MNMuIvwgPh4XtxhI39RSvLtM0ADaQYUQVvbTM2Ywn/z62/nzXnkby36PxzQwY 8MzyBAHL0sDx0O4DutL//xJ8WkCNq4QWjsWJojjwpKC7gwJJbigMR2/YkHZ2boctG1q/JY cRxdEI6siCcpw7flqfoMuVnrjO7TsWY5Iz3AFqMqeyzbOg4xrR8WHVl1V2Jffw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699982508; 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=KSYCANQEkXDO3Q6gUl0WmcGC3bnDgjwGnyrSMkcp4sM=; b=pwGhyBT443byNdJxKtMaFlbKRvJUP6wMCEyNWbo0UNzbz/MEBJm3N3odc12bN+Vzu5FXUN 8DIX2QuzwYtsEjKKHCmxHk9lh0OQ9s++Sorw8Tqho9ZYLqFeMbPaikyZvKRp9D1te/WUMv teNzJiOuesS/dEWKWKMz3GMKTioK4XcfMw5lIekCpGnkfazesr/3Fdi+T07cAUBaAPkyDh T1mL/p5is7MCZ3MPwnvPWps/WDcAB40WD7w6k6ZTUjgNHHdHJfBVDWFbx5nP3QBEW+Y6vT USdWtrQ2Rp97+1hOwrcrhn7mWmj3UvdDC8/L0NAEr12WKOv1rrtI5zojJkjX7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699982508; a=rsa-sha256; cv=none; b=My8gsQ3CAOV2s2/t3fIQltYUN7YG0MyGK9Rm6wCvTe2TwCpBx9D+lZLoI9IkRGLXKfneUt NEJbNd7EokeSDLaIlU6Pk4dtlPojzmHlD6EZg5eeCb1M6ytFB74jXv9f3THNZF1OGkRrO4 K5G2bgvw/zlI01GA/NMF1sl0YZifaus26J+/u5YhGo1rXkqplk2p7gtPSU990S2C+8Wsns /kfrfrj4eh79sWYRo2UdOrwoSaoYVRA/uPaBmXT1HV2sjEbbxE25AcJ6d7gyoOV3PXyFIq z9jlY0enV+Ibq+3ca83KRAEio6AHKs/7tgnLPbeXHAIfn7Yv+S6ERMwR10qIeA== 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 4SVClJ0PC5zxkd; Tue, 14 Nov 2023 17:21:48 +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 3AEHLllO077770; Tue, 14 Nov 2023 17:21:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AEHLl8g077767; Tue, 14 Nov 2023 17:21:47 GMT (envelope-from git) Date: Tue, 14 Nov 2023 17:21:47 GMT Message-Id: <202311141721.3AEHLl8g077767@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: 75838343ae56 - main - devel/rubygem-ruby-lsp: Allow build with rubygem-prism 0.17.1+ 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: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: 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: 75838343ae565b6a9f75bff108395f90f7503ae6 Auto-Submitted: auto-generated The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=75838343ae565b6a9f75bff108395f90f7503ae6 commit 75838343ae565b6a9f75bff108395f90f7503ae6 Author: Po-Chuan Hsieh AuthorDate: 2023-11-14 16:42:59 +0000 Commit: Po-Chuan Hsieh CommitDate: 2023-11-14 17:16:24 +0000 devel/rubygem-ruby-lsp: Allow build with rubygem-prism 0.17.1+ - Bump PORTREVISION for package change Obtained from: https://github.com/Shopify/ruby-lsp/commit/8b5a311a4bdc1a73d96c5416a8a8854d98e2c4f3 --- devel/rubygem-ruby-lsp/Makefile | 3 +- devel/rubygem-ruby-lsp/files/patch-prism | 178 +++++++++++++++++++++++++++++++ 2 files changed, 180 insertions(+), 1 deletion(-) diff --git a/devel/rubygem-ruby-lsp/Makefile b/devel/rubygem-ruby-lsp/Makefile index 6e4d34d344fa..01ce5d3b00ca 100644 --- a/devel/rubygem-ruby-lsp/Makefile +++ b/devel/rubygem-ruby-lsp/Makefile @@ -1,5 +1,6 @@ PORTNAME= ruby-lsp PORTVERSION= 0.12.2 +PORTREVISION= 1 CATEGORIES= devel rubygems MASTER_SITES= RG @@ -12,7 +13,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.15.1<0.16:textproc/rubygem-prism \ + rubygem-prism>=0.17.1<0.18:textproc/rubygem-prism \ rubygem-sorbet-runtime>=0.5.5685:devel/rubygem-sorbet-runtime USES= gem diff --git a/devel/rubygem-ruby-lsp/files/patch-prism b/devel/rubygem-ruby-lsp/files/patch-prism new file mode 100644 index 000000000000..184eb8bf126c --- /dev/null +++ b/devel/rubygem-ruby-lsp/files/patch-prism @@ -0,0 +1,178 @@ +Obtained from: https://github.com/Shopify/ruby-lsp/commit/8b5a311a4bdc1a73d96c5416a8a8854d98e2c4f3 + +--- lib/ruby_indexer/lib/ruby_indexer/entry.rb.orig 2023-11-05 06:57:55 UTC ++++ lib/ruby_indexer/lib/ruby_indexer/entry.rb +@@ -136,8 +136,9 @@ module RubyIndexer + case node + when Prism::RequiredParameterNode + node.name +- when Prism::RequiredDestructuredParameterNode +- names = node.parameters.map { |parameter_node| parameter_name(parameter_node) } ++ when Prism::MultiTargetNode ++ names = [*node.lefts, *node.rest, *node.rights].map { |parameter_node| parameter_name(parameter_node) } ++ + names_with_commas = names.join(", ") + :"(#{names_with_commas})" + end +--- lib/ruby_indexer/lib/ruby_indexer/visitor.rb.orig 2023-11-05 06:57:55 UTC ++++ lib/ruby_indexer/lib/ruby_indexer/visitor.rb +@@ -35,7 +35,7 @@ module RubyIndexer + value = node.value + values = value.is_a?(Prism::ArrayNode) && value.opening_loc ? value.elements : [] + +- node.targets.each_with_index do |target, i| ++ [*node.lefts, *node.rest, *node.rights].each_with_index do |target, i| + current_value = values[i] + # The moment we find a splat on the right hand side of the assignment, we can no longer figure out which value + # gets assigned to what +--- lib/ruby_lsp/requests/code_action_resolve.rb.orig 2023-11-05 06:57:55 UTC ++++ lib/ruby_lsp/requests/code_action_resolve.rb +@@ -87,15 +87,19 @@ module RubyLsp + :start, + :line, + ) && closest_node_loc.end_line - 1 >= source_range.dig(:end, :line) +- indentation_line = closest_node_loc.start_line - 1 +- target_line = indentation_line ++ indentation_line_number = closest_node_loc.start_line - 1 ++ target_line = indentation_line_number + else + target_line = closest_node_loc.end_line +- indentation_line = closest_node_loc.end_line - 1 ++ indentation_line_number = closest_node_loc.end_line - 1 + end + + lines = @document.source.lines +- indentation = T.must(T.must(lines[indentation_line])[/\A */]).size ++ ++ indentation_line = lines[indentation_line_number] ++ return Error::InvalidTargetRange unless indentation_line ++ ++ indentation = T.must(indentation_line[/\A */]).size + + target_range = { + start: { line: target_line, character: indentation }, +--- lib/ruby_lsp/requests/document_highlight.rb.orig 2023-11-05 06:57:55 UTC ++++ lib/ruby_lsp/requests/document_highlight.rb +@@ -97,7 +97,8 @@ module RubyLsp + Prism::LocalVariableWriteNode, + Prism::BlockParameterNode, + Prism::RequiredParameterNode, +- Prism::KeywordParameterNode, ++ Prism::RequiredKeywordParameterNode, ++ Prism::OptionalKeywordParameterNode, + Prism::RestParameterNode, + Prism::OptionalParameterNode, + Prism::KeywordRestParameterNode, +@@ -137,8 +138,9 @@ module RubyLsp + Prism::ClassVariableReadNode, Prism::ClassVariableTargetNode, Prism::ClassVariableWriteNode, + Prism::LocalVariableAndWriteNode, Prism::LocalVariableOperatorWriteNode, Prism::LocalVariableOrWriteNode, + Prism::LocalVariableReadNode, Prism::LocalVariableTargetNode, Prism::LocalVariableWriteNode, +- Prism::CallNode, Prism::BlockParameterNode, Prism::KeywordParameterNode, Prism::KeywordRestParameterNode, +- Prism::OptionalParameterNode, Prism::RequiredParameterNode, Prism::RestParameterNode ++ Prism::CallNode, Prism::BlockParameterNode, Prism::RequiredKeywordParameterNode, ++ Prism::RequiredKeywordParameterNode, Prism::KeywordRestParameterNode, Prism::OptionalParameterNode, ++ Prism::RequiredParameterNode, Prism::RestParameterNode + target + end + +@@ -171,7 +173,8 @@ module RubyLsp + :on_constant_path_and_write_node_enter, + :on_constant_path_operator_write_node_enter, + :on_local_variable_write_node_enter, +- :on_keyword_parameter_node_enter, ++ :on_required_keyword_parameter_node_enter, ++ :on_optional_keyword_parameter_node_enter, + :on_rest_parameter_node_enter, + :on_optional_parameter_node_enter, + :on_keyword_rest_parameter_node_enter, +@@ -359,13 +362,20 @@ module RubyLsp + add_highlight(Constant::DocumentHighlightKind::WRITE, node.name_loc) + end + +- sig { params(node: Prism::KeywordParameterNode).void } +- def on_keyword_parameter_node_enter(node) ++ sig { params(node: Prism::RequiredKeywordParameterNode).void } ++ def on_required_keyword_parameter_node_enter(node) + return unless matches?(node, LOCAL_NODES) + + add_highlight(Constant::DocumentHighlightKind::WRITE, node.name_loc) + end + ++ sig { params(node: Prism::OptionalKeywordParameterNode).void } ++ def on_optional_keyword_parameter_node_enter(node) ++ return unless matches?(node, LOCAL_NODES) ++ ++ add_highlight(Constant::DocumentHighlightKind::WRITE, node.name_loc) ++ end ++ + sig { params(node: Prism::RestParameterNode).void } + def on_rest_parameter_node_enter(node) + return unless matches?(node, LOCAL_NODES) +@@ -551,8 +561,8 @@ module RubyLsp + Prism::ClassVariableTargetNode, Prism::ClassVariableWriteNode, Prism::LocalVariableAndWriteNode, + Prism::LocalVariableOperatorWriteNode, Prism::LocalVariableOrWriteNode, Prism::LocalVariableReadNode, + Prism::LocalVariableTargetNode, Prism::LocalVariableWriteNode, Prism::DefNode, Prism::BlockParameterNode, +- Prism::KeywordParameterNode, Prism::KeywordRestParameterNode, Prism::OptionalParameterNode, +- Prism::RequiredParameterNode, Prism::RestParameterNode ++ Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode, Prism::KeywordRestParameterNode, ++ Prism::OptionalParameterNode, Prism::RequiredParameterNode, Prism::RestParameterNode + + node.name.to_s + when Prism::CallNode +--- lib/ruby_lsp/requests/folding_ranges.rb.orig 2023-11-05 06:57:55 UTC ++++ lib/ruby_lsp/requests/folding_ranges.rb +@@ -94,7 +94,7 @@ module RubyLsp + opening_loc = node.opening_loc + closing_loc = node.closing_loc + +- add_lines_range(opening_loc.start_line, closing_loc.end_line - 1) if opening_loc && closing_loc ++ add_lines_range(opening_loc.start_line, closing_loc.start_line - 1) if opening_loc && closing_loc + end + + sig { params(node: Prism::ArrayNode).void } +--- lib/ruby_lsp/requests/semantic_highlighting.rb.orig 2023-11-05 06:57:55 UTC ++++ lib/ruby_lsp/requests/semantic_highlighting.rb +@@ -135,7 +135,8 @@ module RubyLsp + :on_local_variable_write_node_enter, + :on_local_variable_read_node_enter, + :on_block_parameter_node_enter, +- :on_keyword_parameter_node_enter, ++ :on_required_keyword_parameter_node_enter, ++ :on_optional_keyword_parameter_node_enter, + :on_keyword_rest_parameter_node_enter, + :on_optional_parameter_node_enter, + :on_required_parameter_node_enter, +@@ -252,11 +253,18 @@ module RubyLsp + @current_scope << name.to_sym if name + end + +- sig { params(node: Prism::KeywordParameterNode).void } +- def on_keyword_parameter_node_enter(node) +- name = node.name +- @current_scope << name.to_s.delete_suffix(":").to_sym if name ++ sig { params(node: Prism::RequiredKeywordParameterNode).void } ++ def on_required_keyword_parameter_node_enter(node) ++ @current_scope << node.name ++ return unless visible?(node, @range) + ++ location = node.name_loc ++ add_token(location.copy(length: location.length - 1), :parameter) ++ end ++ ++ sig { params(node: Prism::OptionalKeywordParameterNode).void } ++ def on_optional_keyword_parameter_node_enter(node) ++ @current_scope << node.name + return unless visible?(node, @range) + + location = node.name_loc +--- ruby-lsp.gemspec.orig 2023-11-05 06:57:55 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"]) +- s.add_runtime_dependency(%q.freeze, [">= 0.15.1", "< 0.16"]) ++ s.add_runtime_dependency(%q.freeze, [">= 0.17.1", "< 0.18"]) + s.add_runtime_dependency(%q.freeze, [">= 0.5.5685"]) + end +