anzwdev / al-code-outline

AL Code Outline for Visual Studio Code
MIT License
51 stars 13 forks source link

[feature] Limit Enum Object Names to 30 Chars in AL File Wizard #591

Closed mjmatthiesen closed 1 month ago

mjmatthiesen commented 2 months ago

Right now enums can be created that have an object name length of anything you want, probably because it's technically allowed.

This will lead to warning AL0659 however, so it is not advised since these two enums would lead to runtime issues:

enum 50100 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa {}
enum 50101 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaab {}

Would be nice if we had a config option to limit the enum object name length to 30 by default. I think it should always be no more than 30, but others may have codebases that explicitly do it for some reason.

anzwdev commented 1 month ago

Thank you for reporting the issue. I've added a "soft" solution long time ago, it displays current name length on the right side of name textbox in the wizard. The latest release contains another option, there is a new alOutline.limitEnumNameLength setting, you can set it to true to limit name textbox to 30 characters.