anzwdev / al-code-outline

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

Issues running cleanup: "Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported." #538

Closed jwikman closed 7 months ago

jwikman commented 8 months ago

I'm trying to run the Run Code Cleanup on the Active Project function, with below settings:

        "alOutline.codeCleanupActions": [
            "AddMissingParentheses",
            "AddObjectCaptions",
            "FixKeywordsCase",
            "FixIdentifiersCase",
            "LockRemovedFieldCaptions",
            "RemoveEmptyLines",
            "RemoveEmptySections",
            "RemoveEmptyTriggers",
            "RemoveRedundantAppAreas",
            "RemoveRedundantDataClassification",
            "RemoveStrSubstNoFromError",
            "SortPermissions",
            "SortPermissionSetList",
            "SortProperties",
            "SortTableFields",
            "TrimTrailingWhitespace"
        ],

This has worked just fine earlier (but probably a couple of months since last time I did this...), but today it fails with this error being shown:

One or more of actions failed: Add Parentheses: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Add Object Captions: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Fix Keywords Case: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Fix Identifiers Case: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Lock Removed Table Fields Captions: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Remove Empty Lines: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Remove Empty Sections: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Remove Empty Triggers: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Remove Redundant App Areas: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Remove Redundant DataClassification: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Remove StrSubstNo from Error: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Sort Permissions: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Sort PermissionSet List: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Sort Properties: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Sort Table Fields: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported., Trim Trailing Whitespace: error - Unexpected StringComparison type: 'CurrentCultureIgnoreCase'. Only 'Ordinal' and 'OrdinalIgnoreCase' are supported.,

On the same computer I can run this (with same settings) without issues on another project.

I can also run the Run Code Cleanup on the Active Editor action on the same project where I get above error. But since it is a 500 files project, I cannot isolate the issue in a simple way.

Any clues on what is going on? Or suggestions on what I should do to figure out the cause?

anzwdev commented 8 months ago

Maybe one of your files have a different encoding than others? I will modify extension to use OrdinalIgnoreCase instead of CurrentCultureIgnoreCase.

jwikman commented 8 months ago

Yeah, maybe. Just wonder how I can figure out which one in an efficient way.. 😅

anzwdev commented 7 months ago

Thank you for reporting your issue. It has been fixed in the latest release.

jwikman commented 7 months ago

Thanks @anzwdev, I can confirm that this fixed the problem in my project! 👍