mshr-h / vscode-verilog-hdl-support

HDL support for VS Code
MIT License
296 stars 78 forks source link

[BUG] A '\t' is inserted unexpectedly when instantiating verilog modules #493

Closed RickyTino closed 1 month ago

RickyTino commented 3 months ago

Describe the bug Actually I am not quite sure if it is a bug or a feature. The plugin always insert a "\t" in front of the first signal connection when using the "module instantiation" provided by this plugin.

Environment (please complete the following information):

Steps to reproduce Steps to reproduce the behavior:

  1. In certain source file press alt+i
  2. Select any SV module to instantiate
  3. See a tab '\t' appear in front of the first signal connection

Expected behavior No '\t' at all, or provide an option to set whether there be a '\t'

Actual behavior image

Additional context N/A

RickyTino commented 3 months ago

This problem also exists in v1.13.0 - recently tested

mshr-h commented 3 months ago

Please include repro.

RickyTino commented 3 months ago

Please include repro.

Steps described above, but I have some new findings. latest update below: (Let's assume this file uses 4 spaces for indentation)

  1. In certain .sv source file, press 'tab' key to produce a 4-space indent;
  2. press alt+i (or ctrl+shift+p, then choose "Verilog: Instantiate Module")
  3. Select a .sv file to instantiate. This file should contain a module with parameter.
  4. See a tab character '\t' appear in front of the first signal connection

image

I think this time I've made it detailed enough though :) And thanks for replying, I like your extension, saved a lot of my time!

OmarElfouly commented 1 month ago

Hello @mshr-h :)

I am new to contributing and I am excited to start with this issue. Can I ask if it would be preferred that the Instantiate Module not add a \t or would it be better to provide an option to decide whether or not to add a \t?

mshr-h commented 1 month ago

@OmarElfouly Thank you for your comment! I guess there's an option or status to indicate whether the indentation is a tab or spaces in vscode. So it would be great to follow it.

OmarElfouly commented 1 month ago

Alright Ill start hunting it down and Ill create a PR as soon as Im done