wz1000 / HieDb

Generates a references DB from .hie files
BSD 3-Clause "New" or "Revised" License
64 stars 24 forks source link

configurable limit in searchDef #34

Open goolord opened 3 years ago

goolord commented 3 years ago

currently, searchDef is implemented like https://github.com/wz1000/HieDb/blob/bb7367f513eb17b4e81ed1339b8a583bfc521326/src/HieDb/Query.hs#L121-L126 the LIMIT on line 126 is problematic for HLS's workspace symbol handler, since it frequently omits symbols from a workspace_symbols query in a way that's opaque to the user https://github.com/haskell/haskell-language-server/blob/3be343acf76f05fb9b8adb73625439a5d40b362c/ghcide/src/Development/IDE/Core/Actions.hs#L123-L127

I think it's fine to either

  1. remove the LIMIT line
  2. add a Maybe Int parameter or similar to make this limit configurable
wz1000 commented 3 years ago

Sounds reasonable. But does this actually manifest in practice? Don't clients make another query when you refine your search by adding more characters?

goolord commented 3 years ago

neovim doesn't, at least. there are UIs that wrap nvim's workspace symbol handler that do/could do that, though.

most UIs I've used that provide functionality like that to nvim just query once and filter the results with some fuzzy filter, but maybe that's not a use case worth supporting :thinking:

goolord commented 3 years ago

I think it's worth it, if only because other language servers might not return symbols LIKE the query and it's worth maintaining that that workflow works across any language