rmagatti / goto-preview Goto Github PK
View Code? Open in Web Editor NEWA small Neovim plugin for previewing definitions using floating windows.
License: Apache License 2.0
A small Neovim plugin for previewing definitions using floating windows.
License: Apache License 2.0
Hi @rmagatti,
Just tested this out as I was curious about this functionality, looks quite cool. I ran into an issue which is that I get Error executing vim.schedule lua callback: ...site/pack/packer/start/goto-preview/lua/goto-preview.lua:78: Invalid window id: 1003
when trying to open the floating window i.e. using gpd
the go to definition preview mapping.
Also the plugin has a dependency on vimp
which isn't documented but tbh I think also not really needed since you could export the functions and use them in the mapping which the plugin creates
e.g.
function M.goto_preview_definition()
-- do stuff
end
vim.api.nvim_set_keymap("n", "gpd", "<Cmd>lua require('goto-preview').goto_preview_definition()<CR>")
-- OR if you need to do it based on some logic in setup then
_G.__goto_preview_definition = M.lsp_request(true)
vim.api.nvim_set_keymap("n", "gpd", "<Cmd>lua _G.__goto_preview_definition()<CR>")
@rmagatti done a bit of debugging with quite a minimal init.lua and it seems the underlying error I'm seeing is Error executing vim.schedule lua callback: ...site/pack/packer/start/goto-preview/lua/goto-preview.lua:79: Cursor position outside buffer
. Seems setting the cursor is what is failing but I'm not sure why
Originally posted by @akinsho in #1 (comment)
Hey! While creating #9 I have been thinking about how to avoid having to define a config for each file type. I am not an expert in lua/neovim plugins, so this may be totally wrong, but I still want to run it by the community to see if we can save ourselves some typing
When executing vim.lsp.buf.definition()
, neovim automatically tried to go to the definition under the cursor, but that happens in the same window. To do it in a separate window, I can do: :vs | lua vim.lsp.buf.definition()
. Here is an example after invoking that command when my cursor was on defineWidget
(line 11) in the left window:
This is almost the functionality that this plugin has, but vs
opens a new window to the side, instead of a floating window.
I have been thinking whether it would be possible to change the implementation of this plugin do to the following:
lua vim.lsp.buf.definition()
to go to the definition inside of that floating windowIf I'm not mistaken, this would leverage existing neovim's configuration to go to the definition for any configured LSP. In the end, the plugin would not have to define a separate config for each filetype.
What do you think? Is that feasible?
Thanks for implementing a great plugin! This might be a question or feature request (if missing).
First, how can I prevent the cursor from automatically being moved to the preview window? I would want to "peek" the definition only, not disturbing the cursor on the main buffer. This should be a configurable option for all the methods, such as goto_preview_definition(opts)
.
Second, I would want to have the preview window automatically closed and dismissed when the cursor moves (assuming the cursor hasn't be taken to the preview window). This is similar to vim-quickui's persist = 0
option. How can I achieve that? Writing a custom post_open_hook
function for adding autocmd events would be definitely possible, but is there any chance you'd want to implement this is a built-in option?
Describe the bug
I recently discover this weird behavior, works fine with CoC, but not with Volar
sometimes trigger gpd
will show popup window showing the same definition twice
To Reproduce
Steps to reproduce the behavior:
In index.ts
router file,
import moduleA from './moduleAfile';
import moduleB from './moduleBfile';
then move cursor to moduleA
type gpd
Expected behavior
popup window only show once
Screenshots
Baseline (please complete the following information):
uname -a
: Darwin MacBook-Pro-2.local 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 arm64
nvim --version
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.7.2_1/share/nvim"
Run :checkhealth for more info
my goto-preview.lua
require('goto-preview').setup {
default_mappings = true;
}
Additional context
:checkhealth
result
null-ls: require("null-ls.health").check()
========================================================================
- INFO: no sources registered
nvim: health#nvim#check
========================================================================
## Configuration
- OK: no issues found
## Performance
- OK: Build type: Release
## Remote Plugins
- OK: Up to date
## terminal
- INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
- INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
- INFO: $TERM_PROGRAM='iTerm.app'
- INFO: $COLORTERM='truecolor'
nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
- OK: neovim version >= 0.7.0
- OK: **Go**: `go version go1.19 darwin/arm64`
- WARNING: **cargo**: not available
- WARNING: **luarocks**: not available
- OK: **Ruby**: `ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]`
- OK: **RubyGem**: `3.0.3.1`
- WARNING: **Composer**: not available
- OK: **PHP**: `PHP 8.1.9 (cli) (built: Aug 4 2022 14:00:20) (NTS)`
- OK: **npm**: `8.11.0`
- OK: **node**: `v16.15.1`
- OK: **python3**: `Python 3.10.6`
- OK: **pip3**: `pip 22.2.2 from /opt/homebrew/lib/python3.10/site-packages/pip (python 3.10)`
- WARNING: **javac**: not available
- WARNING: **java**: not available
- WARNING: **julia**: not available
- OK: **wget**: `GNU Wget 1.21.3 built on darwin21.3.0.`
- OK: **curl**: `curl 7.79.1 (x86_64-apple-darwin21.0) libcurl/7.79.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.45.1`
- OK: **gzip**: `Apple gzip 353.100.22`
- OK: **tar**: `bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8 `
- OK: **bash**: `GNU bash, version 3.2.57(1)-release (arm64-apple-darwin21)`
- OK: **sh**: `Ok`
- OK: GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Mon Aug 22 11:19:03 2022.
nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
- OK: `tree-sitter` found 0.20.6 (parser generator, only needed for :TSInstallFromGrammar)
- OK: `node` found v16.15.1 (only needed for :TSInstallFromGrammar)
- OK: `git` executable found.
- OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: Apple clang version 13.1.6 (clang-1316.0.21.2.5)
- OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.
## Parser/Features H L F I J
- json ✓ ✓ ✓ ✓ .
- python ✓ ✓ ✓ ✓ ✓
- css ✓ . ✓ ✓ ✓
- typescript ✓ ✓ ✓ ✓ ✓
- html ✓ ✓ ✓ ✓ ✓
- javascript ✓ ✓ ✓ ✓ ✓
- vue ✓ . ✓ ✓ ✓
- lua ✓ ✓ ✓ ✓ ✓
Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
+) multiple parsers found, only one will be used
x) errors found in the query, try to run :TSUpdate {lang}
provider: health#provider#check
========================================================================
## Clipboard (optional)
- OK: Clipboard tool found: pbcopy
## Python 3 provider (optional)
- INFO: `g:python3_host_prog` is not set. Searching for python3.9 in the environment.
- INFO: Executable: /opt/homebrew/bin/python3.9
- INFO: Python version: 3.9.13
- INFO: pynvim version: 0.4.3
- OK: Latest pynvim is installed.
## Python virtualenv
- OK: no $VIRTUAL_ENV
## Ruby provider (optional)
- INFO: Ruby: ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
- WARNING: `neovim-ruby-host` not found.
- ADVICE:
- Run `gem install neovim` to ensure the neovim RubyGem is installed.
- Run `gem environment` to ensure the gem bin directory is in $PATH.
- If you are using rvm/rbenv/chruby, try "rehashing".
- See :help |g:ruby_host_prog| for non-standard gem installations.
- You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim
## Node.js provider (optional)
- INFO: Node.js: v16.15.1
- INFO: Nvim node.js host: /Users/xintan/.nvm/versions/node/v16.15.1/lib/node_modules/neovim/bin/cli.js
- OK: Latest "neovim" npm/yarn package is installed: 4.10.1
## Perl provider (optional)
- WARNING: "Neovim::Ext" cpan module is not installed
- ADVICE:
- See :help |provider-perl| for more information.
- You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim
telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
- OK: plenary installed.
- OK: nvim-treesitter installed.
## Checking external dependencies
- OK: rg: found ripgrep 13.0.0
- OK: fd: found fd 8.4.0
## ===== Installed extensions =====
## Telescope Extension: `file_browser`
- INFO: No healthcheck provided
## Telescope Extension: `notify`
- INFO: No healthcheck provided
## Telescope Extension: `session-lens`
- INFO: No healthcheck provided
vim.lsp: require("vim.lsp.health").check()
========================================================================
- INFO: LSP log level : WARN
- INFO: Log path: /Users/xintan/.cache/nvim/lsp.log
- INFO: Log size: 1361 KB
vim.treesitter: require("vim.treesitter.health").check()
========================================================================
- INFO: Runtime ABI version : 14
- OK: Loaded parser for css: ABI version 13
- OK: Loaded parser for html: ABI version 13
- OK: Loaded parser for javascript: ABI version 13
- OK: Loaded parser for json: ABI version 13
- OK: Loaded parser for lua: ABI version 13
- OK: Loaded parser for python: ABI version 13
- OK: Loaded parser for typescript: ABI version 13
- OK: Loaded parser for vue: ABI version 13
Describe the bug
Error executing vim.schedule lua callback: ...te/pack/packer/opt/goto-preview/lua/goto-preview/lib.lua:225: attempt to index field 'lsp_configs' (a nil valu
e)
stack traceback:
...te/pack/packer/opt/goto-preview/lua/goto-preview/lib.lua:225: in function 'handle'
...te/pack/packer/opt/goto-preview/lua/goto-preview/lib.lua:259: in function 'handler'
/usr/local/share/nvim/runtime/lua/vim/lsp.lua:1025: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
step to produce
git clone https://github.com/bryceyang/dotConfigs.git
git checkout navigator-again-new-theme
cd neovim-lua-refactor-version
source ./playground.sh # this won't affect your config, just set a custom xdg env
nvp some_projects # nvp is an alias to nvim with custom xdg env from above source step
# use gpd (my custom hot-key for goto-preview)
Expected behavior
preview window show up
Baseline (please complete the following information):
Additional context
I loaded nvim-lspconfigs plugin on vimEnter event.
my config:
call plug#begin('~/.nvim-config/plugged')
...
" https://github.com/rmagatti/goto-preview
Plug 'rmagatti/goto-preview'
...
" https://github.com/neoclide/coc.nvim
Plug 'neoclide/coc.nvim', {'branch': 'release'}
...
call plug#end()
...
lua <<EOF
require('goto-preview').setup {
}
EOF
I can't open the floating window in the CPP file.
It would be great if we can have additional command/function/mapping to close only current window instead of all the windows together, since sometimes we want to go back and branch onto some other definitions.
It would be even better if that command can accept count, like close last 2 or last 3 windows.
Describe the bug
When clicking on the floating preview window, the focus (cursor) is expected to move to the window.
To Reproduce
Expected behavior
The cursor window moves to the preview window.
Current behavior
It remains on the current window from which goto-preview was triggered.
Baseline (please complete the following information):
uname -a
: Linux, macOS (both)nvim --version
: nvim 0.5.1. and 0.6.0 nightlyIs your feature request related to a problem? Please describe.
I use goto preview to "peek" definitions described in #44. In these cases my muscle memory is to close popovers with c-[
(or alternatively esc
or c-c
, etc).
Describe the solution you'd like
A config option that allows the popover to be closed using the usual vim keys for closing popovers or menus
Describe alternatives you've considered
Creating my own mappings - but figured this might be a useful feature to compliment #44
Describe the bug
When trying to use goto-preview with clojure lsp, I get the following error ...m/site/pack/packer/opt/goto-preview/lua/goto-preview.lua:15: attempt to index local 'data' (a nil value)
Expected behavior
no error, normal behavior
Baseline (please complete the following information):
Hey @rmagatti, awesome plugin, I love it. Thanks a lot for your time in developing it.
Sometimes I maybe previewing something and I want to "zoom in". It would be nice to do something like v and have the buffer registered in my tab line.
Additionally, as noted with the positioning bug, yes the popup go all over the place. However, it might be worth it to take vscode/preview popup approach and let them stack under each other.
Any ways thanks again
Is your feature request related to a problem? Please describe.
I find myself avoiding gd when I know the definition is in the file I'm on, because I just want to jump there without opening a pop-up
Describe the solution you'd like
I'd like a config option to toggle that behavior
Describe alternatives you've considered
Maybe post_open hook?
Additional context
I would rather not disable the plugin because it's great for inspecting files in node_modules, for example
Broken preview because of the new LSP handler function format
Is it possible to change border color to custom one?
Basically as an option to add some config examples/advanced configurations. For example, I have now setup goto-preview to behave similarly to telescope in regards to "expanding" preview windows into full windows. You can press <CR>
, <C-v>
, <C-x>
, <C-t>
to expand the preview into the current (main) window, vertical split, horizontal split, and a new tab, respectively.
local gtp = require('goto-preview')
local select_to_edit_map = {
default = "edit",
horizontal = "new",
vertical = "vnew",
tab = "tabedit",
}
local function open_file(orig_window, filename, cursor_position, command)
if orig_window ~= 0 and orig_window ~= nil then
vim.api.nvim_set_current_win(orig_window)
end
pcall(vim.cmd, string.format('%s %s', command, filename))
vim.api.nvim_win_set_cursor(0, cursor_position)
end
local function open_preview(preview_win, type)
return function()
local command = select_to_edit_map[type]
local orig_window = vim.api.nvim_win_get_config(preview_win).win
local cursor_position = vim.api.nvim_win_get_cursor(preview_win)
local filename = vim.api.nvim_buf_get_name(0)
vim.api.nvim_win_close(preview_win, gtp.conf.force_close)
open_file(orig_window, filename, cursor_position, command)
local buffer = vim.api.nvim_get_current_buf()
vim.api.nvim_buf_del_keymap(buffer, 'n', '<C-v>')
vim.api.nvim_buf_del_keymap(buffer, 'n', '<CR>')
vim.api.nvim_buf_del_keymap(buffer, 'n', '<C-x>')
vim.api.nvim_buf_del_keymap(buffer, 'n', '<C-t>')
end
end
local function post_open_hook(buf, win)
vim.keymap.set('n', '<C-v>', open_preview(win, "vertical"), { buffer = buf })
vim.keymap.set('n', '<CR>', open_preview(win, "default"), { buffer = buf })
vim.keymap.set('n', '<C-x>', open_preview(win, "horizontal"), { buffer = buf })
vim.keymap.set('n', '<C-t>', open_preview(win, "tab"), { buffer = buf })
end
require('goto-preview').setup {
post_open_hook = post_open_hook,
}
I don't see any particular reason for this to be "officially" incorporated into the plugin, but I think it'd be nice to share with others as an option.
Hey, thank you for the fantastic plugin.
Somehow color theme in the float windows are different from my main theme (it is with black bg). I have quite a number of plugins that might influence the color (like shade
that shades inactive windows, but I disabled it for trying this one).
Any ideas why this might be the case or any hints where to look?
Thanks!
Describe the bug
I get the following exception when triggering preview inside a <template>
in Vue filetype when using the vetur LSP.
Error executing vim.schedule lua callback: ...site/pack/packer/start/goto-preview/lua/goto-preview.lua:18: attempt to index local 'range' (a nil value)
stack traceback:
...site/pack/packer/start/goto-preview/lua/goto-preview.lua:18: in function 'get_config'
.../pack/packer/start/goto-preview/lua/goto-preview/lib.lua:220: in function 'handle'
.../pack/packer/start/goto-preview/lua/goto-preview/lib.lua:254: in function 'handler'
/usr/local/share/nvim/runtime/lua/vim/lsp.lua:964: in function ''
vim.lua: in function <vim.lua:0>
This works like expected inside a <script>
section, so this is definitely an issue with the LSP itself.
The lib.logger.debug(vim.inspect(data))
statement gives {}
, so it's no wonder why this fails.
So maybe add some additional checks here so that it doesn't fail with an exception?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A popup, or nothing if no data available.
Baseline (please complete the following information):
Linux aworkstation 5.15.10-arch1-1 #1 SMP PREEMPT Fri, 17 Dec 2021 11:17:37 +0000 x86_64 GNU/Linux
NVIM v0.7.0-dev+746-g95803f0e9
Is your feature request related to a problem? Please describe.
Closing buffers is unintuitive compared to other plugins
Describe the solution you'd like
Map to close a preview buffer when selected
Hello, thank you for the plugin. However, there is one thing that is weird to me. After i close the preview window with already existing before hidden buffer, the buffer is unloaded. As i understand noone reported this before, which is wierd, is it possible to fix this? Im on the latest neovim master.
It would be great, if an additional command/function/mapping can be provided that opens the preview in active topmost window, so that we can choose if we want to open the next preview in same window or in a new one, since sometimes we encounter some symbols that we know we want to skip and go inside.
This would satisfy another usecase where we just want to go inside to find a specific symbol without opening a lot of buffers or a lot of floating windows(flow is kind of like vscode where we can open a file and jump to different locations and it will change the buffer in the same window, unless we double click, kind of like transient buffer)
Sometimes we are navigating the code and while digging some definitions we find some important symbol that we need to understand more carefully(like it keeping it aside and thinking something like I'll come back to this).
It would be better if we can have support to open the buffer in active preview window to a normal buffer (without loosing the focus of floating preview)
Is your feature request related to a problem? Please describe.
First i am in the first directory structure and then use the goto-preview plugin to only show the preview buffer.
And the I close the preview buffer, unfortunatelly, the last directory structure has changed and every time I must open the directory again and again.
Describe the solution you'd like
keep the last directory structure after close the preview window?
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
It is just me, or does this function not do anything? I just installed this plugin a few days ago so I can't say if it used to work and just broke on a recent commit, but it definitely does not do anything right now. I am using this command to test it:
lua require('goto-preview').close_all_win()
Is your feature request related to a problem? Please describe.
Hello, my telescope is set to be lazily loaded based on keys and commands. But it seems that this plugin would automatically initialize telescope if it exists. That would add another extra 30ms for my config right now.
if has_telescope then
init_telescope()
end
Describe the solution you'd like
Add an option for decoupling telescope would be awesome. If the user set the option, then skip checking if telescope exists.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
It would be cool if there'd be an easy way to set up a keybind that "expands" the popup window and opens the displayed location in a new buffer!
Describe the bug
If I preview the definition of something that is defined in the same file, and then close the preview, and then navigate to another buffer, the original buffer I was editing closes and no longer shows up in :ls
All key mappings are assuming the defaults.
To Reproduce
Steps to reproduce the behaviour:
In a file that both defines a new object and refers to that defined object:
gpd
gP
:ls
still shows the parent buffer.:bn
(or any other way you like):ls
no longer shows the buffer, :bp
and <C-^>
cant return to it, the latter displaying "E23: No alternate file`Expected behavior
The buffer I was editing/previewing from would still exist and be navigable to with <C-^>
.
Baseline (please complete the following information):
I'm not particularly fond of Telescope as a whole, so it would be great if Telescope could be an optional dependency. I'm currently stuck using an older version of goto-preview
because the more recent versions require Telescope.
Current behavior
If we open another buffer in the current preview window (like LSP's goto-definition), then post_open_hook
won't be called for the new buffer opened in the same preview window.
Expected behavior
If we open/jump to another buffer from within preview-window then post_open_hook
should be called for the new buffer, Hence the code executed in the hook(like creating buffer local mappings) will be retained.
Since a user no longer requires vimp
to use this plugin the error message warning about needing it should also be removed 🙏🏾
Describe the bug
Error when you try to use any functions.
To Reproduce
Steps to reproduce the behavior:
require('goto-preview').goto_preview_definition()
on a buffer with an LSP enabledExpected behavior
It opens the definition in a floating window
Baseline (please complete the following information):
uname -a
: Darwin Mats-MBP.lan 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64
nvim --version
: NVIM v0.8.0-dev-997-gfa747d004-dirty
Additional context
Add any other context about the problem here.
I'd love to be able to integrate the find-references popup with plugins like https://github.com/folke/trouble.nvim
this would be pretty easy to implement if you either allowed users to provide some custom hook that decides how to select a location / provide some easy function that just opens "whatever" buffer@location in a popup.
Alternatively, a simple solution would be to make use of the vim-builtin quickfix / loclist menu, which tools like trouble can wrap
Describe the bug
lua require('goto-preview').goto_preview_definition()
returns an error:
Error executing vim.schedule lua callback: ...ack/home-manager/start/goto-preview/lua/goto-preview.lua:14: attempt to index local 'data' (a nil value)
but lua vim.lsp.buf.definition()
works properly.
Manually executing vim.lsp.buf_request, 0, "textDocument/implementation", vim.lsp.util.make_position_params()
seems to return valid data, e.g.:
<function 1> 0 "textDocument/implementation" {
position = {
character = 34,
line = 344
},
textDocument = {
uri = "file:///.../views.cljs"
}
}
The issue is happening with clojure-lsp
, with typescript-lsp
goto-preview seems to work ok, but I don't get the reason for that
Baseline (please complete the following information):
uname -a
: Linux 5.10.76 #1-NixOS SMP Wed Oct 27 07:56:57 UTC 2021 x86_64 GNU/Linux
nvim --version
:NVIM v0.5.1
Build type: Release
LuaJIT 2.1.0-beta3
Compilation:
Compiled by nixbld
Features: +acl +iconv +tui
Documentation doesn't mention what's the default mapping
Documentation doesn't mention how to set custom mapping
There are too many vim.inspect
for debug.
It is unnecessary that the handler always inspect the result.
goto-preview/lua/goto-preview/lib.lua
Lines 282 to 291 in a5af27c
Is there a way to open a peek in a new buffer? Sometimes I have a peek open that I want to now have full window and/or in a split.
Describe the solution you'd like
If I open previews a
,b
, and c
, closing c
should put my focus on b; closing b — on a
.
Describe alternatives you've considered
I have a function that I dovim.keymap.set
with the local buffer inside the post_open_hook
:
local function close_and_move_focus_on_prev()
local prev_win = vim.fn.winnr()
vim.cmd("wincmd p")
return vim.cmd((prev_win .. "wincmd q"))
end
Additional context
On the gif below I do:
close_and_move_focus_on_prev
function;(my config is in fennel).
Is your feature request related to a problem? Please describe.
Many users use vim-plug to manage their plugins and are used to simply putting down a Plug ...
command.
Doing so for this plugin means that the setup function is not executed, resulting in unclear nil
errors.
Describe the solution you'd like
Add info on different plugin managers to the readme, like for vim-plug;
Plug 'rmagatti/goto-preview'
:lua require('goto-preview').setup()
I'm using this distraction-free plugin: https://github.com/folke/zen-mode.nvim
If I try to open goto-preview while ZenMode
is activated - I don't see a popup window, but my cursor is constrained within some invisible border, in other words it seems the window exists, but it's completely transparent. If a type :bd
my cursor gets back to normal.
This is probably not a bug, but probably not a feature request either.
Besides omnisharp-nvim and lsp, I am relying on https://github.com/Hoffs/omnisharp-extended-lsp.nvim in order to find definitions for external libraries. In short, this enables me to open a scratch buffer with a generated definition of the external source file.
However, it does not work out-of-the-box with goto-preview, as I get the error:
Error executing vim.schedule lua callback: .../pack/packer/start/goto-preview/lua/goto-preview/lib.lua:158: Cursor position outside buffer
I am not sure if this is fixable or not. Might be that this is not a general enough case, might also be that something needs to be done in omnishharp-extended-lsp.
Thanks in advance for any amount of time you choose to spend on this.
Hi,
Just caught your (?) post on reddit, and this is something I have been looking for as an alternative to lsputils or lspsaga. All I want is the preview, so this is good stuff.
However, after setting up I get the following error:
Error executing vim.schedule lua callback: .../pack/packer/start/goto-preview/lua/goto-preview/lib.lua:120: attempt to index field 'lsp_configs' (a nil value)
I used the (minimal) setup instructions from the README. And I've double checked that it's 1:1.
Edit:
NVIM v0.6.0-dev+253-ge31652879
Build type: Release
LuaJIT 2.1.0-beta3
Hello,
Thanks for the repo, it seems to be quite awesome.
I am trying to use it but I am having trouble to make it work.
I installed it using packer.nvim as required in the README.
It seems to be installed since the keymap gdp
does different things whether default_mappings
is set to true or false in the config file (paste when set to false, and nothing when set to true). When it is set to true, it does nothing and I don't have an error message. I tried to set my own keybinding, similarly nothing happens when I press the keybinding. I made sure it were mapped to nothing before setting it.
I tried with a simple .py file :
def foo(x):
print(x)
foo("test")
pressing keybindings on the word foo
.
I just wanted to know if you have any advice on how to troubleshoot this, since no error message is displayed.
Thanks :))
Describe the bug
When editing a file with an active tsserver, the reference preview window does not appear when the function
lua require('goto-preview').goto_preview_references()
is invoked on a symbol containing references. References can be previewed successfully on other language servers such as bash and lua.
To Reproduce
Steps to reproduce the behavior:
lua require('goto-preview').goto_preview_references()
(either by a command or keybinding)Expected behavior
A window containing references to the symbol under the cursor should be displayed upon invoking
lua require('goto-preview').goto_preview_references()
Screenshots
If nessecary I can provide screenshots, but I think my report adequately describes the issue.
Baseline (please complete the following information):
Additional context
-Telescope can find tsserver references itself with no issue
Really nice addon! It's helping me on my transition away from VSCode.
I wonder, did you consider showing the path to the file in the preview window "title" area?
Thanks again! 🙏
Is your feature request related to a problem? Please describe.
Ability to modify a file in a floating window, without the need to fully open it
Describe the solution you'd like
I would like to do some small changes to the floating window (ex. add a property to a class), save, then close (ideally just with the escape key), without fully opening it to split.
Inspiration: Visual Studio (the IDE not the text editor)
Describe the bug
when triggering the default mapping "gpd", instead of previewing the definition,
nvim is throwing an error regarding another plugin, namely stevearc/aerial.nvim
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would like to see the actual preview of the definition of the import/thingy
Baseline (please complete the following information):
uname -a
: Darwin Kernel Version 21.2.0nvim --version
: NVIM v0.7.0-dev+2267-gc46f7caadAdditional context
Justy a quick note: I dblchecked on the default mappings of aerial, and "gpd" doesn't seem to be one of them
Hey 👋 First of all, the plugin is great! I've been looking for a similar functionality for some time already
I am mostly working with TS/JS files, and while it works great in TS files, I have noticed that in other files types that are handled by tsserver
:
javascript
typescriptreact
javascriptreact
I get an error since
goto-preview/lua/goto-preview.lua
Line 101 in 1eaafcf
get_config
from nil
.
I have 2 suggestions here:
tsserver
. The implementation of get_config
should be the same as for the typescript
file type. Of course, I could do that myself in my vim config, but IMO it would be beneficial for everyone.Error executing vim.schedule lua callback: ...z/.config/nvim/plugged/goto-preview/lua/goto-preview.lua:101: attempt to index a nil value
Again, thanks for a great plugin 👍
Firstly... love this plugin. I realize support for references would perhaps entail some extra UI for cycling through the different references with something like a preview window for the locations but I think this would be a shoe-in for this awesome plugin given what it can do already.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.