{"id":13612992,"url":"https://github.com/atom/atom-languageclient","last_synced_at":"2025-04-13T15:32:22.938Z","repository":{"id":45509309,"uuid":"83468354","full_name":"atom/atom-languageclient","owner":"atom","description":"Language Server Protocol support for Atom (the basis of Atom-IDE)","archived":true,"fork":false,"pushed_at":"2022-12-03T00:15:50.000Z","size":1405,"stargazers_count":388,"open_issues_count":33,"forks_count":79,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-03-16T09:44:52.692Z","etag":null,"topics":["atom","ide","json-rpc","language-server-protocol","lsp"],"latest_commit_sha":null,"homepage":"https://ide.atom.io/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-28T18:58:38.000Z","updated_at":"2025-02-23T22:55:23.000Z","dependencies_parsed_at":"2023-01-23T08:46:22.823Z","dependency_job_id":null,"html_url":"https://github.com/atom/atom-languageclient","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom%2Fatom-languageclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom%2Fatom-languageclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom%2Fatom-languageclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom%2Fatom-languageclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atom","download_url":"https://codeload.github.com/atom/atom-languageclient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248735870,"owners_count":21153488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atom","ide","json-rpc","language-server-protocol","lsp"],"created_at":"2024-08-01T20:00:37.706Z","updated_at":"2025-04-13T15:32:22.637Z","avatar_url":"https://github.com/atom.png","language":"TypeScript","readme":"##### Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our [official announcement](https://github.blog/2022-06-08-sunsetting-atom/)\n # Atom Language Server Protocol Client\n\n:warning: Development of atom-languageclient has officially moved to [atom-community/atom-languageclient](https://github.com/atom-community/atom-languageclient) :warning:\n\n:warning: Submit your issues or pull requests in that repository. :warning:\n\n--------------------\n![CI Status](https://github.com/atom/atom-languageclient/actions/workflows/main.yml/badge.svg)\n\nProvide integration support for adding Language Server Protocol servers to Atom.\n\n## Background\n\n[Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) is a JSON-RPC based mechanism whereby a client (IDE) may connect to an out-of-process server that can provide rich analysis, refactoring and interactive features for a given programming language.\n\n## Implementation\n\nThis npm package can be used by Atom package authors wanting to integrate LSP-compatible language servers with Atom. It provides:\n\n* Conversion routines between Atom and LSP types\n* A FlowTyped wrapper around JSON-RPC for **v3** of the LSP protocol\n* All necessary FlowTyped input and return structures for LSP, notifications etc.\n* A number of adapters to translate communication between Atom/Atom-IDE and the LSP's capabilities\n* Automatic wiring up of adapters based on the negotiated capabilities of the language server\n* Helper functions for downloading additional non-npm dependencies\n\n## Capabilities\n\nThe language server protocol consists of a number of capabilities. Some of these already have a counterpoint we can connect up to today while others do not.  The following table shows each capability in v2 and how it is exposed via Atom;\n\n| Capability                      | Atom interface                |\n|---------------------------------|-------------------------------|\n| window/showMessage              | Notifications package         |\n| window/showMessageRequest       | Notifications package         |\n| window/logMessage               | Atom-IDE console              |\n| telemetry/event                 | Ignored                       |\n| workspace/didChangeWatchedFiles | Atom file watch API           |\n| textDocument/publishDiagnostics | Linter v2 push/indie          |\n| textDocument/completion         | AutoComplete+                 |\n| completionItem/resolve          | AutoComplete+ (Atom 1.24+)    |\n| textDocument/hover              | Atom-IDE data tips            |\n| textDocument/signatureHelp      | Atom-IDE signature help       |\n| textDocument/definition         | Atom-IDE definitions          |\n| textDocument/findReferences     | Atom-IDE findReferences       |\n| textDocument/documentHighlight  | Atom-IDE code highlights      |\n| textDocument/documentSymbol     | Atom-IDE outline view         |\n| workspace/symbol                | TBD                           |\n| textDocument/codeAction         | Atom-IDE code actions         |\n| textDocument/codeLens           | TBD                           |\n| textDocument/formatting         | Format File command           |\n| textDocument/rangeFormatting    | Format Selection command      |\n| textDocument/onTypeFormatting   | Atom-IDE on type formatting   |\n| textDocument/onSaveFormatting   | Atom-IDE on save formatting   |\n| textDocument/rename             | TBD                           |\n| textDocument/didChange          | Send on save                  |\n| textDocument/didOpen            | Send on open                  |\n| textDocument/didSave            | Send after save               |\n| textDocument/willSave           | Send before save              |\n| textDocument/didClose           | Send on close                 |\n\n## Developing packages\n\nThe underlying JSON-RPC communication is handled by the [vscode-jsonrpc npm module](https://www.npmjs.com/package/vscode-jsonrpc).\n\n### Minimal example\n\nA minimal implementation can be illustrated by the Omnisharp package here which has only npm-managed dependencies.  You simply provide the scope name, language name and server name as well as start your process and AutoLanguageClient takes care of interrogating your language server capabilities and wiring up the appropriate services within Atom to expose them.\n\n```javascript\nconst {AutoLanguageClient} = require('atom-languageclient')\n\nclass CSharpLanguageClient extends AutoLanguageClient {\n  getGrammarScopes () { return [ 'source.cs' ] }\n  getLanguageName () { return 'C#' }\n  getServerName () { return 'OmniSharp' }\n\n  startServerProcess () {\n    return super.spawnChildNode([ require.resolve('omnisharp-client/languageserver/server') ])\n  }\n}\n\nmodule.exports = new CSharpLanguageClient()\n```\n\nYou can get this code packaged up with the necessary package.json etc. from the [ide-csharp](https://github.com/atom/ide-csharp) provides C# support via [Omnisharp (node-omnisharp)](https://github.com/OmniSharp/omnisharp-node-client) repo.\n\nNote that you will also need to add various entries to the `providedServices` and `consumedServices` section of your package.json (for now).  You can [obtain these entries here](https://github.com/atom/ide-csharp/tree/master/package.json).\n\n### Using other connection types\n\nThe default connection type is *stdio* however both *ipc* and *sockets* are also available.\n\n#### IPC\n\nTo use ipc simply return *ipc* from getConnectionType(), e.g.\n\n```javascript\nclass ExampleLanguageClient extends AutoLanguageClient {\n  getGrammarScopes () { return [ 'source.js', 'javascript' ] }\n  getLanguageName () { return 'JavaScript' }\n  getServerName () { return 'JavaScript Language Server' }\n\n  getConnectionType() { return 'ipc' }\n\n  startServerProcess () {\n    const startServer = require.resolve('@example/js-language-server')\n    return super.spawnChildNode([startServer, '--node-ipc'], {\n      stdio: [null, null, null, 'ipc']\n    })\n  }\n}\n```\n\n#### Sockets\n\nSockets are a little more complex because you need to allocate a free socket. The [ide-php package](https://github.com/atom/ide-php/blob/master/lib/main.js) contains an example of this.\n\n### Debugging\n\nAtom-LanguageClient can log all sent and received messages nicely formatted to the Developer Tools Console within Atom. To do so simply enable it with `atom.config.set('core.debugLSP', true)`, e.g.\n\n### Tips\n\nSome more elaborate scenarios can be found in the [ide-java](https://github.com/atom/ide-java) package which includes:\n\n* Downloading and unpacking non-npm dependencies (in this case a .tar.gz containing JAR files)\n* Platform-specific start-up configuration\n* Wiring up custom extensions to the protocol (language/status to Atom Status-Bar, language/actionableNotification to Atom Notifications)\n\n### Available packages\n\nRight now we have the following experimental Atom LSP packages in development. They are mostly usable but are missing some features that either the LSP server doesn't support or expose functionality that is as yet unmapped to Atom (TODO and TBD in the capabilities table above).\n\n### Official packages\n\n* [ide-csharp](https://github.com/atom/ide-csharp) provides C# support via [Omnisharp (node-omnisharp)](https://github.com/OmniSharp/omnisharp-node-client)\n* [ide-flowtype](https://github.com/flowtype/ide-flowtype) provides Flow support via [Flow Language Server](https://github.com/flowtype/flow-language-server)\n* [ide-java](https://github.com/atom/ide-java) provides Java support via [Java Eclipse JDT](https://github.com/eclipse/eclipse.jdt.ls)\n* [ide-typescript](https://github.com/atom/ide-typescript) provides TypeScript and Javascript support via [SourceGraph Typescript Language Server](https://github.com/sourcegraph/javascript-typescript-langserver)\n\n### Community packages\n\nOur [full list of Atom IDE packages](https://github.com/atom/atom-languageclient/wiki/List-of-Atom-packages-using-Atom-LanguageClient) includes the community packages.\n\n### Other language servers\n\nAdditional LSP servers that might be of interest to be packaged with this for Atom can be found at [LangServer.org](http://langserver.org)\n\n## Contributing\n\n### Running from source\n\nIf you want to run from source you will need to perform the following steps (you will need node and npm intalled):\n\n1. Check out the source\n2. From the source folder type `npm link` to build and link\n3. From the folder where your package lives type `npm link atom-languageclient`\n\nIf you want to switch back to the production version of atom-languageclient type `npm unlink atom-languageclient` from the folder where your package lives.\n\n### Before sending a PR\n\nWe have various unit tests and some linter rules - you can run both of these locally using `npm test` to ensure your CI will get a clean build.\n\n### Guidance\n\nAlways feel free to help out!  Whether it's [filing bugs and feature requests](https://github.com/atom/atom-languageclient/issues/new) or working on some of the [open issues](https://github.com/atom/atom-languageclient/issues), Atom's [contributing guide](https://github.com/atom/atom/blob/master/CONTRIBUTING.md) will help get you started while the [guide for contributing to packages](https://github.com/atom/atom/blob/master/docs/contributing-to-packages.md) has some extra information.\n\n## License\n\nMIT License.  See [the license](LICENSE.md) for more details.\n","funding_links":[],"categories":["HarmonyOS","TypeScript"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatom%2Fatom-languageclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatom%2Fatom-languageclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatom%2Fatom-languageclient/lists"}