[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7544":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":16,"starSnapshotCount":16,"syncStatus":19,"lastSyncTime":38,"discoverSource":39},7544,"kotlin-language-server","fwcd\u002Fkotlin-language-server","fwcd","Kotlin code completion, diagnostics and more for any editor\u002FIDE using the Language Server Protocol","",null,"Kotlin",2033,250,31,189,0,7,10,2,63.7,"MIT License",false,"main",true,[26,27,28,29,30,31,32,33,34],"atom","autocomplete","code-completion","ide","kotlin","language-server","language-server-protocol","lsp","vscode","2026-06-12 04:00:34","> [!IMPORTANT]\n> There is now an [official language server](https:\u002F\u002Fgithub.com\u002FKotlin\u002Fkotlin-lsp), so this project can be considered deprecated.\n\n# Kotlin Language Server\n\n[![Release](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Frelease\u002Ffwcd\u002Fkotlin-language-server)](https:\u002F\u002Fgithub.com\u002Ffwcd\u002Fkotlin-language-server\u002Freleases)\n[![Build](https:\u002F\u002Fgithub.com\u002Ffwcd\u002Fkotlin-language-server\u002Factions\u002Fworkflows\u002Fbuild.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ffwcd\u002Fkotlin-language-server\u002Factions\u002Fworkflows\u002Fbuild.yml)\n[![Downloads](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fdownloads\u002Ffwcd\u002Fkotlin-language-server\u002Ftotal)](https:\u002F\u002Fgithub.com\u002Ffwcd\u002Fkotlin-language-server\u002Freleases)\n[![Chat](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fchat-on%20discord-7289da)](https:\u002F\u002Fdiscord.gg\u002FcNtppzN)\n\nA [language server](https:\u002F\u002Fmicrosoft.github.io\u002Flanguage-server-protocol\u002F) that provides smart code completion, diagnostics, hover, document symbols, definition lookup, method signature help and more for [Kotlin](https:\u002F\u002Fkotlinlang.org).\n\n![Icon](Icon128.png)\n\nAny editor conforming to LSP is supported, including [VSCode](https:\u002F\u002Fgithub.com\u002Ffwcd\u002Fvscode-kotlin) and [Atom](https:\u002F\u002Fgithub.com\u002Ffwcd\u002Fatom-ide-kotlin).\n\n## Getting Started\n\n* See [BUILDING.md](BUILDING.md) for build instructions\n* See [Editor Integration](EDITORS.md) for editor-specific instructions\n* See [Troubleshooting](TROUBLESHOOTING.md) for tips on troubleshooting errors\n* See [Roadmap](https:\u002F\u002Fgithub.com\u002Ffwcd\u002Fkotlin-language-server\u002Fprojects\u002F1) for features, planned additions, bugfixes and changes\n* See [Kotlin Quick Start](https:\u002F\u002Fgithub.com\u002Ffwcd\u002Fkotlin-quick-start) for a sample project\n* See [Kotlin Debug Adapter](https:\u002F\u002Fgithub.com\u002Ffwcd\u002Fkotlin-debug-adapter) for editor-agnostic launch and debug support of Kotlin\u002FJVM programs\n* See [tree-sitter-kotlin](https:\u002F\u002Fgithub.com\u002Ffwcd\u002Ftree-sitter-kotlin) for an experimental [Tree-Sitter](https:\u002F\u002Ftree-sitter.github.io\u002Ftree-sitter\u002F) grammar\n\n## Packaging\n\n[![Packaging status](https:\u002F\u002Frepology.org\u002Fbadge\u002Fvertical-allrepos\u002Fkotlin-language-server.svg)](https:\u002F\u002Frepology.org\u002Fproject\u002Fkotlin-language-server\u002Fversions)\n\n## This repository needs your help!\n\n[The original author](https:\u002F\u002Fgithub.com\u002Fgeorgewfraser) created this project while he was considering using Kotlin in his work. He ended up deciding not to and is not really using Kotlin these days though this is a pretty fully-functional language server that just needs someone to use it every day for a while and iron out the last few pesky bugs.\n\nThere are two hard parts of implementing a language server:\n- Figuring out the dependencies\n- Incrementally re-compiling as the user types\n\nThe project uses the internal APIs of the [Kotlin compiler](https:\u002F\u002Fgithub.com\u002FJetBrains\u002Fkotlin\u002Ftree\u002Fmaster\u002Fcompiler).\n\n### Figuring out the dependencies\n\nDependencies are determined by the [DefaultClassPathResolver.kt](shared\u002Fsrc\u002Fmain\u002Fkotlin\u002Forg\u002Fjavacs\u002Fkt\u002Fclasspath\u002FDefaultClassPathResolver.kt), which invokes Maven or Gradle to get a list of classpath JARs. Alternatively, projects can also 'manually' provide a list of dependencies through a shell script, located either at `[project root]\u002Fkls-classpath` or `[config root]\u002Fkotlin-language-server\u002Fclasspath`, which outputs a list of JARs. Depending on your platform, the scripts also can be suffixed with `.{sh,bat,cmd}`.\n\n* Example of the `~\u002F.config\u002Fkotlin-language-server\u002Fclasspath` on Linux:\n```bash\n#!\u002Fbin\u002Fbash\necho \u002Fmy\u002Fpath\u002Fkotlin-compiler-1.4.10\u002Flib\u002Fkotlin-stdlib.jar:\u002Fmy\u002Fpath\u002Fmy-lib.jar\n```\n\n* Example of the `%HOMEPATH%\\.config\\kotlin-language-server\\classpath.bat` on Windows:\n```cmd\n@echo off\necho C:\\my\\path\\kotlin-compiler-1.4.10\\lib\\kotlin-stdlib.jar;C:\\my\\path\\my-lib.jar\n```\n\n### Incrementally re-compiling as the user types\n\nI get incremental compilation at the file-level by keeping the same `KotlinCoreEnvironment` alive between compilations in [Compiler.kt](server\u002Fsrc\u002Fmain\u002Fkotlin\u002Forg\u002Fjavacs\u002Fkt\u002Fcompiler\u002FCompiler.kt). There is a performance benchmark in [OneFilePerformance.kt](server\u002Fsrc\u002Ftest\u002Fkotlin\u002Forg\u002Fjavacs\u002Fkt\u002FOneFilePerformance.kt) that verifies this works.\n\nGetting incremental compilation at the expression level is a bit more complicated:\n- Fully compile a file and store in [CompiledFile](server\u002Fsrc\u002Fmain\u002Fkotlin\u002Forg\u002Fjavacs\u002Fkt\u002FCompiledFile.kt):\n    - `val content: String` A snapshot of the source code\n    - `val parse: KtFile` The parsed AST\n    - `val compile: BindingContext` Additional information about the AST from typechecking\n- After the user edits the file:\n    - Find the smallest section the encompasses all the user changes\n    - Get the `LexicalScope` encompassing this region from the `BindingContext` that was generated by the full-compile\n    - Create a fake, in-memory .kt file with just the expression we want to re-compile\n        - [Add space](https:\u002F\u002Fgithub.com\u002Ffwcd\u002Fkotlin-language-server\u002Fblob\u002F427cfa7a688d6d2ff202625ebad1ea605e3b8c37\u002Fserver\u002Fsrc\u002Fmain\u002Fkotlin\u002Forg\u002Fjavacs\u002Fkt\u002FCompiledFile.kt#L125) at the top of the file so the line numbers match up\n    - Re-compile this tiny fake file\n\nThe incremental expression compilation logic is all in [CompiledFile.kt](server\u002Fsrc\u002Fmain\u002Fkotlin\u002Forg\u002Fjavacs\u002Fkt\u002FCompiledFile.kt). The Kotlin AST has a built-in repair API, which seems to be how IntelliJ works, but as far as I can tell this API does not work if the surrounding IntelliJ machinery is not present. Hence I created the \"fake tiny file\" incremental-compilation mechanism, which seems to be quite fast and predictable.\n\nThere is an extensive suite of behavioral [tests](server\u002Fsrc\u002Ftest\u002Fkotlin\u002Forg\u002Fjavacs\u002Fkt), which are all implemented in terms of the language server protocol, so you should be able to refactor the code any way you like and the tests should still work.\n\n## Modules\n\n| Name | Description |\n| ---- | ----------- |\n| server | The language server executable |\n| shared | Classpath resolution and utilities |\n\n## Scripts\n\n| Name | Command | Description |\n| ---- | ------- | ----------- |\n| release_version.py | `python3 scripts\u002Frelease_version.py` | Creates a tag for the current version and bumps the development version |\n\n## Protocol Extensions\n\nThe Kotlin language server supports some non-standard requests through LSP. See [KotlinProtocolExtensions](server\u002Fsrc\u002Fmain\u002Fkotlin\u002Forg\u002Fjavacs\u002Fkt\u002FKotlinProtocolExtensions.kt) for a description of the interface. The general syntax for these methods is `kotlin\u002FsomeCustomMethod`.\n\n## Initialization Options\n\nThe Kotlin language server supports some custom initialization options via the `initializationOptions` property in the `initialize` request parameters. See `InitializationOptions` in [Configuration](server\u002Fsrc\u002Fmain\u002Fkotlin\u002Forg\u002Fjavacs\u002Fkt\u002FConfiguration.kt) for a list of supported properties.\n\n## Features\n\n### Autocomplete\n![Autocomplete](images\u002FAutocomplete.png)\n\n### Signature help\n![Signature Help](images\u002FSignatureHelp.png)\n\n### Hover\n![Hover](images\u002FHover.png)\n\n### Go-to-definition, find all references\n![Find all references](images\u002FFindAllReferences.png)\n\n### Document symbols\n![Document symbols](images\u002FDocumentSymbols.png)\n\n### Global symbols\n![Global symbols](images\u002FGlobalSymbols.png)\n\n\n## Authors\n* [georgewfraser](https:\u002F\u002Fgithub.com\u002Fgeorgewfraser)\n* [fwcd](https:\u002F\u002Fgithub.com\u002Ffwcd)\n","Kotlin Language Server 是一个基于语言服务器协议（LSP）的项目，为任何编辑器或IDE提供Kotlin代码补全、诊断等功能。该项目支持智能代码补全、错误诊断、悬停提示、文档符号、定义查找及方法签名帮助等核心功能，并且利用了Kotlin编译器的内部API来实现这些特性。它适用于需要在非官方IDE环境中使用Kotlin开发工具的场景，如VSCode或Atom等支持LSP的编辑器。尽管现在已有官方版本的语言服务器，使得此项目被认为已过时，但它仍然可以作为一个学习如何实现语言服务器的好例子。","2026-06-11 03:12:58","top_language"]