Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cleanup deprecated things #1723

Merged
merged 1 commit into from
Jan 18, 2025
Merged

Conversation

phanen
Copy link
Contributor

@phanen phanen commented Jan 18, 2025

  • legacy opts.preview_window -> fzf_opts.--preview_window
  • vim.fn.termopen -> vim.fn.jobstart + { term = true }
  • vim.loop -> vim.uv
  • vim.lsp.diagnostics.get_line_diagnostics -> vim.lsp.diagnostic.get
  • remove term workaround 9a755f2 (fixed now)
  • opts.silent when reload fallback to resume

@@ -1074,7 +1074,7 @@ M.convert_reload_actions = function(reload_cmd, opts)
end
end
end
if has_reload and reload_cmd and type(reload_cmd) ~= "string" then
if opts.silent ~= true and has_reload and reload_cmd and type(reload_cmd) ~= "string" then
utils.warn(
"actions with `reload` are only supported with string commands, using resume fallback")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This warn me every time when I use lsp picker seems due to I set a global actions.files with reload actions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, and oldfiles.

@@ -509,7 +509,8 @@ local function gen_lsp_contents(opts)
if utils.tbl_isempty(results) then
if not opts.fn_reload and not opts.silent then
utils.info(string.format("No %s found", string.lower(lsp_handler.label)))
else
end
if opts.fn_reload then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a bug introduced from (a81d18e): FzfLua lsp_xxx silent=true will always launch fzf even when no results.

* legacy `opts.preview_window` -> `fzf_opts.--preview_window`
* `vim.fn.termopen` -> `vim.fn.jobstart` + `{ term = true }`
* `vim.loop` -> `vim.uv`
* `vim.lsp.diagnostics.get_line_diagnostics` -> `vim.lsp.diagnostic.get`
* remove term workaround 9a755f2 (fixed now)
* `opts.silent` when `reload` fallback to `resume`
@ibhagwan
Copy link
Owner

Tysm @phanen, this is very helpful.

Did tiny 2 modifications:

  • we don’t need the preview_window in the called function so I removed it
  • Changed the LSP fn_reload/silence bug condition slightly (to be more coherent)

@ibhagwan ibhagwan merged commit 46a7682 into ibhagwan:main Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants