waldo1001 / crs-al-language-extension

Make working with the (Dynamics NAV / 365) AL Language easier and more efficient.
MIT License
34 stars 42 forks source link

CRS.OnSaveAlFileAction renames the file even with a correct name pattern #303

Open helenapi opened 3 weeks ago

helenapi commented 3 weeks ago

Hi, my settings.json is like this:

    "CRS.OnSaveAlFileAction": "Rename",
    "CRS.FileNamePattern": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
    "CRS.FileNamePatternExtensions": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",

When I try to save a file, named for example Actions.codeunit.al, the extension renames the file and closes and reopens it, even if the file already corresponds to the FileNamePattern setting. I also get an error:

image

And the VS code UI blinks and changes the file name in the tab to italic, which means that the tab will go away if I click on another file on the sidebar. This makes the workflow a bit troublesome

image

helenapi commented 3 weeks ago

I just found out that using

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

Seems to work as intended. Do you know why the original setting was displaying that behaviour? I also tried manually naming the file Actions.Codeunit.al (pascal case on object type) but the same weird behaviour happens

JeremyVyska commented 6 days ago

FYI, I have seen that - it's a case sensitivity issue. Close VSC, rename the "codeunit.al" to "Codeunit.al" and it will stop trying.

Still an "issue", but that's been my workaround

vytjak commented 5 days ago

Oh, what was bugging us for a while now as well, that weird message about existing file.