Skip to content

feat(language-core): add context interface to allow plugins to augment it easily#5963

Open
KazariEX wants to merge 1 commit intovuejs:masterfrom
KazariEX:feat/context-interface
Open

feat(language-core): add context interface to allow plugins to augment it easily#5963
KazariEX wants to merge 1 commit intovuejs:masterfrom
KazariEX:feat/context-interface

Conversation

@KazariEX
Copy link
Member

@KazariEX KazariEX commented Feb 14, 2026

Example:

import type { VueLanguagePlugin } from "@vue/language-core";

const plugin: VueLanguagePlugin = () => {
  return {
    version: 2.1,
    resolveEmbeddedCode(fileName, sfc, embeddedCode) {
      if (!embeddedCode.id.startsWith("script_")) {
        return;
      }
      embeddedCode.content.push(`interface __VLS_Context { $route: ... }`);
    },
  };
};

export default plugin;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant