rust_hdl_vscode
rust_hdl_vscode copied to clipboard
[Feature Request] Support custom user-defined types/subtypes
LSP v3.17 adds subtypes. Is it possible to support them in VHDL-LS?
I am experiencing VHDL-LS in VSCode. I see that the custom type is highlighted during declaration.
type my_type_t is (FIRST_STATE, SECOND_STATE);
-- ^^^^^^^^^ <- highlighted
But it is not highlighted when defining an instance of that type.
signal my_signal : my_type_t := FIRST_STATE;
-- ^^^^^^^^^ <- not highlighted
The same happens for subtypes. The subtype is highlighted during declaration:
subtype my_int_t is integer range 0 to 63;
-- ^^^^^^^^ <- highlighted
But the instance type is not highlighted:
constant MY_CONST : my_int_t := 42;
-- ^^^^^^^^ <- not highlighted
Please let me know, if I am wrong reporting here and the issue should be reported in server side project.
Moved to https://github.com/VHDL-LS/rust_hdl/issues/196
As mentioned on sever side, the syntax highlighting is not part of the server.
Actually, I think that this does belong to the language server 😬.
While it is true that the vscode extension defines the syntax highlighting, the feature that you want doesn't have anything to do with the subtypes capability of the LSP. Instead, I believe that what you want are Semantic Tokens. This deals with highlighting types and other language elements which the base implementation herein is not capable of.
@kraigher , please consider ☝️, thanks.