vscode-terosHDL icon indicating copy to clipboard operation
vscode-terosHDL copied to clipboard

While loops not correctly highlighted

Open wimille opened this issue 2 years ago • 3 comments

Describe the bug "While" loops are not highlighted. In the following example, "end loop" is correctly highlighted but not the "while (condition) loop".

To Reproduce Write a simple HDL file with a while loop such as below.

Code process (clk, reset) begin if reset = '1' then c <= '0'; elsif rising_edge(clk) then while ( a = '0' and b = '1' ) loop c <= '1' end loop; end process;

Please complete the following information:

  • OS: Win10
  • VSCode 1.80.2

wimille avatar Jul 31 '23 07:07 wimille

I don't know how an extension is made, or how the syntax files are used. However, i've take a look at vhdl.tmLanguage.json and in "loop_statement" i'dont understand why this part is not build as if or for statement. So i've made a simple modification to test: i've replaced

 "beginCaptures": {
`           "1": {
              "name": "entity.name.tag.vhdl"
            },
            "2": {
              "name": "keyword.operator.vhdl"
            },
            "3": {
              "name": "keyword.reserved.vhdl"
            }
          },

by

 "beginCaptures": {
`           "3": {
              "name": "entity.name.tag.vhdl"
            },
            "2": {
              "name": "keyword.operator.vhdl"
            },
            "1": {
              "name": "keyword.reserved.vhdl"
            }
          },

And now while loop seems to be correcty highlighted. By the way, i don't understand why there is 3 cases in 'beginCaptures', where regex used in 'begin' section contains only one capture.

wimille avatar Aug 09 '23 08:08 wimille

I can't reproduce your problem. Can you share a screeshot?

qarlosalberto avatar Aug 23 '23 14:08 qarlosalberto

Hi, here's a snapshot (with teros 5.0.10) : (it is a foo module, just for the example): image

wimille avatar Aug 24 '23 07:08 wimille