doc/devdocs/common/monaco-editor.md
Monaco is the text editor that powers Visual Studio Code. In PowerToys, Monaco is integrated as a component to provide advanced text editing capabilities with features like syntax highlighting, line numbering, and intelligent code editing.
Monaco is primarily used in:
Monaco is embedded into PowerToys' WinUI 3 applications using WebView2. This integration allows PowerToys to leverage Monaco's web-based capabilities within desktop applications.
The Monaco editor files are located in the relevant module directories. For example, in Registry Preview, Monaco files are bundled with the application resources.
The current Monaco version can be found in the loader.js file, specifically in the variable named versionMonaco.
Updating Monaco requires several steps:
For detailed step-by-step instructions, see the FilePreviewCommon documentation.
The Monaco update process typically takes approximately 30 minutes.
When updating Monaco, you can refer to previous Monaco update PRs as examples, as they mostly involve copy-pasting the Monaco source code with minor adjustments.
Monaco can be customized to support new language definitions for syntax highlighting:
For detailed instructions on adding language definitions, see the FilePreviewCommon documentation.
To make Monaco handle additional file extensions using existing language definitions:
For detailed instructions on adding file extensions, see the FilePreviewCommon documentation.
Example: If Monaco processes TXT files and you want it to preview LOG files the same way, you can add LOG extensions to the TXT language definition.
Monaco source files are managed via a script (Generate-Monaco-wxs.ps1) that:
This approach simplifies maintenance and updates of the Monaco editor within PowerToys.