janjoerke / vscode-jenkins-pipeline-linter-connector

MIT License
60 stars 21 forks source link

Jenkinsfile must be saved prior to validation #24

Open madisonjsmith opened 4 years ago

madisonjsmith commented 4 years ago

It would be helpful if we didn't have to save the file to disk just to validate the syntax which is something developers would ideally want to do prior to saving to disk.

It would be better if the extension could take the current content from memory and send that to Jenkins as opposed to reading from file. If you really MUST read from file (sorry I don't have time to look at your source code) then another option would be to save the file in the background in the user's temp directory using some GUID and send that file to Jenkins for validation.

The point being, that validation needs apply to what the developer sees to prevent issues where a dev edits file, validates, which passes because it was valid before editing the file and then saves.

madisonjsmith commented 4 years ago

So...try using activeTextEditor.document.getText() instead of the path.