TerosTechnology / vscode-terosHDL

VHDL and Verilog/SV IDE: state machine viewer, linter, documentation, snippets... and more!
https://terostechnology.github.io/terosHDLdoc/
GNU General Public License v3.0
563 stars 45 forks source link

Errors reported when using consecutively following attributes #429

Closed nselvara closed 8 months ago

nselvara commented 1 year ago

Describe the bug The following error(s) are reported for the snippet below: Type cannot be used as an expression vhdl ls It seems to be the LS can't handle consecutively following attributes.

Code

entity tb
  generic (
    runner_cfg: string := runner_cfg_default;
    tb_path: string
  );
end entity;

architecture behavioural of tb is
  data_generator: process
    variable data_index: natural range 0 to 9 := 9;

    procedure report_index is
      variable data_index_1: natural range 0 to data_index'subtype'high;
      variable data_index_0: natural range 0 to data_index'subtype'high;
    begin
      data_index_1 := data_index;
      data_index_0 := data_index - 1;

      report "data_index_1: " & to_string(data_index_1) severity note;
      report "data_index_0: " & to_string(data_index_0) severity note;
    end procedure;

    begin
      for i in 0 to data_index'subtype'high loop
        report_index;
        if data_index > data_index'subtype'low then
          data_index := data_index - 1;
        else
          data_index  := data_index'subtype'high;
        end if;
      end loop;
    end process;
end architecture;

Add. info:

Screenshots image

Additional context Is there a way how to mute the error for the mean time? I reported this also in VHDL-LS repo - https://github.com/VHDL-LS/rust_hdl/issues/184 - as well but it seems to be a bug related to this repo.

nselvara commented 8 months ago

This issue has been resolved by VHDL LS https://github.com/VHDL-LS/rust_hdl/issues/184. I close it now.