Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Feature Request: Docs for word under cursor #26

Closed
bmulholland opened this issue Oct 11, 2021 · 8 comments
Closed

Feature Request: Docs for word under cursor #26

bmulholland opened this issue Oct 11, 2021 · 8 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@bmulholland
Copy link

I'm coming from dash.vim, which has a feature to search for the word under the cursor. (Optionally?) Having the telescope window auto-populate with that word would be helpful.

However, I found that this didn't always work as well as one would like, because the method searched could sometimes belong to quite a few different types of classes. For example, open in Ruby, which in Dash gives results for 36 objects. So my dream feature would be to use the LSP and/or Treesitter to lookup the docs for the method on the correct object type. In other words, var_that_is_a_tempfile.[o]pen (with the cursor on the o) would open the docs for specifically Tempfile.open.

@mrjones2014
Copy link
Owner

@bmulholland this is a great idea.

I think what makes the most sense is just to pre-populate the word under the cursor into the Telescope picker.

It might be possible to get a sort of "fully qualified name" using Treesitter or LSP, but I'd have to do some research on how to use both of those APIs.

As a sort of "minimum viable product", I might start with just pre-filling the word into the prompt so you can tweak from there. Does that sound alright?

@mrjones2014 mrjones2014 added the enhancement New feature or request label Oct 11, 2021
@mrjones2014
Copy link
Owner

Possibly related: #25

@hsheikhali1
Copy link

Not sure if this is possible but would the filetype help with narrowing down the different search options ?

For example - if in typescript file, if I trigger dash.nvim on a word it should trigger a query like this: typescript word_under_cursor

@mrjones2014
Copy link
Owner

@hsheikhali1 yeah I think that would sorta "come for free" with the current implementation of keyword searching

@bmulholland
Copy link
Author

Yeah the MVP of current word would work well (alliteration!) :). And that will bring it closer to feature parity with dash.vim.

@mrjones2014
Copy link
Owner

@bmulholland I've pushed a basic change adding a :DashWord and :DashWord! command (updated instructions in README.md). It's very simplistic right now, but we should be able to iterate on it.

@mrjones2014 mrjones2014 added the help wanted Extra attention is needed label Oct 11, 2021
@bmulholland
Copy link
Author

DashWord is working well :)

@mrjones2014
Copy link
Owner

@bmulholland I split off a new issue from this one, #38, so I can close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants