Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Name patterns for new BC versions #141

Closed
ernestasjuska opened this issue Nov 4, 2019 · 12 comments
Closed

File Name patterns for new BC versions #141

ernestasjuska opened this issue Nov 4, 2019 · 12 comments

Comments

@ernestasjuska
Copy link

ernestasjuska commented Nov 4, 2019

Hi,

New code analysers from AL Language extension shows warning if file is not named correctly.
E.g: table 123 "PREFIX My Demo" should be in file PREFIXMyDemo.Table.al, and page extension 1234 "PREFIX My Demo Ext" extends "Standard Page" should be in file PREFIXMyDemoExt.PageExt.al.

My initial guess was to use this:

		"CRS.FileNamePattern": "<ObjectNameShort>.<ObjectType>.al",
		"CRS.FileNamePatternExtensions": "<ObjectNameShort>.<ObjectType>.al",
		"CRS.FileNamePatternPageCustomizations": "<ObjectNameShort>.PageCust.al"

This does not correctly capitalize object type (e.g. gives "codeunit" intead "Codeunit"), and does not give shorter extension object type (e.g. gives "pageextension" instead "PageExt").

I'm using AL Language extension 5.0.191295 (that's from insider BC version).

IMHO all that is missing is <ObjectTypeShortPascalCase> that would give "Table", "Page", "Codeunit", "Report", "Query", "XmlPort", "Enum", "TableExt", "PageExt", "EnumExt", "PageCust".

Analyser does not consider case however it PascalCase looks nicer.

Thanks.

image

@waldo1001
Copy link
Owner

So .. they made a rule to force a fixed naming behaviour :-/. Not sure I like that :(.

Thanks for the headsup - I guess I'll need to solve this by the time they release it.. .

@hmerbouche
Copy link

hmerbouche commented Nov 4, 2019

Hello,
It seems that the new naming rule of microsoft does not include the affix in the file name!
The new naming:
"ObjectNameExcludingPrefix.FullTypeName.al'
'ObjectNameExcludingPrefix.FullTypeNameExt.al'

Thanks

@waldo1001
Copy link
Owner

Well, I have an issue with this ... . If I change anything on the "auto renaming" part, I will start creating new names all of a sudden in existing environments - without people expecting it .. :-/.

Don't know what I should do, to be honest :(.

@waldo1001
Copy link
Owner

@ernestasjuska , @hmerbouche ,

I decided to add a seperate tag as suggested ... . As I don't have a complete overview - do you think this is conclusive - not sure about the controladdin :-/ - and no way I can look it up ... ?

            case 'page': return 'Page';
            case 'pageextension': return 'PageExt';
            case 'codeunit': return 'Codeunit';
            case 'table': return 'Table';
            case 'tableextension': return 'TableExt';
            case 'xmlport': return 'XmlPort';
            case 'report': return 'Report';
            case 'query': return 'Query';
            case 'profile': return 'Profile';
            case 'pagecustomization': return 'PageCust';
            case 'enum': return 'Enum';
            case 'enumextension': return 'EnumExt';
            case 'controladdin': return 'ConAddin';

@waldo1001
Copy link
Owner

@waldo1001
Copy link
Owner

I think these settings should work as "Best Practice", which make you able to use a prefix (or suffix), not add it in the filename, and the pascalcasing is there ... .

    "CRS.OnSaveAlFileAction": "Rename",
    "CRS.FileNamePattern": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
    "CRS.FileNamePatternExtensions": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
    "CRS.FileNamePatternPageCustomizations": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
    "CRS.ObjectNamePrefix": "ALDA ",
    "CRS.RemovePrefixFromFilename": true,

@hmerbouche
Copy link

@waldo1001

I tested the new vsix and the new setting, it seems just perfect!
Do you know when you can release this new version?
Thanks

@hmerbouche
Copy link

hmerbouche commented Nov 6, 2019

@waldo1001
To complete / correct your list :)
Object | Abbreviation

Request Page | RequestPage
Control Add-ins | ControlAddin
Dotnet | Dotnet

@ernestasjuska
Copy link
Author

ernestasjuska commented Nov 6, 2019

@waldo1001

Thanks. It works great.

Tested control add-ins naming:
For controladdins it should return "ControlAddIn" with capital "I".
image

Found one more type: interface "LBC My Interface" { } should be in file LBCMyInterface.Interface.al.
image

waldo1001 added a commit that referenced this issue Nov 6, 2019
@waldo1001
Copy link
Owner

Pretty soon ;-)

@DanielGoehler
Copy link

@waldo1001 Do you like to change ConAddin to ControlAddin like the Suggestion from Microsoft?

@mjmatthiesen
Copy link

Forced naming standard :( That would be the worst. The current standard isn't very readable. Gimme my spaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants