A Monaco Editor language server for Vue Single File Components (SFC). This library provides Vue language support for the Monaco editor, offering rich editing experiences with syntax highlighting, IntelliSense, error detection, and more for Vue SFCs.
- Vue SFC (Single File Component) support
- Syntax highlighting for Vue, HTML, CSS, JavaScript, and TypeScript
- IntelliSense and auto-completion for Vue templates and scripts
- Error detection and linting
- Auto-closing of tags and brackets
- Folding support for regions
- Proper indentation and formatting rules
- Integration with Monaco Editor's web worker system
npm install @vuebro/monaco-sfcimport initMonacoSFC from "@vuebro/monaco-sfc";
// Initialize with your Monaco instance
initMonacoSFC(monaco);
// Now you can create Vue SFC editors
const editor = monaco.editor.create(document.getElementById("container"), {
value: "<template>\n <div>Hello Vue in Monaco!</div>\n</template>",
language: "vue",
});This package relies on:
@volar/monaco- Vue Language Server integration for Monaco@vue/language-core- Vue Language Service core@vue/language-service- Vue Language Servicemonaco-editor-core- The Monaco Editorvscode-uri- URI handling for VS Code compatibility
This package sets up the Monaco Editor to handle Vue SFCs by:
- Registering the 'vue' language with Monaco
- Loading appropriate language configurations for Vue and its embedded languages
- Creating a web worker to handle language service operations
- Activating features like auto-insertion, markers, and syntax providers
AGPL-3.0-only