Closed Arthurvdv closed 8 months ago
Same applies to the 'Find Event' (probably uses the same code path as the 'Subscribe to Event' scenario)
Not part of the bug itself, but the event name, in this case 'OnChecklistLoading', can also skip the single-quotes, which has been recommended since BC 22 - if it's just a matter of updating the code-snippet used for the event generation. :)
But just a simple question about a semicolon: why not?
But just a simple question about a semicolon: why not?
There's some valid arguments listed here on X https://twitter.com/arthrvdv/status/1727729430737342791
@fvet Please mind that people who are not logged into Twitter / X cannot read any of the answers below, thanks to Elon.
I’ve try’ed to summarize all the reasons in the documentation on the rule of the LinterCop; https://github.com/StefanMaron/BusinessCentral.LinterCop/wiki/LC0024
So based on the documentation, syntactically the ";" is not something that ends a statement in (Pasc)AL, but it actually is a separator symbol to separate statements. That's why procedure declaration should not end with semicolon and also the reason why you can omit it for the last statement.
We'll se what we can do about the snippets and the copy event subscriber but no other changes. The separator remains a valid syntax.
1. Describe the bug There are two actions in the AL Language VS Code extension, where I'm aware of, that add an semicolon at the ending of a Procedure declaration.
A) 'Subscribe to Event' (AL Explorer) B) 'Implement interface' code action
2. To Reproduce (A) - 'Subscribe to Event' (AL Explorer) From the AL Explorer select the tab EVENTS. Select an event and hit the Subscribe button. Paste the content of the clipboard in an AL file
The semicolon at the ending of
Checklist_OnChecklistLoading
procedure should not be there.2. To Reproduce (B) - 'Implement interface' code action Create an codeunit which implements an interface Select the 'Implement interface' code action
The semicolon at the ending of
Myprocedure
procedure should not be there.