AL icon indicating copy to clipboard operation
AL copied to clipboard

Not getting Quick fix options

Open Srbaxter52 opened this issue 6 years ago • 6 comments

Issue Type: Bug

I am tring to update my code for a coming change by Microsoft. This change has to do with the WITH Statement being obsoleted. We have several sections of code that utlize this statement. From all the documentation I have seen on this, there should be a quick fix for this. I have not been able to get any quick fix options to show up for my errors. I don't know if I am missing something or they are in another extension that I don't have.

Extension version: 6.0.344420 VS Code version: Code 1.49.3 (2af051012b66169dde0c4dfae3f5ef48f787ff69, 2020-10-02T17:57:01.595Z) OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel(R) Xeon(R) Silver 4114 CPU @ 2.20GHz (1 x 2195)
GPU Status 2d_canvas: unavailable_software
flash_3d: disabled_software
flash_stage3d: disabled_software
flash_stage3d_baseline: disabled_software
gpu_compositing: disabled_software
multiple_raster_threads: disabled_off
oop_rasterization: disabled_off
opengl: disabled_off
protected_video_decode: disabled_off
rasterization: disabled_software
skia_renderer: disabled_off_ok
video_decode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
Load (avg) undefined
Memory (System) 16.00GB (13.70GB free)
Process Argv --crash-reporter-id c6fa4467-e963-4342-87a6-d5de876f9009
Screen Reader no
VM 0%

Srbaxter52 avatar Oct 05 '20 15:10 Srbaxter52

You can use this VS Code extension for fixing it: https://marketplace.visualstudio.com/items?itemName=andrzejzwierzchowski.al-code-outline Description: https://twitter.com/anzwdev/status/1311783292857995264?s=20

NKarolak avatar Oct 05 '20 16:10 NKarolak

...but unfortunately that extension suffers from these bugs: https://github.com/microsoft/AL/issues/6190#issuecomment-703746307

I have seen this from "AZ AL Dev Tools" extension, which may be calling the underlying 'official' fixers? - and which also gets this [prepending Rec. to field names where there can be no ambiguity] wrong for other functions like TestField, GetFilter, CalcFields - and, worse, also appends a pointless 2nd record name to variables other than Rec!! e.g. I saw it producing code something like SEPADirectDebitMandate.SetRange(SEPADirectDebitMandate."Mandate ID", ... - gross!

dzzzb avatar Oct 05 '20 16:10 dzzzb

Then use this extension to fix all implicit withs: https://marketplace.visualstudio.com/items?itemName=davidfeldhoff.al-codeactions I have used this one, it definitely works very well if you mind the instructions how to use.

NKarolak avatar Oct 05 '20 16:10 NKarolak

I tried the fix implicit in the AL CodeActions extension and it was placing Rec. several times and in the middle of code causing new errors to pop up. Is there one that handles the explicit with statements though? Some of mine can be long sections of code. This is mainly to do with subscribers or our own posting processes. I have seen snapshots of a quickfix option to do this, but I am not getting this from base VSC and AL extension. I am hoping to find a solution to this before I have to just past the table variable over and over.

Srbaxter52 avatar Oct 05 '20 17:10 Srbaxter52

The first extension I mentioned was supposed to also fix explicit withs.

NKarolak avatar Oct 05 '20 17:10 NKarolak

The first one seems to work fine thank you.

Srbaxter52 avatar Oct 05 '20 18:10 Srbaxter52