iliazeus / vscode-ansi

VS Code extension enabling ANSI color styling for text documents
https://marketplace.visualstudio.com/items?itemName=iliazeus.vscode-ansi
MIT License
57 stars 6 forks source link

Extension not activated when just opening a text file and changing the language to ANSI text #28

Closed segevfiner closed 10 months ago

segevfiner commented 10 months ago

If I open a plain text (.txt) file in VS Code that is recognized as "Plain Text" and switch the language mode to "ANSI Text", I won't get any color highlighting as the extension is not getting activated by VS Code, colors will only appear after I open the preview once. It is likely that an activationEvent for onLanguage:ansi is missing.

iliazeus commented 10 months ago

From my understanding, all activation events should've been covered by the implicit activation events feature.

Can you please tell me your VSCode version? Ideally, copy-and-paste all the info from the Help: About window.

segevfiner commented 10 months ago
Version: 1.86.0 (Universal)
Commit: 05047486b6df5eb8d44b2ecd70ea3bdf775fd937
Date: 2024-01-31T10:29:15.765Z
Electron: 27.2.3
ElectronBuildId: 26495564
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0
segevfiner commented 10 months ago

This is probably the reason: https://github.com/microsoft/vscode/blob/ec291c126878742ad640055ce604a58129cd088c/src/vs/workbench/services/language/common/languageService.ts#L108-L114

It is only implicit if you declare a language configuration.

iliazeus commented 10 months ago

Looks like you're right. It is looking specifically for the configuration property.

I will update this extension to include a dummy language-configuration.json file, and open an issue in the VSCode repo.

iliazeus commented 10 months ago

Fixed in v1.1.7.