Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Getting list of all possible values for an enum #163

Open
tobimensch opened this issue May 18, 2020 · 3 comments
Open

Getting list of all possible values for an enum #163

tobimensch opened this issue May 18, 2020 · 3 comments

Comments

@tobimensch
Copy link

Hello,

thanks for your extension.

I tried to get a list of all the values an enum can have,
but this doesn't seem to be implemented.

Thanks in advance to whoever makes this work,
it'd be very useful in my opinion.

@RSDuck
Copy link
Contributor

RSDuck commented May 18, 2020

what do you mean, by all the value it can take on?

just go to the enums definition (right click go to definition or ctrl+click), and you'll find the values which belong to the enum.

@tobimensch
Copy link
Author

tobimensch commented May 19, 2020

@RSDuck
Of course one can go to its definition, but why should one have to?
You could also tell me to go to a module's source file to know all the procs it provides,
yet we have autocompletion, which shows as all the procedures that work for a given
type.
So why can't autocompletion do the same for an enum instead of forcing me to leave
the current source file I'm working on?
I want to type enumName.(here a list of all the value-names this enum has should appear),
to see what choices I have, I think this would be more intuitive, instead of being forced
to leave the current source code I'm working on because I have to something up.

@RSDuck
Copy link
Contributor

RSDuck commented May 19, 2020

  1. the completion is provided by nimsuggest not by the plugin
  2. what you're describing enumName. is not really idomatic Nim code. Enums should only be explicitely qualified in cases where it's necessary. Typically you give your enums a common prefix (example: https://nim-lang.org/docs/macros.html#NimNodeKind).

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

No branches or pull requests

2 participants