{"id":13895988,"url":"https://github.com/orbitalquark/textadept-lsp","last_synced_at":"2025-08-11T13:21:24.842Z","repository":{"id":40513896,"uuid":"301854600","full_name":"orbitalquark/textadept-lsp","owner":"orbitalquark","description":"Language server protocol client module for Textadept.","archived":false,"fork":false,"pushed_at":"2025-04-28T23:26:05.000Z","size":258,"stargazers_count":32,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"default","last_synced_at":"2025-04-29T00:35:07.856Z","etag":null,"topics":["language-server-protocol","lsp","lsp-client","textadept","textadept-module"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/orbitalquark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-10-06T21:05:58.000Z","updated_at":"2025-04-28T23:25:58.000Z","dependencies_parsed_at":"2023-12-31T18:23:57.495Z","dependency_job_id":"c82b553f-31ab-417b-b869-555391e5f4c8","html_url":"https://github.com/orbitalquark/textadept-lsp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitalquark%2Ftextadept-lsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitalquark%2Ftextadept-lsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitalquark%2Ftextadept-lsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitalquark%2Ftextadept-lsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orbitalquark","download_url":"https://codeload.github.com/orbitalquark/textadept-lsp/tar.gz/refs/heads/default","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251924562,"owners_count":21665991,"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":["language-server-protocol","lsp","lsp-client","textadept","textadept-module"],"created_at":"2024-08-06T18:02:36.014Z","updated_at":"2025-08-11T13:21:24.829Z","avatar_url":"https://github.com/orbitalquark.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# Language Server Protocol\n\nA client for Textadept that communicates over the [Language Server Protocol][] (LSP) with\nlanguage servers in order to provide autocompletion, calltips, go to definition, and more.\n\nIt implements version 3.17.0 of the protocol, but does not support all protocol features. The\n`Server.new()` function contains the client's current set of capabilities.\n\nInstall this module by copying it into your *~/.textadept/modules/* directory or Textadept's\n*modules/* directory, and then putting the following in your *~/.textadept/init.lua*:\n\n```lua\nlocal lsp = require('lsp')\n```\n\nYou can then set up some language server commands. For example:\n\n```lua\nlsp.server_commands.cpp = 'clangd'\nlsp.server_commands.go = 'gopls'\n```\n\n(For more example configurations, see the [wiki][].)\n\nWhen either C++ or Go files are opened, their associated language servers are automatically\nstarted (one per project). Note that language servers typically require a root URI, so this\nmodule uses `io.get_project_root()` for this. If the file being opened is not part of a\nproject recognized by Textadept, the language server will not be started.\n\nLanguage Server features are available from the Tools \u003e Language Server menu. Note that not\nall language servers may support the menu options.\n\n**Note:** if you want to inspect the LSP messages sent back and forth, you can use the Lua\ncommand entry to set `require('lsp').log_rpc = true`. It doesn't matter if any LSPs are\nalready active -- from this point forward all messages will be logged. View the log via the\n\"Tools \u003e Language Server \u003e View Log\" menu item.\n\n**Warning:** buggy language servers that do not respect the protocol may cause this module\nand Textadept to hang, waiting for a response. There is no recourse other than to force-quit\nTextadept and restart.\n\n[Language Server Protocol]: https://microsoft.github.io/language-server-protocol/specification\n[wiki]: https://github.com/orbitalquark/textadept/wiki/LSP-Configurations\n\n## Lua Language Server\n\nThis module comes with a simple Lua language server that starts up when Textadept opens a\nLua file, or whenever you request documentation for a symbol in the Lua command entry. The\nserver looks in the project root for a *.lua-lsp* configuration file. That file can have\nthe following fields:\n\n- `ignore`: List of globs that match directories and files to ignore. Globs are relative to\n\tthe project root. The default directories ignored are .bzr, .git, .hg, .svn, _FOSSIL_,\n\tand node_modules. Setting this field overrides the default.\n- `max_scan`: Maximum number of files to scan before giving up. This is not the number of\n\tLua files scanned, but the number of files encountered in non-ignored directories.\n\tThe primary purpose of this field is to avoid hammering the disk when accidentally\n\topening a large project or root. The default value is 10,000.\n\nFor example:\n\n```lua\nignore = {'.git', 'build', 'test'}\nmax_scan = 20000\n```\n\n## Key Bindings\n\nWindows and Linux | macOS | Terminal | Command\n-|-|-|-\n**Tools**| | |\nCtrl+Space | ⌘Space\u003cbr/\u003e ^Space | ^Space | Complete symbol\nCtrl+? | ⌘?\u003cbr/\u003e^? | M-?\u003cbr/\u003eCtrl+?\u003csup\u003e‡\u003c/sup\u003e | Show documentation\nF12 | F12 | F12 | Go To Definition\nShift+F12 | ⇧F12 | Shift+F12 | Go to Symbol...\n\n‡: Windows terminal version only.\n\n## Icon Reference\n\nIcon | Terminal Symbol | Meaning\n-|-|-\n![method](icons/method.svg) | `*` | Method, Function\n![constructor](icons/constructor.svg) | `+` | Constructor\n![field](icons/field.svg) | `-` | Field\n![variable](icons/variable.svg) | | Variable\n![class](icons/class.svg) | `#` | Class\n![interface](icons/interface.svg) | `:` | Interface\n![module](icons/module.svg) | `@` | Module\n![property](icons/property.svg) | | Property\n![unit](icons/unit.svg) | | Unit\n![value](icons/value.svg) | | Value\n![struct](icons/struct.svg) | `#` | Struct, Enum\n![keyword](icons/keyword.svg) | | Keyword\n![snippet](icons/snippet.svg) | | Snippet\n![color](icons/color.svg) | | Color\n![file](icons/file.svg) | | File\n![reference](icons/reference.svg) | | Reference\n![folder](icons/folder.svg) | `/` | Folder\n![constant](icons/constant.svg) | `\u0026` | Constant, Enum member\n![event](icons/event.svg) | `!` | Event\n![operator](icons/operator.svg) | | Operator\n![param](icons/type_parameter.svg) | | Type parameter\n\n\n\u003ca id=\"lsp.CODE_ACTION_ID\"\u003e\u003c/a\u003e\n## `lsp.CODE_ACTION_ID`\n\nThe code action user list number.\n\n\u003ca id=\"events.LSP_INITIALIZED\"\u003e\u003c/a\u003e\n## `events.LSP_INITIALIZED`\n\nEmitted when an LSP connection has been initialized.\n\nThis is useful for sending server-specific notifications to the server upon init via\n`Server:notify()`.\n\nArguments:\n- *lang*: The lexer name of the LSP language.\n- *server*: The LSP server.\n\nSee also: [`lsp.start`](#lsp.start)\n\n\u003ca id=\"events.LSP_NOTIFICATION\"\u003e\u003c/a\u003e\n## `events.LSP_NOTIFICATION`\n\nEmitted when an LSP server emits an unhandled notification.\n\nThis is useful for handling server-specific notifications.\n\nAn event handler should return `true`.\n\nArguments:\n- *lang*: The lexer name of the LSP language.\n- *server*: The LSP server.\n- *method*: The string LSP notification method name.\n- *params*: The table of LSP notification params. Contents may be server-specific.\n\n\u003ca id=\"events.LSP_REQUEST\"\u003e\u003c/a\u003e\n## `events.LSP_REQUEST`\n\nEmitted when an LSP server emits an unhandled request.\n\nThis is useful for handling server-specific requests. Responses are sent using\n`Server:respond()`.\n\nAn event handler should return `true`.\n\nArguments:\n- *lang*: The lexer name of the LSP language.\n- *server*: The LSP server.\n- *id*: The integer LSP request ID.\n- *method*: The string LSP request method name.\n- *params*: The table of LSP request params.\n\n\u003ca id=\"_G.textadept.editing.autocompleters.lsp\"\u003e\u003c/a\u003e\n## `_G.textadept.editing.autocompleters.lsp`()\n\nAutocompleter function for a language server.\n\n\u003ca id=\"lsp.autocomplete\"\u003e\u003c/a\u003e\n## `lsp.autocomplete`()\n\nRequests autocompletion at the current position.\n\nReturns: `true` if autocompletions were shown; `nil` otherwise\n\n\u003ca id=\"lsp.autocomplete_num_chars\"\u003e\u003c/a\u003e\n## `lsp.autocomplete_num_chars`\n\nThe number of characters typed after which autocomplete is automatically triggered.\n\nThe default value is `nil`, which disables this feature. A value greater than or equal to\n3 is recommended to enable this feature.\n\n\u003ca id=\"lsp.code_action\"\u003e\u003c/a\u003e\n## `lsp.code_action`([*s*[, *e*]])\n\nRequests a list of code actions for the a range and prompts the user with a user list to\nselect from.\n\nParameters:\n- *s*:  Start position of the code action range. If omitted, the start of the current\n\tselection is used, or the start of the line if no text is selected.\n- *e*:  End position of the code action range. If omitted, the end of the current\n\tselection is used, or the end of the line if no text is selected.\n\n\u003ca id=\"lsp.find_references\"\u003e\u003c/a\u003e\n## `lsp.find_references`()\n\nSearches for project references to the current symbol and prints them like \"Find in Files\" does.\n\n\u003ca id=\"lsp.goto_declaration\"\u003e\u003c/a\u003e\n## `lsp.goto_declaration`()\n\nJumps to the declaration of the current symbol.\n\nReturns: whether or not a declaration was found\n\n\u003ca id=\"lsp.goto_definition\"\u003e\u003c/a\u003e\n## `lsp.goto_definition`()\n\nJumps to the definition of the current symbol.\n\nReturns: whether or not a definition was found\n\n\u003ca id=\"lsp.goto_implementation\"\u003e\u003c/a\u003e\n## `lsp.goto_implementation`()\n\nJumps to the implementation of the current symbol.\n\nReturns: whether or not an implementation was found\n\n\u003ca id=\"lsp.goto_symbol\"\u003e\u003c/a\u003e\n## `lsp.goto_symbol`([*symbol*])\n\nJumps to a symbol selected from a list based on project symbols that match a symbol.\n\nParameters:\n- *symbol*:  String symbol to query for in the current project. If `nil`, symbols are\n\tpresented from the current buffer.\n\n\u003ca id=\"lsp.goto_type_definition\"\u003e\u003c/a\u003e\n## `lsp.goto_type_definition`()\n\nJumps to the definition of the current type.\n\nReturns: whether or not a definition was found\n\n\u003ca id=\"lsp.hover\"\u003e\u003c/a\u003e\n## `lsp.hover`([*position*=buffer.current_pos])\n\nShows a calltip with information about the identifier at a buffer position.\n\nParameters:\n- *position*:  Position of the identifier to show information for.\n\n\u003ca id=\"lsp.log_rpc\"\u003e\u003c/a\u003e\n## `lsp.log_rpc`\n\nLog RPC correspondence to the LSP message buffer.\n\nThe default value is `false`.\n\n\u003ca id=\"lsp.select\"\u003e\u003c/a\u003e\n## `lsp.select`()\n\nSelects or expands the selection around the current position.\n\n\u003ca id=\"lsp.select_all_symbol\"\u003e\u003c/a\u003e\n## `lsp.select_all_symbol`()\n\nSelects all instances of the symbol at the current position as multiple selections.\n\n\u003ca id=\"lsp.server_commands\"\u003e\u003c/a\u003e\n## `lsp.server_commands`\n\nMap of lexer names to LSP language server commands or configurations, or functions that\nreturn either a server command or a configuration.\n\nCommands are simple string shell commands. Configurations are tables with the following keys:\n- *command*: String shell command used to run the LSP language server.\n- *init_options*: Table of initialization options to pass to the language server in the\n\t\"initialize\" request.\n\n\u003ca id=\"lsp.show_all_diagnostics\"\u003e\u003c/a\u003e\n## `lsp.show_all_diagnostics`\n\nShow all diagnostics if `show_diagnostics` is `true`.\n\nThe default value is `false`, and assumes any diagnostics on the current line or next line\nare due to an incomplete statement during something like an autocompletion, signature help,\netc. request.\n\n\u003ca id=\"lsp.show_completions\"\u003e\u003c/a\u003e\n## `lsp.show_completions`\n\nAutomatically show completions when a trigger character is typed (e.g.\n'.').\nThe default value is `true`.\n\n\u003ca id=\"lsp.show_diagnostics\"\u003e\u003c/a\u003e\n## `lsp.show_diagnostics`\n\nShow diagnostics.\n\nThe default value is `true`, and shows them as annotations.\n\n\u003ca id=\"lsp.show_hover\"\u003e\u003c/a\u003e\n## `lsp.show_hover`\n\nAutomatically show symbol information via mouse hovering.\n\nThe default value is `true`.\n\n\u003ca id=\"lsp.show_signature_help\"\u003e\u003c/a\u003e\n## `lsp.show_signature_help`\n\nAutomatically show signature help when a trigger character is typed (e.g.\n'(').\nThe default value is `true`.\n\n\u003ca id=\"lsp.signature_help\"\u003e\u003c/a\u003e\n## `lsp.signature_help`([*no_cycle*=false])\n\nShows a calltip for the current function.\n\nIf a call tip is already shown, this will cycle to the next one if it exists.\n\nParameters:\n- *no_cycle*:  Do not cycle to the next call tip. Setting this to `true` is\n\tuseful when updating the current highlighted parameter.\n\n\u003ca id=\"lsp.snippet_completions\"\u003e\u003c/a\u003e\n## `lsp.snippet_completions`\n\nAllow completions to insert snippets instead of plain text, for language servers that\nsupport it.\n\nThe default value is `true`.\n\n\u003ca id=\"lsp.start\"\u003e\u003c/a\u003e\n## `lsp.start`([*cmd*])\n\nStarts a language server based on the current language and project.\n\nParameters:\n- *cmd*:  String language server command to run. The default value is read from\n\t`server_commands`.\n\n\u003ca id=\"lsp.stop\"\u003e\u003c/a\u003e\n## `lsp.stop`()\n\nStops a running language server based on the current language.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitalquark%2Ftextadept-lsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forbitalquark%2Ftextadept-lsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitalquark%2Ftextadept-lsp/lists"}