Open jacopoabramo opened 5 years ago
It makes sense and I'm working on functionality to enable this kind of behaviour in the future. The fundamental difference here is processing a file in the context of a wider workspace, rather than just itself.
I take your point about defaults, that is harder to detect, but at a minimum it would be nice to offer autocomplete or highlight invalid ports.
Including a component declaration inside an architecture is one of the harder problems to solve, as the component only specifies what an instantiated entity should look like, not where it is. Also, resolving components or entities within libraries is similarly difficult because libraries are managed outside of the VHDL in a tool-specific manner. I would like to support libraries in the future, but my focus for this extension is on providing as much functionality with zero-configuration as possible. I.e. I do not want a user to have to specify library to folder mappings within the VSCode settings.
I usually use VS Code mostly in terms of file editing; normally I work in parallel with Vivado (a Xilinx tool used to synthesize VHDL code for their products) because currently there is no way for VS Code to identify whether an entity has been included correctly within the project, or even within a specific folder.
That being said, my idea was having a folder indexing which would be capable of reading the code and being able to identify if the component I'm trying to instantiating somewhere is either present within my path, and if it is coherent with the entity definition itself.
For example:
It would be nice to identify the fact that there is no
port3
associated to i_myComp. It would be probably a bit more complicated when considering the possibility thatport3
or any other port may also have a default value associated, but I guess it would be a start anyway.Would this make sense to you @richjyoung ?