Closed xusine closed 3 years ago
Yep, preprocessing is not implemented yet. Work on-going there, but it will take some time before I can make it.
Hey @Xusine1131 Have you tried using a task? (Tasks can now be defined for a user, instead of per workspace)
Snippet here: https://github.com/eirikpre/VSCode-SystemVerilog/issues/63#issuecomment-618331523
It is not shown in the example, but you can use the attribute 'env' as well.
Thank you @eirikpre It's nice to regard linting as a task. But I think it's not very convenient since I let the linter automatically run when saving files. Is it possible to automatically run a task on saving the file?
Yes, I'm certain I've seen an extension that runs a task on save :) I haven't tried it myself, but maybe this will do the trick? https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave
Thank you @eirikpre ! I think you can refer to that extension since it can run commands with predicated Variables. If the parsing function is found, this issue can be directly solved!
https://github.com/emeraldwalk/vscode-runonsave/blob/master/src/extension.ts#L195 I think what he did is just replacement.
Just keeping the task open to formally describe this on the wiki and remove the internal launch of linters :)
https://code.visualstudio.com/docs/editor/variables-reference
At present, the lint command is "launchConfiguration" + ${file}, and any VSCode predefined variables are not supported. However, it's quite normal to preprocess the opening file before pass it to the linter.