Description
Describe the bug
A clear and concise description of what the bug is.
Environment (please complete the following information):
- OS: Windows 11 24H2 build 26100.3915]
- VS Code version 1.99.3
- Extension version 1.16.0
- verible-verilog-format v0.0-3973-g904f446f
Steps to reproduce
Steps to reproduce the behavior:
Directly open vscode and then open the file
Directly open vscode and create a new v/sv File
Use code [PathToFile] to open
Etc.
In summary, the situation is that execute Formatter without workspaceFolders
Log
Output -> Verilog
2025-04-29 19:44:20.974 [info] [SystemVerilogFormatProvider] Temp file created at:C:\Path\To\Temp\veribleVerilogFormatter-fc9e776196dbce107afd4e585f300c03.tmp.sv
2025-04-29 19:44:20.974 [info] [SystemVerilogFormatProvider] Executing command: verible-verilog-format --inplace C:\Path\To\Temp\veribleVerilogFormatter-fc9e776196dbce107afd4e585f300c03.tmp.sv
2025-04-29 19:44:20.974 [error] [SystemVerilogFormatProvider] TypeError: Cannot read properties of undefined (reading '0')
Expected behavior
Format should be executed
Actual behavior
No changes
Causes of the problem
I tracked the and the problem stemmed from no workspace in variable workspaceFolders
If vscode is not opened in the worksapce, workspaceFolders cannot be indexed
The last commit of this file caused this problem. Perhaps we should check whether workspace exists in workspaceFolders
By the way, why not print the stack information in the catch? (Maybe I haven't found how to view it)