extend-language-plugin

Implements LSP language features across renderer, extension host, and plugin processes.

Updated May 13, 2026
One-click install
npx skills add https://github.com/lovebirdsx/universe-editor --skill extend-language-plugin-lovebirdsx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extend-language-plugin
Source: https://github.com/lovebirdsx/universe-editor/tree/main/.claude/skills/extend-language-plugin
Command: npx skills add https://github.com/lovebirdsx/universe-editor --skill extend-language-plugin-lovebirdsx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding or modifying language features (code actions, inlay hints, formatting, folding, semantic tokens) in this editor requires changes across four process boundaries—renderer, main, extension host, and the spawned LSP server—and missing any one link compiles fine but silently breaks the provider at runtime. ## Core Features & Use Cases - Data-flow mapping: Identifies which of the four data flows (provider calls, document sync, diagnostics push, provider registration) a change belongs to before editing code. - Task playbooks: Step-by-step file lists for adding a new provider type, extending provider payloads, tuning the LSP client, debugging diagnostics, and migrating a new language into a built-in plugin modeled on extensions/typescript. - Pitfall catalog: Documents twelve known failure modes such as KEEP IN SYNC bridge interfaces, 0-based vs 1-based positions, diagnostic owner mismatches, and virtual-scheme documents leaking to the LSP server. - Use Case: When adding a code action provider for TypeScript, follow the seven-step checklist covering rpc.ts protocol, extension-api, apiFactory, extensionService, renderer proxy, MainThreadLanguages, and the plugin's lspClient. ## Quick Start Ask the agent to add a new language provider such as inlay hints to the built-in TypeScript plugin and follow the data-flow checklist it produces.

Frequently Asked Questions about extend-language-plugin

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new language provider like code actions to a TypeScript LSP plugin?

Adding a provider touches seven layers: the rpc.ts protocol and LanguageProviderType enum, extension-api types, apiFactory bridge, extensionService handle routing, the renderer proxy factory, MainThreadLanguages registration, and the plugin's lspClient plus registerProviders call. Missing any layer compiles but the provider never fires.

How do I migrate a new language into a built-in extension plugin?

Copy the extensions/typescript structure with package.json activationEvents, an esbuild bundle, and src/extension.ts plus lspClient.ts files. Reuse the existing handle-based provider routing and generic DocumentSyncContribution, and add main-process path resolution with env injection if the language uses a standalone LSP server.

Why does my new provider compile but never get called at runtime?

The provider call crosses four process boundaries, so a missing link silently breaks it. Most often the LanguageProviderType enum entry or the type-to-factory switch branch in MainThreadLanguages was skipped; verify all seven steps of data flows A and D.

Why do diagnostics not appear or fail to clear in the editor?

Diagnostics flow from the LSP server through the plugin's diagnosticCollection to mainThreadLanguages.$publishDiagnostics and setModelMarkers. The marker owner must exactly equal the createDiagnosticCollection name, otherwise markers persist or collide with other sources.

Can the extension plugin call Electron APIs directly?

No, the extension host is pure Node with no Electron access. All Electron coupling such as tsserver path resolution stays in the main process and is passed to the plugin through environment variables like UNIVERSE_TSLS_CLI injected at host startup.

Why do hover requests fire for diff editor views and cause LSP errors?

Monaco language requests ignore model scheme, so diff view models with the same languageId reach the LSP server and trigger errors like no project found for URI. Gate document sync and every provider callback with a scheme equals file predicate, as done in extensions/typescript.