Skip to content

Commit

Permalink
Merge pull request #697 from jupyter-lsp/update-typescript-server
Browse files Browse the repository at this point in the history
Migrate to typescript-language-server
  • Loading branch information
krassowski authored Oct 24, 2021
2 parents 1f57ce0 + a07e008 commit bcf7820
Show file tree
Hide file tree
Showing 16 changed files with 165 additions and 205 deletions.
2 changes: 1 addition & 1 deletion atest/01_Editor.robot
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ SCSS

TSX
${def} = Set Variable xpath:(//span[contains(@class, 'cm-tag')][contains(text(), 'HelloWorld')])[last()]
Editor Shows Features for Language TSX example.tsx Diagnostics=Cannot find module 'react' Jump to Definition=${def} Rename=${def}
Editor Shows Features for Language TSX example.tsx Diagnostics='hello' is declared but its value is never read. Jump to Definition=${def} Rename=${def}

TypeScript
${def} = Set Variable xpath:(//span[contains(@class, 'cm-variable')][contains(text(), 'inc')])[last()]
Expand Down
2 changes: 1 addition & 1 deletion atest/05_Features/Completion.robot
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Invalidates On Cell Change
Invalidates On Focus Loss
Enter Cell Editor 1 line=2
Press Keys None TAB
Click JupyterLab Menu File
Click JupyterLab Menu File
# just to increase chances of catching this on CI (which is slow)
Sleep 4s
Completer Should Not Suggest test
Expand Down
2 changes: 1 addition & 1 deletion atest/05_Features/Hover.robot
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Hover works in foreign code (javascript)
# also for multiple cells of the same document
Enter Cell Editor 3
Trigger Tooltip Math
Element Should Contain ${HOVER_BOX} const Math: Math
Element Should Contain ${HOVER_BOX} Math: Math

*** Keywords ***
Last Occurrence
Expand Down
2 changes: 1 addition & 1 deletion atest/Keywords.robot
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ Wait Until Fully Initialized
Wait Until Element Contains ${STATUSBAR} Fully initialized timeout=60s

Wait For Ready State
Wait For Condition return document.readyState=="complete"
Wait For Condition return document.readyState=="complete"

Open Context Menu Over
[Arguments] ${sel}
Expand Down
2 changes: 0 additions & 2 deletions atest/examples/example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ export class HelloWorld extends React.Component<any, any> {
}

const hello = <HelloWorld/>;

;hello;
4 changes: 2 additions & 2 deletions docs/Extending.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@
" {\n",
" 'all_listeners': ['some.module.some_function'],\n",
" 'client_listeners': ['some.module.some_other_function'],\n",
" 'server_listeners': ['some.module.yet_another_function'],\n",
" },\n",
" 'server_listeners': ['some.module.yet_another_function']\n",
" }\n",
"}\n",
"```"
]
Expand Down
4 changes: 2 additions & 2 deletions docs/Language Servers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
" vscode-css-languageserver-bin \\\n",
" dockerfile-language-server-nodejs \\\n",
" vscode-html-languageserver-bin \\\n",
" javascript-typescript-langserver \\\n",
" typescript-language-server \\\n",
" vscode-json-languageserver-bin \\\n",
" yaml-language-server\n",
"```\n",
Expand Down Expand Up @@ -374,4 +374,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
4 changes: 2 additions & 2 deletions docs/Roadmap.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"source": [
"### Backend\n",
"\n",
"- [#49](https://github.com/jupyter-lsp/jupyterlab-lsp/issues/49) cookiecutter for\n",
" pip-installable specs\n",
"- [#49](https://github.com/jupyter-lsp/jupyterlab-lsp/issues/49) cookiecutter\n",
" for pip-installable specs\n",
"- add hook system to allow serverextensions/kernels to modify, inspect and react\n",
" to LSP messages"
]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.21.5",
"husky": "^3.0.9",
"javascript-typescript-langserver": "^2.11.3",
"typescript-language-server": "^0.6.4",
"jest-github-actions-reporter": "^1.0.2",
"lerna": "^3.13.2",
"npm-run-all": "^4.1.5",
Expand Down
4 changes: 3 additions & 1 deletion python_packages/jupyter_lsp/jupyter_lsp/specs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from .r_languageserver import RLanguageServer
from .sql_language_server import SQLLanguageServer
from .texlab import Texlab
from .typescript_language_server import TypescriptLanguageServer
from .unified_language_server import UnifiedLanguageServer
from .vscode_css_languageserver import VSCodeCSSLanguageServer
from .vscode_html_languageserver import VSCodeHTMLLanguageServer
Expand All @@ -32,6 +33,7 @@
pyright = PyrightLanguageServer()
r = RLanguageServer()
tex = Texlab()
ts = JavascriptTypescriptLanguageServer()
ts_old = JavascriptTypescriptLanguageServer()
ts = TypescriptLanguageServer()
sql = SQLLanguageServer()
yaml = YAMLLanguageServer()
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class JavascriptTypescriptLanguageServer(NodeModuleSpec):
"javascriptreact",
]
spec = dict(
display_name=key,
display_name=key + " (deprecated)",
mime_types=[
"application/typescript",
"text/typescript-jsx",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from .utils import NodeModuleSpec


class TypescriptLanguageServer(NodeModuleSpec):
node_module = key = "typescript-language-server"
script = ["lib", "cli.js"]
args = ["--stdio"]
languages = [
"javascript",
"jsx",
"typescript",
"typescript-jsx",
"typescriptreact",
"javascriptreact",
]
spec = dict(
display_name=key,
mime_types=[
"application/typescript",
"text/typescript-jsx",
"text/javascript",
"text/ecmascript",
"application/javascript",
"application/x-javascript",
"application/ecmascript",
"text/jsx",
],
urls=dict(
home="https://github.com/typescript-language-server/{}".format(key),
issues="https://github.com/typescript-language-server/{}/issues".format(
key
),
),
install=dict(
npm="npm install --save-dev {}".format(key),
yarn="yarn add --dev {}".format(key),
jlpm="jlpm add --dev {}".format(key),
),
)
2 changes: 1 addition & 1 deletion python_packages/jupyter_lsp/jupyter_lsp/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
KNOWN_SERVERS = [
"bash-language-server",
"dockerfile-language-server-nodejs",
"javascript-typescript-langserver",
"typescript-language-server",
"pylsp",
"unified-language-server",
"sql-language-server",
Expand Down
3 changes: 2 additions & 1 deletion python_packages/jupyter_lsp/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ install_requires =
jupyter_lsp_spec_v1 =
bash-language-server = jupyter_lsp.specs:bash
dockerfile-language-server-nodejs = jupyter_lsp.specs:dockerfile
javascript-typescript-langserver = jupyter_lsp.specs:ts
javascript-typescript-langserver = jupyter_lsp.specs:ts_old
jedi-language-server = jupyter_lsp.specs:jedi
julia-language-server = jupyter_lsp.specs:julia
python-language-server = jupyter_lsp.specs:py_palantir
python-lsp-server = jupyter_lsp.specs:py_lsp_server
pyright = jupyter_lsp.specs:pyright
r-languageserver = jupyter_lsp.specs:r
texlab = jupyter_lsp.specs:tex
typescript-language-server = jupyter_lsp.specs:ts
sql-language-server = jupyter_lsp.specs:sql
unified-language-server = jupyter_lsp.specs:md
vscode-css-languageserver-bin = jupyter_lsp.specs:css
Expand Down
2 changes: 2 additions & 0 deletions requirements/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ dependencies:
- nodejs {nodejs}
# for python language server (and development)
- flake8 >=3.5
# temporarily pin autopep8
- autopep8 <1.6.0
# for R language server and kernel
# TODO: try r 4.0 soon
- r <4
Expand Down
Loading

0 comments on commit bcf7820

Please sign in to comment.