anzwdev / al-code-outline

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

Text Decorators does not work correctly when app.json is saved as UTF8-BOM #534

Closed zabcik closed 7 months ago

zabcik commented 9 months ago

Hello,

There is probably issue in "FileUtils.cs" in function ReadAllText() when reading manifest "app.json". StreamReader does not read UT8-BOM correctly. Maybe truncate BOM bytes (0xEF, 0xBB, 0xBF). Or specify Encoding.UTF8 to handle UTF8-BOM?

If you have question why I have app.json saved in UTF8-BOM... Because PowerShell 5.1 saves it to this encoding when processing by devops pipeline...

This encoding issue should affect more functionality...

Thank you for this extension. :-)

app.json with UTF8-BOM: image

app.json with UTF8: image

Extension: Name: AZ AL Dev Tools/AL Code Outline Id: andrzejzwierzchowski.al-code-outline Description: AZ AL Development Tools: AL code outline, object browser, object creators Version: 3.0.56 Publisher: Andrzej Zwierzchowski VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=andrzejzwierzchowski.al-code-outline

VS Code: Version: 1.85.2 (user setup) Commit: 8b3775030ed1a69b13e4f4c628c612102e30a681 Date: 2024-01-18T06:40:10.514Z Electron: 25.9.7 ElectronBuildId: 26354273 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.19045

anzwdev commented 7 months ago

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