Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter results by kind #27

Open
panglesd opened this issue Feb 7, 2024 · 1 comment
Open

Filter results by kind #27

panglesd opened this issue Feb 7, 2024 · 1 comment

Comments

@panglesd
Copy link
Contributor

panglesd commented Feb 7, 2024

It would be nice to search for a specific kind (value, type, module, ...).

I take the opportunity of suggesting a syntax for this :)

val x : t (** word *)

Search a value with name containing x and type containing t and docstring containing work (the "docstring" search is not really part of the proposal for this particular issue, but I could not resist having a "complete" example!)

Some other examples with different kinds:

type name
module Module_name
module type Module_type_name
type t = Constructor_name : int -> t
type _ = Constructor_name
type _ = { field_name }
type _ = { field_name : int -> int }
exception Exception_name
exception Exception_name : string -> string
class class_name
class type class_type_name
method method_name : t

More complex but very satisfying syntax for me!

@art-w
Copy link
Owner

art-w commented Feb 7, 2024

Ha yes that would be cool! Perhaps we could start with the prefix kind syntax? (the constructors / record fields will be harder to support, but are also less likely to be useful (?))

One thing to keep in mind is that some keywords might be useful search terms (for example print exception to find Printexc), what do you think of toggling this only when the keyword is at the very beginning of the query? (such that a savvy user can always prefix them with a space to recover a text query, e.g. type)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants