VHDL-LS / rust_hdl_vscode

VHDL Language Support for VSCode
MIT License
50 stars 17 forks source link

Case syntax should insert all case options depending on the enumerate defined for the case select variable #11

Closed GlenNicholls closed 4 years ago

GlenNicholls commented 4 years ago

When using the case syntax, a nice feature would be to automatically insert all case names. To accomplish this, the parser would need to see that the case variable as shown below is an enumerate, and if so, it would automatically insert all options:


type fsm_t is (IDLE, STEP_1, DONE);
signal state : fsm_t := IDLE;

...

process(all)
begin
    case state is -- after user presses tab when entering case select variable, it will auto populate options like below only if parser recognizes signals type as an enumerate
        when IDLE =>

        when STEP_1 =>

        when DONE =>

        when others => null; -- could have option for the user to set state to first option in enumerate for the others case
    end case;
end process;
Bochlin commented 4 years ago

Good feature.
This type of completion must be implemented in the language server as it would require the client to more or less implement a full parser and library management.

GlenNicholls commented 4 years ago

@Bochlin Do you want me to leave this open here or move it to rust_hdl?

Bochlin commented 4 years ago

@GlenNicholls You can move it to rust_hdl since none of the functionality would be in this extension.

GlenNicholls commented 4 years ago

Opened issue here https://github.com/kraigher/rust_hdl/issues/70