wip(docs): i18n (#12681)

This commit is contained in:
Adam
2026-02-09 11:34:35 -06:00
committed by GitHub
parent f74c0339cc
commit dc53086c1e
642 changed files with 192745 additions and 509 deletions

View File

@@ -0,0 +1,188 @@
---
title: LSP Sunucular
description: OpenCode, LSP sunucularınızla bütünleşir.
---
OpenCode, LLM'nin kod tabanınızla etkileşime girmesine yardımcı olmak için Dil Sunucusu Protokolünüzle (LSP) bütünleşir. LLM'ye geri bildirim sağlamak için tanılamayı kullanır.
---
## Built-in
OpenCode, popüler diller için çeşitli yerleşik LSP sunucularıyla birlikte gelir:
| LSP Sunucu | Uzantılar | Gereksinimler |
| ------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------- |
| astro | .astro | Astro projeleri için otomatik kurulumlar |
| bash | .sh, .bash, .zsh, .ksh | Bash-dil-sunucusunu otomatik olarak yükler |
| çıngırak | .c, .cpp, .cc, .cxx, .c++, .h, .hpp, .hh, .hxx, .h++ | C/C++ projeleri için otomatik kurulumlar |
| csharp | .cs | `.NET SDK` installed |
| clojure-lsp | .clj, .cljs, .cljc, .edn | `clojure-lsp` komutu mevcut |
| dart | .dart | `dart` komutu mevcut |
| den | .ts, .tsx, .js, .jsx, .mjs | `deno` komutu mevcut (deno.json/deno.jsonc otomatik olarak algılanır) |
| iksir-ls | .ex, .exs | `elixir` komutu mevcut |
| eslint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue | `eslint` dependency in project |
| fsharp | .fs, .fsi, .fsx, .fsscript | `.NET SDK` installed |
| parıltı | .gliam | `gleam` komutu mevcut |
| lütfen | .go | `go` komutu mevcut |
| hls | .hs, .lhs | `haskell-language-server-wrapper` komutu mevcut |
| jdtls | .java | `Java SDK (version 21+)` installed |
| kotlin-ls | .kt, .kts | Kotlin projeleri için otomatik kurulumlar |
| lua-ls | .lua | Lua projeleri için otomatik kurulumlar |
| hayır | .nix | `nixd` komutu mevcut |
| ocaml-lsp | .ml, .mli | `ocamllsp` komutu mevcut |
| oxlint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue, .astro, .svelte | `oxlint` dependency in project |
| php internet | .php | PHP projeleri için otomatik yüklemeler |
| prizma | .prizma | `prisma` komutu mevcut |
| pyright | .py, .pyi | `pyright` dependency installed |
| yakut-lsp (rubocop) | .rb, .rake, .gemspec, .ru | `ruby` ve `gem` komutları mevcut |
| pas | .rs | `rust-analyzer` komutu mevcut |
| sourcekit-lsp | .swift, .objc, .objcpp | `swift` installed (`xcode` on macOS) |
| ince | .svelte | Svelte projeleri için otomatik kurulumlar |
| yeryüzü | .tf, .tfvars | GitHub sürümlerinden otomatik yüklemeler |
| minik sis | .typ, .typc | GitHub sürümlerinden otomatik yüklemeler |
| typescript | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts | `typescript` dependency in project |
| vue | .vue | Vue projeleri için otomatik yüklemeler |
| yaml-ls | .yaml, .yml | Red Hat yaml-dil-sunucusunu otomatik olarak yükler |
| zl'ler | .zig, .zon | `zig` komutu mevcut |
Yukarıdaki dosya uzantılarından biri tespit edildiğinde ve gereksinimler karşılandığında LSP sunucuları otomatik olarak etkinleştirilir.
:::note
`OPENCODE_DISABLE_LSP_DOWNLOAD` ortam değişkenini `true` olarak ayarlayarak otomatik LSP sunucu indirmelerini devre dışı bırakabilirsiniz.
:::
---
## Nasıl Çalışır?
Opencode bir dosyayı açtığında:
1. Dosya uzantısını tüm etkin LSP sunucularına göre kontrol eder.
2. Henüz çalışmıyorsa uygun LSP sunucusunu başlatır.
---
## Yapılandır
LSP sunucularını, açık kod yapılandırmanızdaki `lsp` bölümü aracılığıyla özelleştirebilirsiniz.
```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"lsp": {}
}
```
Her LSP sunucusu aşağıdakileri destekler:
| Emlak | Tür | Açıklama |
| ---------------- | ------ | -------------------------------------------------------------------- |
| `disabled` | boole | LSP sunucusunu devre dışı bırakmak için bunu `true` olarak ayarlayın |
| `command` | dize[] | LSP sunucusunu başlatma komutu |
| `extensions` | dize[] | Bu LSP sunucusunun işlemesi gereken dosya uzantıları |
| `env` | nesne | Sunucuyu başlatırken ayarlanacak ortam değişkenleri |
| `initialization` | nesne | LSP sunucusuna gönderilecek başlatma seçenekleri |
Let's look at some examples.
---
### Ortam değişkenleri
LSP sunucusunu başlatırken ortam değişkenlerini ayarlamak için `env` özelliğini kullanın:
```json title="opencode.json" {5-7}
{
"$schema": "https://opencode.ai/config.json",
"lsp": {
"rust": {
"env": {
"RUST_LOG": "debug"
}
}
}
}
```
---
### Initialization options
Başlatma seçeneklerini LSP sunucusuna iletmek için `initialization` özelliğini kullanın. Bunlar LSP `initialize` isteği sırasında gönderilen sunucuya özel ayarlardır:
```json title="opencode.json" {5-9}
{
"$schema": "https://opencode.ai/config.json",
"lsp": {
"typescript": {
"initialization": {
"preferences": {
"importModuleSpecifierPreference": "relative"
}
}
}
}
}
```
:::note
Başlatma seçenekleri LSP sunucusuna göre değişir. Mevcut seçenekler için LSP sunucunuzun belgelerine bakın.
:::
---
### LSP sunucularını devre dışı bırakma
**tüm** LSP sunucularını genel olarak devre dışı bırakmak için `lsp`'yi `false` olarak ayarlayın:
```json title="opencode.json" {3}
{
"$schema": "https://opencode.ai/config.json",
"lsp": false
}
```
**Belirli** bir LSP sunucusunu devre dışı bırakmak için `disabled`'yi `true` olarak ayarlayın:
```json title="opencode.json" {5}
{
"$schema": "https://opencode.ai/config.json",
"lsp": {
"typescript": {
"disabled": true
}
}
}
```
---
### Custom LSP servers
Komutu ve dosya uzantılarını belirterek özel LSP sunucuları ekleyebilirsiniz:
```json title="opencode.json" {4-7}
{
"$schema": "https://opencode.ai/config.json",
"lsp": {
"custom-lsp": {
"command": ["custom-lsp-server", "--stdio"],
"extensions": [".custom"]
}
}
}
```
---
## Ek Bilgiler
### PHP Intelephense
PHP Intelephense, bir lisans anahtarı aracılığıyla premium özellikler sunar. Anahtarı (yalnızca) şu adresteki bir metin dosyasına yerleştirerek bir lisans anahtarı sağlayabilirsiniz:
- MacOS/Linux'ta: `$HOME/intelephense/licence.txt`
- Windows'ta: `%USERPROFILE%/intelephense/licence.txt`
Dosya, ek içerik olmadan yalnızca lisans anahtarını içermelidir.