Giter Club home page Giter Club logo

al-formatter's People

Contributors

rasmustidselbak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

al-formatter's Issues

'x''x' becomes 'x' 'x'

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.

TableRelation = too much indention

Love this little extension, using it with a TableRelation with if's and where on different lines cause the following lines to indent.

31fd70f7-17bf-4f38-a9e8-b8f1b7cf6a30

Also CONST + FILTER is not changed to lower case.

Multi-line procedural var declarations: Too much indention

The old pascal developer in me really like how procedure declarations now is almost like in pascal.
That means we can split the declaration lines and make the code even more readable, even with lots of vars.
But right now if that's used, then it cases the following lines to be too much indented.

7f7d9a65-10ee-4292-9fe9-7200c379e694

Format document does not work!?

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?

Issue with case

Hi,
I'm having an issue when formatting a case.
This code
image
is transformed to
image

It throws an error,
image

I don't know if I'm doing something wrong or if it is a bug,

Thanks!

Space after ,

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

'' becomes ' '

Which makes the text

Message('let''s show a message');

to

Message('let' 's show a message');

which doesn't compile

Block comments

When using the block comments /* ... */in an AL file, the AL Formatter seems to split them with blanks.
Result is having / * ... * / wich is no longer recognized as a block comment.

Before
image

After
image

Regions in al code

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

Suggestion: TextConstML to Label

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.

Suggestion: add extra carriage return behind functions/elements

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;

Indentation for spaces

Please allow number of spaces to be set inside the settings to choose between 2 and 4 spaces

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.