rust_hdl_vscode icon indicating copy to clipboard operation
rust_hdl_vscode copied to clipboard

[Feature Request] Support custom user-defined types/subtypes

Open Nabav opened this issue 2 years ago • 4 comments

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.

Nabav avatar Aug 23 '23 12:08 Nabav

Moved to https://github.com/VHDL-LS/rust_hdl/issues/196

Nabav avatar Aug 29 '23 07:08 Nabav

As mentioned on sever side, the syntax highlighting is not part of the server.

Nabav avatar Nov 09 '23 08:11 Nabav

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.

Schottkyc137 avatar May 26 '24 12:05 Schottkyc137

@kraigher , please consider ☝️, thanks.

Nabav avatar May 26 '24 12:05 Nabav