edolphin-ydf / goimpl.nvim

Generate stub for interface on a type
54 stars 6 forks source link

Cannot get list of interfaces to implement. #5

Closed orlovm closed 2 years ago

orlovm commented 2 years ago

I've installed goimpl.nvim via vim-plug and registered it as telelescope extension.

When I try to use it with lua require'telescope'.extensions.goimpl.goimpl{}, I get this notification: [telescope.filter_symbols]: interface symbol(s) were not part of the query results

I have neovim 0,7. And the latest versions of all dependencies listed in readme. And gopls configured and working correctly.

Please, tell me what I'm doing wrong. Plugin looks very usefull!

Cih2001 commented 2 years ago

Hey,

https://github.com/edolphin-ydf/goimpl.nvim/commit/f3d1109fbaa881e3c9ab8fb4326a414fc9ef01da not only didn't fix the issue, but also broke the extension for me. I had to revert it.

edolphin-ydf commented 2 years ago

please try the newest main branch.

edolphin-ydf commented 2 years ago

tested with newest telescope

Cih2001 commented 2 years ago

There are still problems with it. There are times when your symbol list is not empty, but does not contain any interfaces. If you enter a character like q in the search box, such a case will occur. My PR (https://github.com/edolphin-ydf/goimpl.nvim/pull/6) fixes this problem by manually filtering out interfaces rather than using utils.filter_symbols Screenshot from 2022-07-04 18-33-47

edolphin-ydf commented 2 years ago

Ok. I got you. And there is some conflict, let me fix it.

edolphin-ydf commented 2 years ago

Done

edte commented 2 years ago

I also encountered a similar problem, there are some interfaces that won't show up image

Only a few interfaces are displayed image

Plugins are up to date

edolphin-ydf commented 2 years ago

I also encountered a similar problem, there are some interfaces that won't show up image

Only a few interfaces are displayed image

Plugins are up to date

Have no idea on this. I'v test on two project, a simple test project And a large project. In the simple test project, everything works fine. But in the large project, i'v met the same issue with you. After some debug, i found that the lsp returned with missing some interfaces. So it's maybe the lsp's issue.

edolphin-ydf commented 2 years ago
@edte I'v found a new way to get what you want. See this document use the exact feature in the query Character Usage Match
' 'abc exact
^ ^printf exact prefix
$ printf$ exact suffix

eg: 'Reader

edte commented 2 years ago

it's work fine,thanks