Remillard / VHDL-Mode

A package for Sublime Text that aids coding in the VHDL language.
MIT License
40 stars 10 forks source link

Create testbench crashes when entity has a generic #130

Closed Remillard closed 5 years ago

Remillard commented 5 years ago

Reported by dkalex on the Sublime Forum at https://forum.sublimetext.com/t/vhdl-mode-for-sublime-text-3/29782/40

Paste as Testbench doen’t work when entity includes generic.

Sublime Text 3 console shows this

after “Copy Ports” vhdl-mode: Interface beginning found. vhdl-mode: Interface end found.

after “Paste as Testbench” Traceback (most recent call last): File “C:\Sublime Text Build 3207 x64\sublimeplugin.py”, line 1052, in run return self.run() File “C:\Sublime Text Build 3207 x64\Data\Installed Packages\VHDL Mode.sublime-package\vhdl_interface.py”, line 200, in run File “C:\Sublime Text Build 3207 x64\Data\Installed Packages\VHDL Mode.sublime-package\vhdl_lang.py”, line 967, in constants File “C:\Sublime Text Build 3207 x64\Data\Installed Packages\VHDL Mode.sublime-package\vhdl_lang.py”, line 444, in indent_vhdl IndexError: deque index out of range

Remillard commented 5 years ago

Turns out to be an error when I tried to do my deque object with "is not None". A deque object even at zero objects will not ever be None so must check for len() > 0.