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

Use quotes around field names that start with an integer #293

Merged

Conversation

zeande
Copy link
Contributor

@zeande zeande commented Nov 16, 2023

In AL Code, it is required that any field name starting with an integer is wrapped in double quotes. If not, then the compiler throws a huge fit.

When saving a file, the CRS language extension currently removes quotes from these field names, resulting in uncompilable code. Even if using ">Save without formatting", the CRS extension still removes the quotes. This problem is described in #153

This fix changes the StringFunctions.encloseInQuotesIfNecessary method to also recognize such field names and enclose them in quotation marks.

@waldo1001
Copy link
Owner

Thanks for this pullrequest.
would you see it possible to foresee a unit test?

@zeande
Copy link
Contributor Author

zeande commented Nov 20, 2023

Thanks for this pullrequest. would you see it possible to foresee a unit test?

Sorry, was a bit apprehensive, since I'm not familiar with the language. The latest commit contains some unit tests for the change.

@zeande
Copy link
Contributor Author

zeande commented Nov 24, 2023

@waldo1001 - unit tests added. If you are OK with the proposed changes, this PR would be ready to merge.

Local test result output:

image

image

@waldo1001 waldo1001 merged commit 3cea7fb into waldo1001:master Nov 27, 2023
@waldo1001
Copy link
Owner

Thanks so much! 🙏

@sschuh
Copy link

sschuh commented Nov 27, 2023

Please revert this change, this causes some other side effects.
I ask my colleagues for details. More infos will be coming soon.

@sschuh
Copy link

sschuh commented Nov 28, 2023

Here it is:
tnavguy - 1729226412325032325

@zeande
Copy link
Contributor Author

zeande commented Nov 28, 2023

Here it is:

#295 addresses this issue

@zeande zeande deleted the bugs/153-Quote-Names-Start-With-Number branch November 28, 2023 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants