TerosTechnology / vscode-terosHDL

VHDL and Verilog/SV IDE: state machine viewer, linter, documentation, snippets... and more!
https://terostechnology.github.io/terosHDLdoc/
524 stars 42 forks source link

Feature Request: "Insert instance template of..." to insert component instances from libraries #592

Open ckuhlmann opened 3 months ago

ckuhlmann commented 3 months ago

Is your feature request related to a problem? Please describe. Instance templates for a specific component in a referenced library cannot be created/inserted using TerosHDL

TerosHDL suggests to create an instance of entities that are part of the current project, which is very helpful. It would be even better, if such an instance template could be inserted for arbitrary entities/components that are contained in referenced libraries. It would be great to have e.g. the Xilinx unisim primitives available to insert. I understand that suggesting them directly in the auto-complete dialog would be impracticable, because of the number of components that may be in the referenced libraries, which would clutter the menu and probably impact performance.

Describe the solution you'd like Therefore, I'd like to suggest a new entry in the Teros command menu, "TerosHDL: Insert instance template of...", which in the next step asks for the component/entity name to instantiate. In a more advanced version, auto-complete/suggestions could be added here after the user has typed a few chars of the name, but for a first implementation, having to type in/paste the full name would be sufficient.

Describe alternatives you've considered Please note that because of #97, the work around to use "TerosHDL: Generate template", then "Copy as instance" does not work for the unisim_VCOMP.vhd file (and probably many others), since it contains more than one component and TerosHDL only copies

VCOMPONENTS_inst : entity work.VCOMPONENTS
  port map (
  );

no matter the cursor position in that library. So the only way to I know to insert instance templates is to copy them from the Xilinx docs, which is not too different from the process without TerosHDL.

Additional context TerosHDL can already show me the component declaration on hover over such an instantiation, therefore the data is somewhere available (though this might be the language server).