{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Language Servers\n", "\n", "`jupyter-lsp` does not come with any Language Servers! However, we will try to\n", "use them if they _are_ installed and we know about them. For the language\n", "servers in the tables below, use one of the suggested package managers to\n", "install them: these implementations are tested to work with `jupyter-lsp`.\n", "\n", "- _You can disable this feature by configuring_\n", " [autodetect](./Configuring.ipynb#autodetect)\n", "\n", "If you do not see a language you would like, but can find it one of these lists:\n", "\n", "- the [official list][lsp-implementations] of language servers\n", "- a [community-curated list][langserver] of language servers\n", "\n", "...you might be able to add it\n", "[via configuration](./Configuring.ipynb#language_servers) or\n", "[build your own spec](./Contributing.ipynb#Specs) for the server in question.\n", "\n", "[language-server]:\n", " https://microsoft.github.io/language-server-protocol/specification\n", "[langserver]: https://langserver.org\n", "[lsp-implementations]:\n", " https://microsoft.github.io/language-server-protocol/implementors/servers" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": true }, "outputs": [], "source": [ "import pathlib\n", "\n", "import IPython\n", "from jinja2 import Template\n", "\n", "from jupyter_lsp import LanguageServerManager" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": true }, "outputs": [], "source": [ "mgr = LanguageServerManager(extra_node_roots=[str(pathlib.Path.cwd().parent)])" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": true }, "outputs": [], "source": [ "mgr.init_language_servers()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": true }, "outputs": [], "source": [ "def lang_server_table(specs):\n", " return IPython.display.HTML(\n", " Template(\n", " \"\"\"\n", "
| Languages | \n", "Implementation | \n", "Installation | \n", "
|---|---|---|
| \n",
" {% for lang in spec.languages %}\n",
" {{ lang }} \n", " {% endfor %}\n", " | \n",
" \n", " {{key}}\n", " | \n", "\n",
"
| \n",
"