[mini.visits] add lsp protocol / buftype support #1947
Closed
appleseedexm
started this conversation in
Ideas
Replies: 2 comments 3 replies
-
After quick look at code and use case description, there indeed might be something wrong going on. To ensure that we are on the same page, could you please describe step by step how to reproduce the issue (exact buffer name+type, etc.). Starting with this (and not pointing at code) usually saves time for both parties involved. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Executing |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is either a feature idea or a bug report, so I thought I'll not directly open an issue.
I'm also open to provide a solution according to the path this should take.
Usecase
I'm using jdtls (java lsp) which adds the
jdt://
lsp workspace protocol to reference symbols outside of the project, for example classes from external libraries which are inside the java classpath of the lsp.Now out of curiosity I've tried adding a buffer with such a
jdt://
path to my visits viaMiniVisits.add_label
, my most common way to use visits.Expectation & Result
I expected that either:
But what actually happened was something else:
H.buf_get_path
checks forbuftype ~= ''
of the current opened buffer, which in this case isnofile
. It will then early returnnil
and such a path will cause all available paths in all target cwds to be added. That is IMHO a bug and not to be expected.Possible resolutions
buftype
should not add all available paths by default. From my limited analysis I think this was built to provide an easy way to do some wildcard functionality, for example removing a label from any path (= deleting a label). Most methods should probably be sensitive tobuftype
and not use all paths by default. This would be a bugfix.buftype
(and protocols) and disable functionality by default. I expect this to be out of scope for this project, but still wanted to suggest it. Just for my usecase it would be close to impossible to persist these paths between instances, sincejdtls
adds a custom hash to thejdt://
paths per instance. Then again, for me even without persistence I would use this feature frequently, since I'd still be able to store these temporary visits until I close neovim.I hope everything is clear and I'm looking forward to other input on this. For now I'll probably try to overwrite keymap for
MiniVisits.add_label
to be sensitive forbuftype
.Beta Was this translation helpful? Give feedback.
All reactions