From 579b37d8365503d47067baeee5b63e7f264ac037 Mon Sep 17 00:00:00 2001 From: Minsu Lee Date: Sun, 21 Dec 2025 17:03:10 +0900 Subject: [PATCH 1/4] feat(lsp): add Claude Code LSP plugins with multi-language server support Add comprehensive LSP (Language Server Protocol) plugin integration for Claude Code: - Add LSP CLI for language server setup and management (kotlin, dart) - Create 8 LSP plugins (astro, biome, dart, deno, kotlin, prisma, svelte, vue) - Each plugin includes .claude-plugin metadata and LSP configuration - Support Kotlin LSP launcher script for multiple platforms - Add bin entry point for lsp CLI command in package.json Supported language servers: - Astro: Astro SFC with TypeScript support - Biome: JavaScript/TypeScript linting and formatting - Dart: Dart language server with Flutter support - Deno: Deno runtime TypeScript/JavaScript - Kotlin: Kotlin language server with Java 21 runtime - Prisma: Prisma ORM schema editor - Svelte: Svelte component development - Vue: Vue 3 Single File Component support Each plugin provides: - .claude-plugin/plugin.json: Plugin metadata - .lsp.json: LSP server configuration - README.md: Setup and usage documentation --- packages/lsp/package.json | 3 + packages/lsp/src/cli.ts | 250 ++++++++++++++++++ .../lsp/astro-lsp/.claude-plugin/plugin.json | 9 + plugins/lsp/astro-lsp/.lsp.json | 9 + plugins/lsp/astro-lsp/README.md | 28 ++ .../lsp/biome-lsp/.claude-plugin/plugin.json | 9 + plugins/lsp/biome-lsp/.lsp.json | 21 ++ plugins/lsp/biome-lsp/README.md | 29 ++ .../lsp/dart-lsp/.claude-plugin/plugin.json | 9 + plugins/lsp/dart-lsp/.lsp.json | 9 + plugins/lsp/dart-lsp/README.md | 65 +++++ .../lsp/deno-lsp/.claude-plugin/plugin.json | 9 + plugins/lsp/deno-lsp/.lsp.json | 13 + plugins/lsp/deno-lsp/README.md | 33 +++ .../lsp/kotlin-lsp/.claude-plugin/plugin.json | 9 + plugins/lsp/kotlin-lsp/.lsp.json | 9 + plugins/lsp/kotlin-lsp/README.md | 56 ++++ .../lsp/kotlin-lsp/bin/kotlin-lsp-launcher | 87 ++++++ .../lsp/prisma-lsp/.claude-plugin/plugin.json | 9 + plugins/lsp/prisma-lsp/.lsp.json | 9 + plugins/lsp/prisma-lsp/README.md | 29 ++ .../lsp/svelte-lsp/.claude-plugin/plugin.json | 9 + plugins/lsp/svelte-lsp/.lsp.json | 9 + plugins/lsp/svelte-lsp/README.md | 28 ++ .../lsp/vue-lsp/.claude-plugin/plugin.json | 9 + plugins/lsp/vue-lsp/.lsp.json | 14 + plugins/lsp/vue-lsp/README.md | 28 ++ 27 files changed, 801 insertions(+) create mode 100644 packages/lsp/src/cli.ts create mode 100644 plugins/lsp/astro-lsp/.claude-plugin/plugin.json create mode 100644 plugins/lsp/astro-lsp/.lsp.json create mode 100644 plugins/lsp/astro-lsp/README.md create mode 100644 plugins/lsp/biome-lsp/.claude-plugin/plugin.json create mode 100644 plugins/lsp/biome-lsp/.lsp.json create mode 100644 plugins/lsp/biome-lsp/README.md create mode 100644 plugins/lsp/dart-lsp/.claude-plugin/plugin.json create mode 100644 plugins/lsp/dart-lsp/.lsp.json create mode 100644 plugins/lsp/dart-lsp/README.md create mode 100644 plugins/lsp/deno-lsp/.claude-plugin/plugin.json create mode 100644 plugins/lsp/deno-lsp/.lsp.json create mode 100644 plugins/lsp/deno-lsp/README.md create mode 100644 plugins/lsp/kotlin-lsp/.claude-plugin/plugin.json create mode 100644 plugins/lsp/kotlin-lsp/.lsp.json create mode 100644 plugins/lsp/kotlin-lsp/README.md create mode 100755 plugins/lsp/kotlin-lsp/bin/kotlin-lsp-launcher create mode 100644 plugins/lsp/prisma-lsp/.claude-plugin/plugin.json create mode 100644 plugins/lsp/prisma-lsp/.lsp.json create mode 100644 plugins/lsp/prisma-lsp/README.md create mode 100644 plugins/lsp/svelte-lsp/.claude-plugin/plugin.json create mode 100644 plugins/lsp/svelte-lsp/.lsp.json create mode 100644 plugins/lsp/svelte-lsp/README.md create mode 100644 plugins/lsp/vue-lsp/.claude-plugin/plugin.json create mode 100644 plugins/lsp/vue-lsp/.lsp.json create mode 100644 plugins/lsp/vue-lsp/README.md diff --git a/packages/lsp/package.json b/packages/lsp/package.json index 5f6b4ef..8939973 100644 --- a/packages/lsp/package.json +++ b/packages/lsp/package.json @@ -16,6 +16,9 @@ "python", "ai-coding" ], + "bin": { + "lsp": "./src/cli.ts" + }, "exports": { ".": "./src/index.ts" }, diff --git a/packages/lsp/src/cli.ts b/packages/lsp/src/cli.ts new file mode 100644 index 0000000..b913df3 --- /dev/null +++ b/packages/lsp/src/cli.ts @@ -0,0 +1,250 @@ +#!/usr/bin/env bun +/** + * LSP CLI - Setup and management for language servers + * + * Commands: + * lsp setup Setup/download a language server + * lsp version Show version + * lsp help Show help + */ + +import fs from 'node:fs/promises' +import os from 'node:os' +import path from 'node:path' +import process from 'node:process' +import { createLogger } from '@pleaseai/logger' +import { downloadAndExtract, getPlatformId } from './server/utils' + +const log = createLogger('lsp-cli') + +const VERSION = '0.1.6' + +/** + * Kotlin LSP setup configuration + */ +const KOTLIN_CONFIG = { + version: '0.253.10629', + lspUrl: 'https://download-cdn.jetbrains.com/kotlin-lsp/0.253.10629/kotlin-0.253.10629.zip', + java: { + 'win-x64': { + url: 'https://github.com/redhat-developer/vscode-java/releases/download/v1.42.0/java-win32-x64-1.42.0-561.vsix', + javaHomePath: 'extension/jre/21.0.7-win32-x86_64', + }, + 'linux-x64': { + url: 'https://github.com/redhat-developer/vscode-java/releases/download/v1.42.0/java-linux-x64-1.42.0-561.vsix', + javaHomePath: 'extension/jre/21.0.7-linux-x86_64', + }, + 'linux-arm64': { + url: 'https://github.com/redhat-developer/vscode-java/releases/download/v1.42.0/java-linux-arm64-1.42.0-561.vsix', + javaHomePath: 'extension/jre/21.0.7-linux-aarch64', + }, + 'osx-x64': { + url: 'https://github.com/redhat-developer/vscode-java/releases/download/v1.42.0/java-darwin-x64-1.42.0-561.vsix', + javaHomePath: 'extension/jre/21.0.7-macosx-x86_64', + }, + 'osx-arm64': { + url: 'https://github.com/redhat-developer/vscode-java/releases/download/v1.42.0/java-darwin-arm64-1.42.0-561.vsix', + javaHomePath: 'extension/jre/21.0.7-macosx-aarch64', + }, + } as Record, +} + +/** + * Dart SDK setup configuration + */ +const DART_CONFIG = { + version: '3.7.1', + platforms: { + 'win-x64': 'https://storage.googleapis.com/dart-archive/channels/stable/release/3.7.1/sdk/dartsdk-windows-x64-release.zip', + 'linux-x64': 'https://storage.googleapis.com/dart-archive/channels/stable/release/3.7.1/sdk/dartsdk-linux-x64-release.zip', + 'linux-arm64': 'https://storage.googleapis.com/dart-archive/channels/stable/release/3.7.1/sdk/dartsdk-linux-arm64-release.zip', + 'osx-x64': 'https://storage.googleapis.com/dart-archive/channels/stable/release/3.7.1/sdk/dartsdk-macos-x64-release.zip', + 'osx-arm64': 'https://storage.googleapis.com/dart-archive/channels/stable/release/3.7.1/sdk/dartsdk-macos-arm64-release.zip', + } as Record, +} + +async function setupKotlin(): Promise { + const platformId = getPlatformId() + if (!platformId) { + console.error(`Unsupported platform: ${process.platform} ${process.arch}`) + process.exit(1) + } + + const javaConfig = KOTLIN_CONFIG.java[platformId] + if (!javaConfig) { + console.error(`Unsupported platform for Kotlin: ${platformId}`) + process.exit(1) + } + + const cacheDir = path.join(os.homedir(), '.cache', 'dora', 'kotlin-lsp') + const javaDir = path.join(cacheDir, 'java') + const isWindows = platformId.startsWith('win-') + const kotlinLspScript = isWindows ? 'kotlin-lsp.cmd' : 'kotlin-lsp.sh' + const kotlinLspPath = path.join(cacheDir, kotlinLspScript) + const javaPath = path.join(javaDir, javaConfig.javaHomePath, 'bin', isWindows ? 'java.exe' : 'java') + const versionFile = path.join(cacheDir, '.version') + + console.log(`Setting up Kotlin LSP for ${platformId}...`) + console.log(`Cache directory: ${cacheDir}`) + + // Create cache directory + await fs.mkdir(cacheDir, { recursive: true }) + + // Download Java if needed + try { + await fs.access(javaPath) + console.log('Java 21 already installed') + } + catch { + console.log('Downloading Java 21...') + await downloadAndExtract(javaConfig.url, javaDir) + if (!isWindows) { + await fs.chmod(javaPath, 0o755) + } + console.log('Java 21 installed') + } + + // Download Kotlin LSP if needed + try { + await fs.access(kotlinLspPath) + console.log('Kotlin LSP already installed') + } + catch { + console.log('Downloading Kotlin LSP...') + await downloadAndExtract(KOTLIN_CONFIG.lspUrl, cacheDir) + if (!isWindows) { + await fs.chmod(kotlinLspPath, 0o755) + } + console.log('Kotlin LSP installed') + } + + // Write version file + await fs.writeFile(versionFile, KOTLIN_CONFIG.version) + + console.log('') + console.log('Kotlin LSP setup complete!') + console.log(` LSP script: ${kotlinLspPath}`) + console.log(` Java home: ${path.join(javaDir, javaConfig.javaHomePath)}`) +} + +async function setupDart(): Promise { + const platformId = getPlatformId() + if (!platformId) { + console.error(`Unsupported platform: ${process.platform} ${process.arch}`) + process.exit(1) + } + + const dartUrl = DART_CONFIG.platforms[platformId] + if (!dartUrl) { + console.error(`Unsupported platform for Dart: ${platformId}`) + process.exit(1) + } + + const cacheDir = path.join(os.homedir(), '.cache', 'dora', 'dart-lsp') + const isWindows = platformId.startsWith('win-') + const dartPath = path.join(cacheDir, 'dart-sdk', 'bin', isWindows ? 'dart.exe' : 'dart') + const versionFile = path.join(cacheDir, '.version') + + console.log(`Setting up Dart SDK for ${platformId}...`) + console.log(`Cache directory: ${cacheDir}`) + + // Create cache directory + await fs.mkdir(cacheDir, { recursive: true }) + + // Download Dart SDK if needed + try { + await fs.access(dartPath) + console.log('Dart SDK already installed') + } + catch { + console.log('Downloading Dart SDK...') + await downloadAndExtract(dartUrl, cacheDir) + if (!isWindows) { + await fs.chmod(dartPath, 0o755) + } + console.log('Dart SDK installed') + } + + // Write version file + await fs.writeFile(versionFile, DART_CONFIG.version) + + console.log('') + console.log('Dart SDK setup complete!') + console.log(` Dart binary: ${dartPath}`) +} + +function versionCommand(): void { + console.log(`@pleaseai/code-lsp ${VERSION}`) +} + +function helpCommand(): void { + console.log(` +@pleaseai/code-lsp - Language Server Protocol client and setup + +Usage: + lsp [options] + +Commands: + setup Setup/download a language server + Supported servers: kotlin, dart + version Show version + help Show this help + +Examples: + lsp setup kotlin Download and setup Kotlin LSP + lsp setup dart Download and setup Dart SDK +`) +} + +async function main(): Promise { + const args = process.argv.slice(2) + const command = args[0] + + switch (command) { + case 'setup': { + const server = args[1] + if (!server) { + console.error('Usage: lsp setup ') + console.error('Supported servers: kotlin, dart') + process.exit(1) + } + + switch (server.toLowerCase()) { + case 'kotlin': + await setupKotlin() + break + case 'dart': + await setupDart() + break + default: + console.error(`Unknown server: ${server}`) + console.error('Supported servers: kotlin, dart') + process.exit(1) + } + break + } + + case 'version': + case '-v': + case '--version': + versionCommand() + break + + case 'help': + case '-h': + case '--help': + case undefined: + helpCommand() + break + + default: + console.error(`Unknown command: ${command}`) + helpCommand() + process.exit(1) + } +} + +main().catch((error) => { + log.fatal({ err: error }, 'Unhandled error') + process.exit(1) +}) diff --git a/plugins/lsp/astro-lsp/.claude-plugin/plugin.json b/plugins/lsp/astro-lsp/.claude-plugin/plugin.json new file mode 100644 index 0000000..7e247ad --- /dev/null +++ b/plugins/lsp/astro-lsp/.claude-plugin/plugin.json @@ -0,0 +1,9 @@ +{ + "name": "astro-lsp", + "version": "1.0.0", + "description": "Astro language server for Claude Code - Astro framework support", + "author": { + "name": "PassionFactory" + }, + "repository": "https://github.com/chatbot-pf/code-please" +} diff --git a/plugins/lsp/astro-lsp/.lsp.json b/plugins/lsp/astro-lsp/.lsp.json new file mode 100644 index 0000000..e67e7d9 --- /dev/null +++ b/plugins/lsp/astro-lsp/.lsp.json @@ -0,0 +1,9 @@ +{ + "astro": { + "command": "npx", + "args": ["@astrojs/language-server", "--stdio"], + "extensionToLanguage": { + ".astro": "astro" + } + } +} diff --git a/plugins/lsp/astro-lsp/README.md b/plugins/lsp/astro-lsp/README.md new file mode 100644 index 0000000..380b016 --- /dev/null +++ b/plugins/lsp/astro-lsp/README.md @@ -0,0 +1,28 @@ +# Astro LSP Plugin for Claude Code + +This plugin provides real-time diagnostics and language features for Astro components using [@astrojs/language-server](https://github.com/withastro/language-tools). + +## Requirements + +- Node.js and npm in PATH + +The plugin uses `npx` to run the Astro language server on-demand. For better performance, you can install it globally: + +```bash +npm install -g @astrojs/language-server +``` + +## Supported File Types + +- Astro: `.astro` + +## Features + +- Astro component syntax validation +- TypeScript support in frontmatter +- Props and slots validation +- Integration with framework components (React, Vue, Svelte) + +## Configuration + +The Astro language server automatically integrates with your project's configuration. Ensure you have `astro.config.mjs` in your project root. diff --git a/plugins/lsp/biome-lsp/.claude-plugin/plugin.json b/plugins/lsp/biome-lsp/.claude-plugin/plugin.json new file mode 100644 index 0000000..1755f41 --- /dev/null +++ b/plugins/lsp/biome-lsp/.claude-plugin/plugin.json @@ -0,0 +1,9 @@ +{ + "name": "biome-lsp", + "version": "1.0.0", + "description": "Biome language server for Claude Code - linting and formatting for JS/TS/JSON/CSS", + "author": { + "name": "PassionFactory" + }, + "repository": "https://github.com/chatbot-pf/code-please" +} diff --git a/plugins/lsp/biome-lsp/.lsp.json b/plugins/lsp/biome-lsp/.lsp.json new file mode 100644 index 0000000..febf305 --- /dev/null +++ b/plugins/lsp/biome-lsp/.lsp.json @@ -0,0 +1,21 @@ +{ + "biome": { + "command": "npx", + "args": ["@biomejs/biome", "lsp-proxy", "--stdio"], + "extensionToLanguage": { + ".ts": "typescript", + ".tsx": "typescriptreact", + ".js": "javascript", + ".jsx": "javascriptreact", + ".mjs": "javascript", + ".cjs": "javascript", + ".mts": "typescript", + ".cts": "typescript", + ".json": "json", + ".jsonc": "jsonc", + ".css": "css", + ".graphql": "graphql", + ".gql": "graphql" + } + } +} diff --git a/plugins/lsp/biome-lsp/README.md b/plugins/lsp/biome-lsp/README.md new file mode 100644 index 0000000..311ecbf --- /dev/null +++ b/plugins/lsp/biome-lsp/README.md @@ -0,0 +1,29 @@ +# Biome LSP Plugin for Claude Code + +This plugin provides real-time linting and formatting diagnostics for JavaScript, TypeScript, JSON, and CSS files using [Biome](https://biomejs.dev/). + +## Requirements + +- Node.js and npm in PATH + +The plugin uses `npx` to run Biome on-demand. For better performance, you can install Biome globally or locally in your project: + +```bash +# Global installation +npm install -g @biomejs/biome + +# Or local installation in your project +npm install --save-dev @biomejs/biome +``` + +## Supported File Types + +- TypeScript: `.ts`, `.tsx`, `.mts`, `.cts` +- JavaScript: `.js`, `.jsx`, `.mjs`, `.cjs` +- JSON: `.json`, `.jsonc` +- CSS: `.css` +- GraphQL: `.graphql`, `.gql` + +## Configuration + +Biome looks for `biome.json` or `biome.jsonc` in your project root. See [Biome Configuration](https://biomejs.dev/reference/configuration/) for options. diff --git a/plugins/lsp/dart-lsp/.claude-plugin/plugin.json b/plugins/lsp/dart-lsp/.claude-plugin/plugin.json new file mode 100644 index 0000000..05bad65 --- /dev/null +++ b/plugins/lsp/dart-lsp/.claude-plugin/plugin.json @@ -0,0 +1,9 @@ +{ + "name": "dart-lsp", + "version": "1.0.0", + "description": "Dart language server for Claude Code - Dart SDK with auto-download", + "author": { + "name": "PassionFactory" + }, + "repository": "https://github.com/chatbot-pf/code-please" +} diff --git a/plugins/lsp/dart-lsp/.lsp.json b/plugins/lsp/dart-lsp/.lsp.json new file mode 100644 index 0000000..388b0b7 --- /dev/null +++ b/plugins/lsp/dart-lsp/.lsp.json @@ -0,0 +1,9 @@ +{ + "dart": { + "command": "dart", + "args": ["language-server", "--client-id", "claude-code.dart", "--client-version", "1.0"], + "extensionToLanguage": { + ".dart": "dart" + } + } +} diff --git a/plugins/lsp/dart-lsp/README.md b/plugins/lsp/dart-lsp/README.md new file mode 100644 index 0000000..5063d66 --- /dev/null +++ b/plugins/lsp/dart-lsp/README.md @@ -0,0 +1,65 @@ +# Dart LSP Plugin for Claude Code + +This plugin provides real-time diagnostics and language features for Dart using the official [Dart Language Server](https://github.com/dart-lang/sdk/blob/main/pkg/analysis_server/tool/lsp_spec/README.md). + +## Requirements + +- Dart SDK installed and in PATH + +## Installation + +### Via Flutter (Recommended) + +If you use Flutter, Dart is included: + +```bash +# macOS +brew install flutter + +# Or download from https://docs.flutter.dev/get-started/install +``` + +### Dart SDK Only + +```bash +# macOS +brew tap dart-lang/dart +brew install dart + +# Linux (Debian/Ubuntu) +sudo apt-get install dart + +# Windows +choco install dart-sdk + +# Or download from https://dart.dev/get-dart +``` + +## Supported File Types + +- Dart: `.dart` + +## Features + +- Dart analysis and diagnostics +- Autocomplete +- Go to definition +- Find references +- Quick fixes +- Refactoring + +## Configuration + +The Dart language server detects projects with: +- `pubspec.yaml` +- `pubspec.lock` + +## Auto-Download Fallback + +If Dart is not in PATH, you can use `@pleaseai/code-lsp` for auto-download: + +```bash +bunx @pleaseai/code-lsp setup dart +``` + +This downloads Dart SDK 3.7.1 to `~/.cache/dora/dart-lsp/`. diff --git a/plugins/lsp/deno-lsp/.claude-plugin/plugin.json b/plugins/lsp/deno-lsp/.claude-plugin/plugin.json new file mode 100644 index 0000000..35da8a4 --- /dev/null +++ b/plugins/lsp/deno-lsp/.claude-plugin/plugin.json @@ -0,0 +1,9 @@ +{ + "name": "deno-lsp", + "version": "1.0.0", + "description": "Deno language server for Claude Code - Deno runtime support", + "author": { + "name": "PassionFactory" + }, + "repository": "https://github.com/chatbot-pf/code-please" +} diff --git a/plugins/lsp/deno-lsp/.lsp.json b/plugins/lsp/deno-lsp/.lsp.json new file mode 100644 index 0000000..31a9c26 --- /dev/null +++ b/plugins/lsp/deno-lsp/.lsp.json @@ -0,0 +1,13 @@ +{ + "deno": { + "command": "deno", + "args": ["lsp"], + "extensionToLanguage": { + ".ts": "typescript", + ".tsx": "typescriptreact", + ".js": "javascript", + ".jsx": "javascriptreact", + ".mjs": "javascript" + } + } +} diff --git a/plugins/lsp/deno-lsp/README.md b/plugins/lsp/deno-lsp/README.md new file mode 100644 index 0000000..eeee4b6 --- /dev/null +++ b/plugins/lsp/deno-lsp/README.md @@ -0,0 +1,33 @@ +# Deno LSP Plugin for Claude Code + +This plugin provides real-time diagnostics and language features for Deno projects using the built-in [Deno LSP](https://deno.land/manual@v1.40/getting_started/setup_your_environment#using-an-lsp-client). + +## Requirements + +- Deno installed and in PATH + +Install Deno following the [official installation guide](https://deno.land/manual@v1.40/getting_started/installation). + +## Supported File Types + +- TypeScript: `.ts`, `.tsx` +- JavaScript: `.js`, `.jsx`, `.mjs` + +## Features + +- Deno-specific import resolution (URL imports, npm: specifiers) +- TypeScript type checking +- Built-in formatter and linter integration +- Remote module caching + +## Configuration + +The Deno language server looks for `deno.json` or `deno.jsonc` in your project root. This file enables Deno mode for the directory. + +```json +{ + "compilerOptions": { + "lib": ["deno.window"] + } +} +``` diff --git a/plugins/lsp/kotlin-lsp/.claude-plugin/plugin.json b/plugins/lsp/kotlin-lsp/.claude-plugin/plugin.json new file mode 100644 index 0000000..7541c28 --- /dev/null +++ b/plugins/lsp/kotlin-lsp/.claude-plugin/plugin.json @@ -0,0 +1,9 @@ +{ + "name": "kotlin-lsp", + "version": "1.0.0", + "description": "Kotlin language server for Claude Code - JetBrains Kotlin LSP with auto-download", + "author": { + "name": "PassionFactory" + }, + "repository": "https://github.com/chatbot-pf/code-please" +} diff --git a/plugins/lsp/kotlin-lsp/.lsp.json b/plugins/lsp/kotlin-lsp/.lsp.json new file mode 100644 index 0000000..1a937be --- /dev/null +++ b/plugins/lsp/kotlin-lsp/.lsp.json @@ -0,0 +1,9 @@ +{ + "kotlin": { + "command": "${CLAUDE_PLUGIN_ROOT}/bin/kotlin-lsp-launcher", + "extensionToLanguage": { + ".kt": "kotlin", + ".kts": "kotlin" + } + } +} diff --git a/plugins/lsp/kotlin-lsp/README.md b/plugins/lsp/kotlin-lsp/README.md new file mode 100644 index 0000000..46fb6b8 --- /dev/null +++ b/plugins/lsp/kotlin-lsp/README.md @@ -0,0 +1,56 @@ +# Kotlin LSP Plugin for Claude Code + +This plugin provides real-time diagnostics and language features for Kotlin using the official [JetBrains Kotlin Language Server](https://github.com/AjitZK/kotlin-language-server-docker/blob/master/README.md). + +## Requirements + +- Node.js and npm/bun in PATH (for running the setup) +- Internet access (for first-time download) + +## Auto-Download + +This plugin uses `@pleaseai/code-lsp` to automatically download: +- JetBrains Kotlin LSP (v0.253.10629) +- Bundled JRE 21 (platform-specific) + +Files are cached in `~/.cache/dora/kotlin-lsp/`. + +## Supported File Types + +- Kotlin: `.kt`, `.kts` + +## Supported Platforms + +- Windows x64 +- Linux x64 and ARM64 +- macOS x64 and ARM64 (Apple Silicon) + +## Features + +- Full IntelliJ-grade Kotlin analysis +- Type inference and checking +- Smart completions +- Go to definition +- Find references + +## Configuration + +The Kotlin language server detects projects with: +- `build.gradle.kts` or `build.gradle` +- `settings.gradle.kts` or `settings.gradle` +- `pom.xml` + +## Manual Setup + +If auto-download fails, you can manually setup: + +```bash +bunx @pleaseai/code-lsp setup kotlin +``` + +## Troubleshooting + +If you encounter issues: + +1. Clear the cache: `rm -rf ~/.cache/dora/kotlin-lsp` +2. Re-run setup: `bunx @pleaseai/code-lsp setup kotlin` diff --git a/plugins/lsp/kotlin-lsp/bin/kotlin-lsp-launcher b/plugins/lsp/kotlin-lsp/bin/kotlin-lsp-launcher new file mode 100755 index 0000000..025e326 --- /dev/null +++ b/plugins/lsp/kotlin-lsp/bin/kotlin-lsp-launcher @@ -0,0 +1,87 @@ +#!/bin/bash +# Kotlin LSP Launcher for Claude Code Plugin +# Auto-downloads JetBrains Kotlin LSP and bundled JRE if not present + +set -e + +CACHE_DIR="$HOME/.cache/dora/kotlin-lsp" +KOTLIN_LSP_SCRIPT="$CACHE_DIR/kotlin-lsp.sh" +VERSION_FILE="$CACHE_DIR/.version" +EXPECTED_VERSION="0.253.10629" + +# Platform detection +case "$(uname -s)" in + Linux) + case "$(uname -m)" in + x86_64) PLATFORM="linux-x64" ;; + aarch64) PLATFORM="linux-arm64" ;; + *) echo "Unsupported architecture: $(uname -m)" >&2; exit 1 ;; + esac + ;; + Darwin) + case "$(uname -m)" in + x86_64) PLATFORM="osx-x64" ;; + arm64) PLATFORM="osx-arm64" ;; + *) echo "Unsupported architecture: $(uname -m)" >&2; exit 1 ;; + esac + ;; + *) + echo "Unsupported platform: $(uname -s)" >&2 + exit 1 + ;; +esac + +# Check if setup is needed +needs_setup() { + if [ ! -f "$KOTLIN_LSP_SCRIPT" ]; then + return 0 + fi + if [ ! -f "$VERSION_FILE" ]; then + return 0 + fi + if [ "$(cat "$VERSION_FILE")" != "$EXPECTED_VERSION" ]; then + return 0 + fi + return 1 +} + +if needs_setup; then + echo "Kotlin LSP not installed or outdated. Setting up..." >&2 + echo "Running: bunx @pleaseai/code-lsp setup kotlin" >&2 + + # Try bunx first, fall back to npx + if command -v bunx >/dev/null 2>&1; then + bunx @pleaseai/code-lsp setup kotlin + elif command -v npx >/dev/null 2>&1; then + npx @pleaseai/code-lsp setup kotlin + else + echo "Error: Neither bunx nor npx found. Please install bun or npm." >&2 + exit 1 + fi +fi + +# Verify installation +if [ ! -f "$KOTLIN_LSP_SCRIPT" ]; then + echo "Error: Kotlin LSP not found at $KOTLIN_LSP_SCRIPT" >&2 + echo "Please run: bunx @pleaseai/code-lsp setup kotlin" >&2 + exit 1 +fi + +# Set JAVA_HOME based on platform +case "$PLATFORM" in + linux-x64) + export JAVA_HOME="$CACHE_DIR/java/extension/jre/21.0.7-linux-x86_64" + ;; + linux-arm64) + export JAVA_HOME="$CACHE_DIR/java/extension/jre/21.0.7-linux-aarch64" + ;; + osx-x64) + export JAVA_HOME="$CACHE_DIR/java/extension/jre/21.0.7-macosx-x86_64" + ;; + osx-arm64) + export JAVA_HOME="$CACHE_DIR/java/extension/jre/21.0.7-macosx-aarch64" + ;; +esac + +# Run Kotlin LSP +exec "$KOTLIN_LSP_SCRIPT" --stdio diff --git a/plugins/lsp/prisma-lsp/.claude-plugin/plugin.json b/plugins/lsp/prisma-lsp/.claude-plugin/plugin.json new file mode 100644 index 0000000..c5cb63c --- /dev/null +++ b/plugins/lsp/prisma-lsp/.claude-plugin/plugin.json @@ -0,0 +1,9 @@ +{ + "name": "prisma-lsp", + "version": "1.0.0", + "description": "Prisma language server for Claude Code - Prisma schema support", + "author": { + "name": "PassionFactory" + }, + "repository": "https://github.com/chatbot-pf/code-please" +} diff --git a/plugins/lsp/prisma-lsp/.lsp.json b/plugins/lsp/prisma-lsp/.lsp.json new file mode 100644 index 0000000..71701f1 --- /dev/null +++ b/plugins/lsp/prisma-lsp/.lsp.json @@ -0,0 +1,9 @@ +{ + "prisma": { + "command": "npx", + "args": ["@prisma/language-server", "--stdio"], + "extensionToLanguage": { + ".prisma": "prisma" + } + } +} diff --git a/plugins/lsp/prisma-lsp/README.md b/plugins/lsp/prisma-lsp/README.md new file mode 100644 index 0000000..1a9e612 --- /dev/null +++ b/plugins/lsp/prisma-lsp/README.md @@ -0,0 +1,29 @@ +# Prisma LSP Plugin for Claude Code + +This plugin provides real-time diagnostics and language features for Prisma schema files using [@prisma/language-server](https://github.com/prisma/language-tools). + +## Requirements + +- Node.js and npm in PATH + +The plugin uses `npx` to run the Prisma language server on-demand. For better performance, you can install it globally: + +```bash +npm install -g @prisma/language-server +``` + +## Supported File Types + +- Prisma Schema: `.prisma` + +## Features + +- Schema syntax validation +- Model and field autocomplete +- Relation validation +- Database connector validation +- Go to definition for models + +## Configuration + +The Prisma language server looks for `schema.prisma` or `prisma/schema.prisma` in your project root. diff --git a/plugins/lsp/svelte-lsp/.claude-plugin/plugin.json b/plugins/lsp/svelte-lsp/.claude-plugin/plugin.json new file mode 100644 index 0000000..d524cef --- /dev/null +++ b/plugins/lsp/svelte-lsp/.claude-plugin/plugin.json @@ -0,0 +1,9 @@ +{ + "name": "svelte-lsp", + "version": "1.0.0", + "description": "Svelte language server for Claude Code - Svelte component support", + "author": { + "name": "PassionFactory" + }, + "repository": "https://github.com/chatbot-pf/code-please" +} diff --git a/plugins/lsp/svelte-lsp/.lsp.json b/plugins/lsp/svelte-lsp/.lsp.json new file mode 100644 index 0000000..cb1b565 --- /dev/null +++ b/plugins/lsp/svelte-lsp/.lsp.json @@ -0,0 +1,9 @@ +{ + "svelte": { + "command": "npx", + "args": ["svelte-language-server", "--stdio"], + "extensionToLanguage": { + ".svelte": "svelte" + } + } +} diff --git a/plugins/lsp/svelte-lsp/README.md b/plugins/lsp/svelte-lsp/README.md new file mode 100644 index 0000000..fe89a85 --- /dev/null +++ b/plugins/lsp/svelte-lsp/README.md @@ -0,0 +1,28 @@ +# Svelte LSP Plugin for Claude Code + +This plugin provides real-time diagnostics and language features for Svelte components using [svelte-language-server](https://github.com/sveltejs/language-tools). + +## Requirements + +- Node.js and npm in PATH + +The plugin uses `npx` to run the Svelte language server on-demand. For better performance, you can install it globally: + +```bash +npm install -g svelte-language-server +``` + +## Supported File Types + +- Svelte: `.svelte` + +## Features + +- Svelte component diagnostics +- TypeScript support in `