From dad9e534007036cf8c9abbb11c048f452fa2704f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 10 Nov 2024 00:13:26 +0000 Subject: [PATCH 1/2] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'neorocks': 'github:nvim-neorocks/neorocks/d7d0bac66ca4712d40bf8ad30a79ba2353bcde7a?narHash=sha256-50Brt47i3P1DE/3mXw5NQZnW2ObI86xMwWOT7V%2Ba1ck%3D' (2024-11-02) → 'github:nvim-neorocks/neorocks/c1b3c1188de859d12a610a1c46d03558cc763634?narHash=sha256-oyDV65S7QY7uhzb2sADIvwPPkw2vwhqV8CIv0WAt1Kg%3D' (2024-11-09) • Updated input 'neorocks/git-hooks': 'github:cachix/git-hooks.nix/af8a16fe5c264f5e9e18bcee2859b40a656876cf?narHash=sha256-W1MIJpADXQCgosJZT8qBYLRuZls2KSiKdpnTVdKBuvU%3D' (2024-10-30) → 'github:cachix/git-hooks.nix/d70155fdc00df4628446352fc58adc640cd705c2?narHash=sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF%2B06nOg%3D' (2024-11-05) • Updated input 'neorocks/git-hooks/nixpkgs': 'github:NixOS/nixpkgs/9693852a2070b398ee123a329e68f0dab5526681?narHash=sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs%3D' (2024-06-22) → 'github:NixOS/nixpkgs/a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc?narHash=sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE%3D' (2024-11-05) • Updated input 'neorocks/git-hooks/nixpkgs-stable': 'github:NixOS/nixpkgs/194846768975b7ad2c4988bdb82572c00222c0d7?narHash=sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo%3D' (2024-07-07) → 'github:NixOS/nixpkgs/d063c1dd113c91ab27959ba540c0d9753409edf3?narHash=sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo%3D' (2024-11-04) • Updated input 'neorocks/neovim-nightly': 'github:nix-community/neovim-nightly-overlay/f35afbe60a4ff71fd65fec3839fc38943f961951?narHash=sha256-FIdIaN7f6karwtDV65VXTV8VThNrR63nwykfgXpm4p4%3D' (2024-10-28) → 'github:nix-community/neovim-nightly-overlay/702364e6ec794961483eba5220ca531917d03784?narHash=sha256-8u8k3hnU5OxlXfhDLD3XEwAqv/M9Tb5USLCEPvXCPcM%3D' (2024-11-09) • Updated input 'neorocks/neovim-nightly/flake-parts': 'github:hercules-ci/flake-parts/3d04084d54bedc3d6b8b736c70ef449225c361b1?narHash=sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0%3D' (2024-10-01) → 'github:hercules-ci/flake-parts/506278e768c2a08bec68eb62932193e341f55c90?narHash=sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS%2Bb4tfNFCwE%3D' (2024-11-01) • Updated input 'neorocks/neovim-nightly/git-hooks': 'github:cachix/git-hooks.nix/3c3e88f0f544d6bb54329832616af7eb971b6be6?narHash=sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ%2B/nVtALHIciX/BI%3D' (2024-10-16) → 'github:cachix/git-hooks.nix/d70155fdc00df4628446352fc58adc640cd705c2?narHash=sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF%2B06nOg%3D' (2024-11-05) • Updated input 'neorocks/neovim-nightly/hercules-ci-effects': 'github:hercules-ci/hercules-ci-effects/dba4367b9a9d9615456c430a6d6af716f6e84cef?narHash=sha256-MHHrHasTngp7EYQOObHJ1a/IsRF%2BwodHqOckhH6uZbk%3D' (2024-08-29) → 'github:hercules-ci/hercules-ci-effects/b89ac4d66d618b915b1f0a408e2775fe3821d141?narHash=sha256-mnynlrPeiW0nUQ8KGZHb3WyxAxA3Ye/BH8gMjdoKP6E%3D' (2024-11-06) • Updated input 'neorocks/neovim-nightly/neovim-src': 'github:neovim/neovim/852954ff6d96adce0158f74ca494fdcef3aa1921?narHash=sha256-c94xkA/RuszC4PfmB%2BMWqOo2vbO66GTO6XKer0mbltA%3D' (2024-10-16) → 'github:neovim/neovim/ad3472e291694b6c589d8a664459b03962eaac95?narHash=sha256-0uH8SSP6/eqCuDvUCV%2Bs1ZwjLg6512Vj9dgKKO0iEmE%3D' (2024-11-08) • Updated input 'neorocks/neovim-nightly/nixpkgs': 'github:NixOS/nixpkgs/d4f247e89f6e10120f911e2e2d2254a050d0f732?narHash=sha256-DZBO2465PL5V89e8hFSJewyH4QbCPpW3ssws7ckT/0A%3D' (2024-10-13) → 'github:NixOS/nixpkgs/85f7e662eda4fa3a995556527c87b2524b691933?narHash=sha256-JwQZIGSYnRNOgDDoIgqKITrPVil%2BRMWHsZH1eE1VGN0%3D' (2024-11-07) • Updated input 'neorocks/nixpkgs': 'github:nixos/nixpkgs/2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53?narHash=sha256-B5WRZYsRlJgwVHIV6DvidFN7VX7Fg9uuwkRW9Ha8z%2Bw%3D' (2024-10-30) → 'github:nixos/nixpkgs/85f7e662eda4fa3a995556527c87b2524b691933?narHash=sha256-JwQZIGSYnRNOgDDoIgqKITrPVil%2BRMWHsZH1eE1VGN0%3D' (2024-11-07) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53?narHash=sha256-B5WRZYsRlJgwVHIV6DvidFN7VX7Fg9uuwkRW9Ha8z%2Bw%3D' (2024-10-30) → 'github:nixos/nixpkgs/85f7e662eda4fa3a995556527c87b2524b691933?narHash=sha256-JwQZIGSYnRNOgDDoIgqKITrPVil%2BRMWHsZH1eE1VGN0%3D' (2024-11-07) • Updated input 'pre-commit-hooks': 'github:cachix/pre-commit-hooks.nix/af8a16fe5c264f5e9e18bcee2859b40a656876cf?narHash=sha256-W1MIJpADXQCgosJZT8qBYLRuZls2KSiKdpnTVdKBuvU%3D' (2024-10-30) → 'github:cachix/pre-commit-hooks.nix/d70155fdc00df4628446352fc58adc640cd705c2?narHash=sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF%2B06nOg%3D' (2024-11-05) • Updated input 'pre-commit-hooks/nixpkgs': 'github:NixOS/nixpkgs/9693852a2070b398ee123a329e68f0dab5526681?narHash=sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs%3D' (2024-06-22) → 'github:NixOS/nixpkgs/a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc?narHash=sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE%3D' (2024-11-05) • Updated input 'pre-commit-hooks/nixpkgs-stable': 'github:NixOS/nixpkgs/194846768975b7ad2c4988bdb82572c00222c0d7?narHash=sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo%3D' (2024-07-07) → 'github:NixOS/nixpkgs/d063c1dd113c91ab27959ba540c0d9753409edf3?narHash=sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo%3D' (2024-11-04) --- flake.lock | 90 +++++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/flake.lock b/flake.lock index 6eda420c..4fd66436 100644 --- a/flake.lock +++ b/flake.lock @@ -175,11 +175,11 @@ ] }, "locked": { - "lastModified": 1727826117, - "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", "type": "github" }, "original": { @@ -281,11 +281,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1730302582, - "narHash": "sha256-W1MIJpADXQCgosJZT8qBYLRuZls2KSiKdpnTVdKBuvU=", + "lastModified": 1730814269, + "narHash": "sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF+06nOg=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf", + "rev": "d70155fdc00df4628446352fc58adc640cd705c2", "type": "github" }, "original": { @@ -310,11 +310,11 @@ ] }, "locked": { - "lastModified": 1729104314, - "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=", + "lastModified": 1730814269, + "narHash": "sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF+06nOg=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", + "rev": "d70155fdc00df4628446352fc58adc640cd705c2", "type": "github" }, "original": { @@ -468,11 +468,11 @@ ] }, "locked": { - "lastModified": 1724947644, - "narHash": "sha256-MHHrHasTngp7EYQOObHJ1a/IsRF+wodHqOckhH6uZbk=", + "lastModified": 1730903510, + "narHash": "sha256-mnynlrPeiW0nUQ8KGZHb3WyxAxA3Ye/BH8gMjdoKP6E=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "dba4367b9a9d9615456c430a6d6af716f6e84cef", + "rev": "b89ac4d66d618b915b1f0a408e2775fe3821d141", "type": "github" }, "original": { @@ -506,11 +506,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1730525028, - "narHash": "sha256-50Brt47i3P1DE/3mXw5NQZnW2ObI86xMwWOT7V+a1ck=", + "lastModified": 1731129910, + "narHash": "sha256-oyDV65S7QY7uhzb2sADIvwPPkw2vwhqV8CIv0WAt1Kg=", "owner": "nvim-neorocks", "repo": "neorocks", - "rev": "d7d0bac66ca4712d40bf8ad30a79ba2353bcde7a", + "rev": "c1b3c1188de859d12a610a1c46d03558cc763634", "type": "github" }, "original": { @@ -529,11 +529,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1730088025, - "narHash": "sha256-FIdIaN7f6karwtDV65VXTV8VThNrR63nwykfgXpm4p4=", + "lastModified": 1731111231, + "narHash": "sha256-8u8k3hnU5OxlXfhDLD3XEwAqv/M9Tb5USLCEPvXCPcM=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "f35afbe60a4ff71fd65fec3839fc38943f961951", + "rev": "702364e6ec794961483eba5220ca531917d03784", "type": "github" }, "original": { @@ -545,11 +545,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1729121305, - "narHash": "sha256-c94xkA/RuszC4PfmB+MWqOo2vbO66GTO6XKer0mbltA=", + "lastModified": 1731083384, + "narHash": "sha256-0uH8SSP6/eqCuDvUCV+s1ZwjLg6512Vj9dgKKO0iEmE=", "owner": "neovim", "repo": "neovim", - "rev": "852954ff6d96adce0158f74ca494fdcef3aa1921", + "rev": "ad3472e291694b6c589d8a664459b03962eaac95", "type": "github" }, "original": { @@ -640,11 +640,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1720386169, - "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", + "lastModified": 1730741070, + "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", + "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", "type": "github" }, "original": { @@ -656,11 +656,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1720386169, - "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", + "lastModified": 1730741070, + "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", + "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", "type": "github" }, "original": { @@ -688,11 +688,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1719082008, - "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=", + "lastModified": 1730768919, + "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9693852a2070b398ee123a329e68f0dab5526681", + "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", "type": "github" }, "original": { @@ -704,11 +704,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1728863046, - "narHash": "sha256-DZBO2465PL5V89e8hFSJewyH4QbCPpW3ssws7ckT/0A=", + "lastModified": 1730958623, + "narHash": "sha256-JwQZIGSYnRNOgDDoIgqKITrPVil+RMWHsZH1eE1VGN0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d4f247e89f6e10120f911e2e2d2254a050d0f732", + "rev": "85f7e662eda4fa3a995556527c87b2524b691933", "type": "github" }, "original": { @@ -720,11 +720,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1730272153, - "narHash": "sha256-B5WRZYsRlJgwVHIV6DvidFN7VX7Fg9uuwkRW9Ha8z+w=", + "lastModified": 1730958623, + "narHash": "sha256-JwQZIGSYnRNOgDDoIgqKITrPVil+RMWHsZH1eE1VGN0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53", + "rev": "85f7e662eda4fa3a995556527c87b2524b691933", "type": "github" }, "original": { @@ -736,11 +736,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1730272153, - "narHash": "sha256-B5WRZYsRlJgwVHIV6DvidFN7VX7Fg9uuwkRW9Ha8z+w=", + "lastModified": 1730958623, + "narHash": "sha256-JwQZIGSYnRNOgDDoIgqKITrPVil+RMWHsZH1eE1VGN0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53", + "rev": "85f7e662eda4fa3a995556527c87b2524b691933", "type": "github" }, "original": { @@ -752,11 +752,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1719082008, - "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=", + "lastModified": 1730768919, + "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9693852a2070b398ee123a329e68f0dab5526681", + "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", "type": "github" }, "original": { @@ -790,11 +790,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1730302582, - "narHash": "sha256-W1MIJpADXQCgosJZT8qBYLRuZls2KSiKdpnTVdKBuvU=", + "lastModified": 1730814269, + "narHash": "sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF+06nOg=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf", + "rev": "d70155fdc00df4628446352fc58adc640cd705c2", "type": "github" }, "original": { From 93f767402846a19f39e6469d968f485351f8a555 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 11 Nov 2024 20:12:30 +0100 Subject: [PATCH 2/2] fix: compatibility with nvim-nightly --- doc/rustaceanvim.txt | 2 +- ftplugin/rust.lua | 4 +++- lua/rustaceanvim/cached_commands.lua | 1 + lua/rustaceanvim/commands/code_action_group.lua | 2 +- lua/rustaceanvim/commands/debuggables.lua | 2 ++ lua/rustaceanvim/commands/open_cargo_toml.lua | 4 +++- lua/rustaceanvim/commands/parent_module.lua | 3 ++- lua/rustaceanvim/commands/rustc_unpretty.lua | 1 + lua/rustaceanvim/commands/ssr.lua | 3 +++ lua/rustaceanvim/compat.lua | 13 +++++++++++++ lua/rustaceanvim/config/init.lua | 2 +- lua/rustaceanvim/config/internal.lua | 1 + lua/rustaceanvim/dap.lua | 1 + lua/rustaceanvim/executors/quickfix.lua | 2 +- lua/rustaceanvim/neotest/init.lua | 1 + 15 files changed, 35 insertions(+), 7 deletions(-) diff --git a/doc/rustaceanvim.txt b/doc/rustaceanvim.txt index 98058101..bf26be2c 100644 --- a/doc/rustaceanvim.txt +++ b/doc/rustaceanvim.txt @@ -392,7 +392,7 @@ rustaceanvim.dap.adapter.types.server *rustaceanvim.dap.adapter.types.server* *rustaceanvim.dap.client.Config* -rustaceanvim.dap.client.Config : Configuration +rustaceanvim.dap.client.Config : dap.Configuration Fields: ~ {type} (string) The dap adapter to use diff --git a/ftplugin/rust.lua b/ftplugin/rust.lua index ecf7852d..24e903d9 100644 --- a/ftplugin/rust.lua +++ b/ftplugin/rust.lua @@ -1,5 +1,6 @@ ---@type rustaceanvim.Config local config = require('rustaceanvim.config.internal') +local compat = require('rustaceanvim.compat') if not vim.g.loaded_rustaceanvim then require('rustaceanvim.config.check').check_for_lspconfig_conflict(vim.schedule_wrap(function(warn) @@ -22,7 +23,7 @@ if not vim.g.loaded_rustaceanvim then vim.lsp.commands['rust-analyzer.gotoLocation'] = function(command, ctx) local client = vim.lsp.get_client_by_id(ctx.client_id) if client then - vim.lsp.util.jump_to_location(command.arguments[1], client.offset_encoding) + compat.show_document(command.arguments[1], client.offset_encoding) end end @@ -37,6 +38,7 @@ if not vim.g.loaded_rustaceanvim then local cached_commands = require('rustaceanvim.cached_commands') cached_commands.set_last_debuggable(args) local rt_dap = require('rustaceanvim.dap') + ---@diagnostic disable-next-line: invisible rt_dap.start(args) end diff --git a/lua/rustaceanvim/cached_commands.lua b/lua/rustaceanvim/cached_commands.lua index 79121676..f9f54518 100644 --- a/lua/rustaceanvim/cached_commands.lua +++ b/lua/rustaceanvim/cached_commands.lua @@ -43,6 +43,7 @@ M.execute_last_debuggable = function(executableArgsOverride) args.executableArgs = executableArgsOverride end local rt_dap = require('rustaceanvim.dap') + ---@diagnostic disable-next-line: invisible rt_dap.start(args) else local debuggables = require('rustaceanvim.commands.debuggables') diff --git a/lua/rustaceanvim/commands/code_action_group.lua b/lua/rustaceanvim/commands/code_action_group.lua index 356e8ac3..4a063a90 100644 --- a/lua/rustaceanvim/commands/code_action_group.lua +++ b/lua/rustaceanvim/commands/code_action_group.lua @@ -15,7 +15,7 @@ local M = {} ---@field arguments? any[] ---@param action rustaceanvim.RACodeAction | rustaceanvim.RACommand ----@param client lsp.Client +---@param client vim.lsp.Client ---@param ctx table function M.apply_action(action, client, ctx) if action.edit then diff --git a/lua/rustaceanvim/commands/debuggables.lua b/lua/rustaceanvim/commands/debuggables.lua index acb7b893..4d6c6b58 100644 --- a/lua/rustaceanvim/commands/debuggables.lua +++ b/lua/rustaceanvim/commands/debuggables.lua @@ -86,6 +86,7 @@ local function dap_run(args) local rt_dap = require('rustaceanvim.dap') local ok, dap = pcall(require, 'dap') if ok then + ---@diagnostic disable-next-line: invisible rt_dap.start(args, true, dap.run) local cached_commands = require('rustaceanvim.cached_commands') cached_commands.set_last_debuggable(args) @@ -131,6 +132,7 @@ local function add_debuggables_to_nvim_dap(debuggables) if not debuggable then return end + ---@diagnostic disable-next-line: invisible rt_dap.start(debuggable.args, false, function(configuration) local name = 'Cargo: ' .. build_label(debuggable.args) if not _dap_configuration_added[name] then diff --git a/lua/rustaceanvim/commands/open_cargo_toml.lua b/lua/rustaceanvim/commands/open_cargo_toml.lua index 20b0cff2..904dbb97 100644 --- a/lua/rustaceanvim/commands/open_cargo_toml.lua +++ b/lua/rustaceanvim/commands/open_cargo_toml.lua @@ -1,5 +1,7 @@ local M = {} +local compat = require('rustaceanvim.compat') + local function get_params() return { textDocument = vim.lsp.util.make_text_document_params(0), @@ -13,7 +15,7 @@ local function handler(_, result, ctx) local client = vim.lsp.get_client_by_id(ctx.client_id) if client then - vim.lsp.util.jump_to_location(result, client.offset_encoding) + compat.show_document(result, client.offset_encoding) end end diff --git a/lua/rustaceanvim/commands/parent_module.lua b/lua/rustaceanvim/commands/parent_module.lua index 616da5f6..ec624d07 100644 --- a/lua/rustaceanvim/commands/parent_module.lua +++ b/lua/rustaceanvim/commands/parent_module.lua @@ -1,6 +1,7 @@ local M = {} local rl = require('rustaceanvim.rust_analyzer') +local compat = require('rustaceanvim.compat') local function get_params() return vim.lsp.util.make_position_params(0, nil) @@ -20,7 +21,7 @@ local function handler(_, result, ctx) local client = vim.lsp.get_client_by_id(ctx.client_id) if client then - vim.lsp.util.jump_to_location(location, client.offset_encoding) + compat.show_document(location, client.offset_encoding) end end diff --git a/lua/rustaceanvim/commands/rustc_unpretty.lua b/lua/rustaceanvim/commands/rustc_unpretty.lua index 1858937f..73b51c9e 100644 --- a/lua/rustaceanvim/commands/rustc_unpretty.lua +++ b/lua/rustaceanvim/commands/rustc_unpretty.lua @@ -51,6 +51,7 @@ local function get_vim_range(range, buf) -- Use the value of the last col of the previous row instead. erow = erow - 1 if not buf or buf == 0 then + ---@diagnostic disable-next-line: assign-type-mismatch ecol = vim.fn.col { erow, '$' } - 1 else ecol = #vim.api.nvim_buf_get_lines(buf, erow - 1, erow, false)[1] diff --git a/lua/rustaceanvim/commands/ssr.lua b/lua/rustaceanvim/commands/ssr.lua index 66b7026e..b2724bfb 100644 --- a/lua/rustaceanvim/commands/ssr.lua +++ b/lua/rustaceanvim/commands/ssr.lua @@ -5,8 +5,11 @@ local M = {} local function get_opts(query, visual_mode) local opts = vim.lsp.util.make_position_params() local range = (visual_mode and vim.lsp.util.make_given_range_params() or vim.lsp.util.make_range_params()).range + ---@diagnostic disable-next-line: inject-field opts.query = query + ---@diagnostic disable-next-line: inject-field opts.parseOnly = false + ---@diagnostic disable-next-line: inject-field opts.selections = { range } return opts end diff --git a/lua/rustaceanvim/compat.lua b/lua/rustaceanvim/compat.lua index 229d929e..a9013bf8 100644 --- a/lua/rustaceanvim/compat.lua +++ b/lua/rustaceanvim/compat.lua @@ -1,3 +1,5 @@ +---@diagnostic disable: deprecated, duplicate-doc-alias + ---@mod rustaceanvim.compat compativility layer for ---API calls that are deprecated or removed in nvim nightly @@ -15,4 +17,15 @@ function compat.get_line_diagnostics() return vim.lsp.diagnostic.get_line_diagnostics() end +---@param location lsp.Location|lsp.LocationLink +---@param offset_encoding 'utf-8'|'utf-16'|'utf-32'? +---@return boolean `true` if the jump succeeded +function compat.show_document(location, offset_encoding) + local show_document = vim.lsp.show_document + if not show_document then + vim.lsp.util.jump_to_location(location, offset_encoding) + end + return show_document(location, offset_encoding, { focus = true }) +end + return compat diff --git a/lua/rustaceanvim/config/init.lua b/lua/rustaceanvim/config/init.lua index 89150687..cbb5042e 100644 --- a/lua/rustaceanvim/config/init.lua +++ b/lua/rustaceanvim/config/init.lua @@ -253,7 +253,7 @@ vim.g.rustaceanvim = vim.g.rustaceanvim ---@alias rustaceanvim.dap.adapter.types.executable "executable" ---@alias rustaceanvim.dap.adapter.types.server "server" ----@class rustaceanvim.dap.client.Config: Configuration +---@class rustaceanvim.dap.client.Config: dap.Configuration ---@field type string The dap adapter to use ---@field name string ---@field request rustaceanvim.dap.config.requests.launch | rustaceanvim.dap.config.requests.attach | rustaceanvim.dap.config.requests.custom The type of dap session diff --git a/lua/rustaceanvim/config/internal.lua b/lua/rustaceanvim/config/internal.lua index f9dfbceb..4c736845 100644 --- a/lua/rustaceanvim/config/internal.lua +++ b/lua/rustaceanvim/config/internal.lua @@ -44,6 +44,7 @@ local function load_dap_configuration(type) stopOnEntry = false, } if type == 'lldb' then + ---@diagnostic disable-next-line: inject-field dap_config.runInTerminal = true end ---@diagnostic disable-next-line: different-requires diff --git a/lua/rustaceanvim/dap.lua b/lua/rustaceanvim/dap.lua index 2ae16114..a6d8436f 100644 --- a/lua/rustaceanvim/dap.lua +++ b/lua/rustaceanvim/dap.lua @@ -315,6 +315,7 @@ function M.start(args, verbose, callback, on_error) ---@param value string :map(function(value) local is_json, artifact = pcall(vim.fn.json_decode, value) + ---@diagnostic disable-next-line: redundant-return-value return is_json, artifact end) ---@param is_json boolean diff --git a/lua/rustaceanvim/executors/quickfix.lua b/lua/rustaceanvim/executors/quickfix.lua index 16b8de84..f416bfcf 100644 --- a/lua/rustaceanvim/executors/quickfix.lua +++ b/lua/rustaceanvim/executors/quickfix.lua @@ -10,7 +10,7 @@ end ---@param lines string[] local function append_qf(lines) - vim.fn.setqflist({}, 'a', { lines = { lines } }) + vim.fn.setqflist({}, 'a', { lines = lines }) scroll_qf() end diff --git a/lua/rustaceanvim/neotest/init.lua b/lua/rustaceanvim/neotest/init.lua index 2465d177..a2e7448d 100644 --- a/lua/rustaceanvim/neotest/init.lua +++ b/lua/rustaceanvim/neotest/init.lua @@ -273,6 +273,7 @@ function NeotestAdapter.build_spec(run_args) local dap = require('rustaceanvim.dap') overrides.sanitize_command_for_debugging(runnable.args.cargoArgs) local future = nio.control.future() + ---@diagnostic disable-next-line: invisible dap.start(runnable.args, false, function(strategy) future.set(strategy) end, function(err)