Is your feature request related to a problem? Please describe.
Using the preview force:source:deploy functionality, any errors encountered sit in the output view rather than the problem view, which means that no files get decorated with error markers.
Describe the solution you'd like
This makes sense when there are high level deployment errors (dependent class invalid, for example), but where there are aura linter or apex compilation errors, which include line/column information, it would be really helpful to have these in the problem view - not only to mark up the file but also to be able to click on the problem and jump straight to it.
Describe alternatives you've considered
None that I can think of.
Additional context
I might try to pick this one up. Been looking for a good issue to start contributing with. I think we just need to create a createDiagnosticCollection and parse the errors in packages/salesforcedx-vscode-core/src/commands/forceSourceDeploy.ts.
@ntotten thoughts?
@ChuckJonas That would be great! I think the feature makes sense. The one issue is that I think the errors in problems view should ONLY be issues related to linter or compilation errors. There are other errors that could happen that shouldn't be there (i.e. auth error, connection issue, etc.) @vazexqi any objections?
Yes, this would be a great addition. I haven't thought of all the semantics yet but there might be some issue with the JSON results (some of them might not contain the proper file name, line number, or column number). I've not done an exhaustive check of all the errors but those are some of the caveats. When you encounter them, we can fix them as well.
CC: @lcampos
@ntotten @vazexqi
Is there a way to silence the update message on stderr or move the sfdx force:source:deploy compile errors to stdout?
I've added withJson() to the forceSourceDeploy cmd, and that gives me JSON for compile errors to stderr but the update message is going to make it a PITA to parse (although it's kinda unexpected as without the withJson they get put in stdout).
Ideally stdout would JUST contain the compile errors....
sfdx-cli: update available from 6.27.0 to 6.31.0-32aa4b4408
{"message":"Deploy failed.","status":1,"stack":"DeployFailed: Deploy failed.\n at ALMError (/Users/jonas/.local/share/sfdx/plugins/node_modules/salesforce-alm/dist/lib/almError.js:44:19)\n at MetadataRegistry.initializeMetadataTypeInfos.then.catch.e (/Users/jonas/.local/share/sfdx/plugins/node_modules/salesforce-alm/dist/lib/source/sourceApiCommand.js:58:31)\n at tryCatcher (/Users/jonas/.local/share/sfdx/plugins/node_modules/bluebird/js/release/util.js:16:23)\n at Promise._settlePromiseFromHandler (/Users/jonas/.local/share/sfdx/plugins/node_modules/bluebird/js/release/promise.js:510:31)\n at Promise._settlePromise (/Users/jonas/.local/share/sfdx/plugins/node_modules/bluebird/js/release/promise.js:567:18)\n at Promise._settlePromise0 (/Users/jonas/.local/share/sfdx/plugins/node_modules/bluebird/js/release/promise.js:612:10)\n at Promise._settlePromises (/Users/jonas/.local/share/sfdx/plugins/node_modules/bluebird/js/release/promise.js:687:18)\n at Async._drainQueue (/Users/jonas/.local/share/sfdx/plugins/node_modules/bluebird/js/release/async.js:138:16)\n at Async._drainQueues (/Users/jonas/.local/share/sfdx/plugins/node_modules/bluebird/js/release/async.js:148:10)\n at Immediate.Async.drainQueues [as _onImmediate] (/Users/jonas/.local/share/sfdx/plugins/node_modules/bluebird/js/release/async.js:17:14)\n at runCallback (timers.js:773:18)\n at tryOnImmediate (timers.js:734:5)\n at processImmediate [as _immediateCallback] (timers.js:711:5)","name":"DeployFailed","result":[{"columnNumber":"5","lineNumber":"4","error":"Missing ';' at '}' (4:5)","fullName":"Testing","type":"ApexClass","filePath":"force-app/main/default/classes/Testing.cls"}],"warnings":[]}
@ntotten @ChuckJonas
Is this feature released in Winter '19?
I do not see it working when I click on a error with line and column numbers in the out window. It does show the error line with a hyperlink though.
@venkatpolisetti I submitted a PR (#613) but it's still waiting for final approval. Not sure when that may happen
Hi @venkatpolisetti @ChuckJonas, sorry for the delay on getting the PR merged, we've been a bit busy getting the last couple of releases out. I'll get to this in the next days and will keep the thread up to date.
Added in #717
Most helpful comment
Hi @venkatpolisetti @ChuckJonas, sorry for the delay on getting the PR merged, we've been a bit busy getting the last couple of releases out. I'll get to this in the next days and will keep the thread up to date.