Dropstone Docs

LSP 서버

Dropstone은 LSP 서버와 통합됩니다.

Dropstone은 Language Server Protocol (LSP)과 통합되어 LLM이 코드베이스와 상호작용하도록 도울 수 있습니다. 진단 정보를 사용하여 LLM에 피드백을 제공합니다.


내장

Dropstone은 인기 있는 언어를 위한 여러 내장 LSP 서버와 함께 제공됩니다:

LSP ServerExtensionsRequirements
astro.astroAstro 프로젝트에 자동 설치
bash.sh, .bash, .zsh, .kshbash-language-server 자동 설치
clangd.c, .cpp, .cc, .cxx, .c++, .h, .hpp, .hh, .hxx, .h++C/C++ 프로젝트에 자동 설치
csharp.cs, .csx.NET SDK 설치됨
clojure-lsp.clj, .cljs, .cljc, .ednclojure-lsp 명령 사용 가능
dart.dartdart 명령 사용 가능
deno.ts, .tsx, .js, .jsx, .mjsdeno 명령 사용 가능 (deno.json/deno.jsonc 자동 감지)
elixir-ls.ex, .exselixir 명령 사용 가능
eslint.ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue프로젝트의 eslint 의존성
fsharp.fs, .fsi, .fsx, .fsscript.NET SDK 설치됨
gleam.gleamgleam 명령 사용 가능
gopls.gogo 명령 사용 가능
hls.hs, .lhshaskell-language-server-wrapper 명령 사용 가능
jdtls.javaJava SDK (version 21+) 설치됨
julials.jljuliaLanguageServer.jl 설치됨
kotlin-ls.kt, .ktsKotlin 프로젝트에 자동 설치
lua-ls.luaLua 프로젝트에 자동 설치
nixd.nixnixd 명령 사용 가능
ocaml-lsp.ml, .mliocamllsp 명령 사용 가능
oxlint.ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue, .astro, .svelte프로젝트의 oxlint 의존성
php intelephense.phpPHP 프로젝트에 자동 설치
prisma.prismaprisma 명령 사용 가능
pyright.py, .pyipyright 의존성 설치됨
razor.razor, .cshtml.NET SDK 및 VS Code C# 확장 설치됨
ruby-lsp (rubocop).rb, .rake, .gemspec, .rurubygem 명령 사용 가능
rust.rsrust-analyzer 명령 사용 가능
sourcekit-lsp.swift, .objc, .objcppswift 설치됨 (macOS의 xcode)
svelte.svelteSvelte 프로젝트에 자동 설치
terraform.tf, .tfvarsGitHub 릴리스에서 자동 설치
tinymist.typ, .typcGitHub 릴리스에서 자동 설치
typescript.ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts프로젝트의 typescript 의존성
vue.vueVue 프로젝트에 자동 설치
yaml-ls.yaml, .ymlRed Hat yaml-language-server 자동 설치
zls.zig, .zonzig 명령 사용 가능

LSP가 활성화되면 위의 파일 확장자 중 하나가 감지되고 요구사항이 충족될 때 서버가 시작됩니다.


작동 방식

LSP가 활성화되고 dropstone이 파일을 열 때:

  1. 파일 확장자를 모든 활성화된 LSP 서버와 비교합니다.
  2. 아직 실행 중이 아니면 적절한 LSP 서버를 시작합니다.

구성

dropstone 구성의 lsp 섹션을 통해 LSP 서버를 활성화하고 사용자 정의할 수 있습니다.

모든 내장 LSP 서버를 활성화하려면 lsptrue로 설정합니다.

{
  "$schema": "https://dropstone.io/schema/config.json",
  "lsp": true
}

내장 서버를 활성화된 상태로 유지하면서 재정의 또는 사용자 정의 서버를 구성하려면 객체를 사용합니다.

{
  "$schema": "https://dropstone.io/schema/config.json",
  "lsp": {}
}

각 구성된 LSP 서버 항목은 다음을 지원합니다:

서버 항목은 서버를 비활성화하는 경우를 제외하고 command가 필요합니다.

PropertyTypeDescription
disabledbooleanLSP 서버를 비활성화하려면 true로 설정합니다
commandstring[]LSP 서버를 시작하는 명령
extensionsstring[]이 LSP 서버가 처리해야 할 파일 확장자
envobject서버 시작 시 설정할 환경 변수
initializationobjectLSP 서버로 전송할 초기화 옵션

몇 가지 예를 살펴보겠습니다.


환경 변수

env 속성을 사용하여 LSP 서버를 시작할 때 환경 변수를 설정합니다:

{
  "$schema": "https://dropstone.io/schema/config.json",
  "lsp": {
    "rust": {
      "command": ["rust-analyzer"],
      "env": {
        "RUST_LOG": "debug"
      }
    }
  }
}

초기화 옵션

initialization 속성을 사용하여 LSP 서버에 초기화 옵션을 전달합니다. 이는 LSP initialize 요청 중에 전송되는 서버별 설정입니다:

{
  "$schema": "https://dropstone.io/schema/config.json",
  "lsp": {
    "custom-lsp": {
      "command": ["custom-lsp-server", "--stdio"],
      "extensions": [".custom"],
      "initialization": {
        "preferences": {
          "importModuleSpecifierPreference": "relative"
        }
      }
    }
  }
}

Note:

초기화 옵션은 LSP 서버마다 다릅니다. 사용 가능한 옵션은 LSP 서버의 설명서를 확인하세요.


LSP 서버 비활성화

lsp를 생략하면 모든 LSP 서버가 비활성화됩니다. 다른 구성이 활성화한 후 모든 LSP 서버를 비활성화하려면 lspfalse로 설정합니다:

{
  "$schema": "https://dropstone.io/schema/config.json",
  "lsp": false
}

특정 LSP 서버를 비활성화하려면 disabledtrue로 설정합니다:

{
  "$schema": "https://dropstone.io/schema/config.json",
  "lsp": {
    "typescript": {
      "disabled": true
    }
  }
}

사용자 정의 LSP 서버

명령과 파일 확장자를 지정하여 사용자 정의 LSP 서버를 추가할 수 있습니다:

{
  "$schema": "https://dropstone.io/schema/config.json",
  "lsp": {
    "custom-lsp": {
      "command": ["custom-lsp-server", "--stdio"],
      "extensions": [".custom"]
    }
  }
}

추가 정보

PHP Intelephense

PHP Intelephense는 라이선스 키를 통해 프리미엄 기능을 제공합니다. 다음 위치의 텍스트 파일에 라이선스 키를 배치하여 라이선스 키를 제공할 수 있습니다:

  • macOS/Linux: $HOME/intelephense/license.txt
  • Windows: %USERPROFILE%/intelephense/license.txt

파일에는 추가 내용 없이 라이선스 키만 포함되어야 합니다.

Ctrl+I