rasmustidselbak / al-formatter Goto Github PK
View Code? Open in Web Editor NEWFormatting AL language files in VS Code
License: MIT License
Formatting AL language files in VS Code
License: MIT License
If you have a string like 'x''x' then when formatting it becomes 'x' 'x'.
The extra space causes the compiler to complain with a "',' expected" message.
Probably I did something wrong, but I don't get the formatting to work. I tried uninstalling and installing again. Why the shortcut Alt+Shift+F and the ? format document don't format my al file?
a line like :
trigger OnRun(); begin end;
is being ignored.
The AL best practice says, you should call a method with multiple parameters like this:
MyFunction(Param1, Param2);
The formatter formats it to:
MyFunction(Param1,Param2);
Installed Version: 2.1.0
Which makes the text
Message('let''s show a message');
to
Message('let' 's show a message');
which doesn't compile
Hi
In vs code you can do a syntax similar to :
//#region layout
al code for layout
//#endregion
This works as a region so you can get cleaner code (eg you can encapsulate chunks of code)
However this only works if the #region comment is all the way to the left, and not indented as and alt + shif + f would do.
Would it be possible to not format comments starting with //# or something similar?
Regards
Christoffer Andersen
According to https://marketplace.visualstudio.com/items?itemName=rasmus.al-formatter, the version 3.0.0 is available.
This repository only has version 2.0.1 though, unfortunately, according to the README file.
Can you please update this repository with the latest version?
Or is there another public repository with the latest version?
It may be outside of "just formatting", but wouldn't it be nice if it also could conform the soon to expire CaptionML, TooltipML, InstructionTextML and all the other "ML"' properties into the new labels as of the October release. Including making textconst's into labels. ๐
It would only work with ENU, so it may have to in a separate function then the current "Format Document", not to mess up things for those with more languages.
Just my preference: to have an empty line between functions
Not:
local procedure "just a name2"();
var
mycust: Record customer;
mycode: Code[10];
mydec: Decimal;
myint: Integer;
begin
Message('let us show another message');
repeat
Message('Customer %1',mycust."No.");
until mycust.Next < 1;
end;
[EventSubscriber(ObjectType::Table,18,'OnAfterInsertEvent','',true,true)]
local procedure MyProcedure();
var
myInt: Integer;
begin
Message('from an unformatted codeunit, subscribed on table 18');
end;
var
myInt: Integer;
But:
local procedure "just a name2"();
var
mycust: Record customer;
mycode: Code[10];
mydec: Decimal;
myint: Integer;
begin
Message('let us show another message');
repeat
Message('Customer %1',mycust."No.");
until mycust.Next < 1;
end;
[EventSubscriber(ObjectType::Table,18,'OnAfterInsertEvent','',true,true)]
local procedure MyProcedure();
var
myInt: Integer;
begin
Message('from an unformatted codeunit, subscribed on table 18');
end;
var
myInt: Integer;
when i format an AL document, i get error:
[Error - 9:35:10 AM] Request textDocument/formatting failed.
Message: Request textDocument/formatting failed with message: Cannot read property 'trim' of undefined
Code: -32603
i use V2.1.0
Please allow number of spaces to be set inside the settings to choose between 2 and 4 spaces
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.