VHDL-LS / rust_hdl_vscode

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

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

Open Nabav opened 1 year ago

Nabav commented 1 year ago

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 commented 1 year ago

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

Nabav commented 11 months ago

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

Schottkyc137 commented 4 months ago

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.

Nabav commented 4 months ago

@kraigher , please consider ☝️, thanks.