Open AJMC2002 opened 8 months ago
Thanks @AJMC2002. It looks related to https://github.com/haskell/haskell-language-server/issues/3821
Debug | VFS: opening file:///home/le-moski/Repos/IHaskell/.virtual_documents/notebooks/%D0%9F%D1%80%D0%B0%D0%BA%D1%82%D0%B8%D0%BA%D0%B0%202.ipynb Warning | No plugin handles this "textDocument/didOpen" request.
What is the notebook name? This percent encoding looks odd.
Based on https://github.com/haskell/haskell-language-server/issues/3821#issuecomment-1768253974:
We can possibly find a better way of determining the file type that doesn't involve parsing the URI
I understand that haskell-language-server tries to infer the type from file URI (so basically from extension). If I see this correctly, it will not infer much from .ipynb
. There was a previous moderately successful attempt to setup haskell language server in https://github.com/jupyter-lsp/jupyterlab-lsp/issues/313. Does it work for you if you open a .hs
file rather than a notebook?
If the haskell language server requires .hs
extension we can force-append it to the file path. This was previously discussed in https://github.com/jupyter-lsp/jupyterlab-lsp/issues/872 and a PR was opened https://github.com/jupyter-lsp/jupyterlab-lsp/pull/873 but code has moved since to https://github.com/jupyterlab/jupyterlab/tree/main/packages/lsp/src so a new PR is needed.
What is the notebook name? This percent encoding looks odd.
It's "Практика 2.ipynb". I assume it's just changing the Cyrillic alphabet into utf-8 hex codes.
So I'll put my attempts below using the following base test file in /IHaskell/notebooks
and running jupyter lab --ContentsManager.allow_hidden=True
in /IHaskell
:
-- /IHaskell/notebooks/test.hs
main = sumSomething genSomething
genSomething = replicate 5 10
sumSomething = sum
doSomething = do
return $ sumSomething genSomething
After loading the file, there's an error present, since test.hs
isn't listed in the .cabal
file of the current directory.
I guess that has something to do with lines like
2024-03-04T05:48:36.092897Z | Debug | explicit-fixity: Rule Failed: GetHieAst
in the output log.
Here's the error message:
When hovering over it, the LSP outputs the following:
2024-03-04T05:48:19.138978Z | Debug | DocumentHighlight request at position 1:1 in file: /home/le-moski/Repos/IHaskell/notebooks/test.hs
2024-03-04T05:48:19.139307Z | Debug | LOOKUP PERSISTENT FOR: GetHieAst
2024-03-04T05:48:19.139368Z | Debug | Finished: C:GetHieAst:/home/le-moski/Repos/IHaskell/notebooks/test.hs Took: 0.00s
2024-03-04T05:48:36.091871Z | Debug | GhcIde.hover entered (ideLogger)
2024-03-04T05:48:36.092286Z | Debug | LOOKUP PERSISTENT FOR: GetFixity
2024-03-04T05:48:36.092293Z | Debug | Hover request at position 1:1 in file: /home/le-moski/Repos/IHaskell/notebooks/test.hs
2024-03-04T05:48:36.092496Z | Debug | Finished: C:GetFixity:/home/le-moski/Repos/IHaskell/notebooks/test.hs Took: 0.00s
2024-03-04T05:48:36.092801Z | Debug | Finished: C:GetHieAst:/home/le-moski/Repos/IHaskell/notebooks/test.hs Took: 0.00s
2024-03-04T05:48:36.092897Z | Debug | explicit-fixity: Rule Failed: GetHieAst
2024-03-04T05:48:36.093117Z | Debug | Finished: C:GetHieAst:/home/le-moski/Repos/IHaskell/notebooks/test.hs Took: 0.00s
Autocompletion works with locally defined functions and bindings. Nonetheless for dependencies installed in the directory, it doesn't autocomplete anything.
Using tab in an empty function shows common keywords.
Jumping to definition and showing references doesnt work.
The output of the LSP doens't mention much about autocompletion or other requests, mainly showing output of hovering and rebuilding everytime the file is modified.
In some time I'm gonna check out what happens if I add the test file to the cabal file.
Description
I'm trying to make haskell-language-server work with the following configuration
See config
```js // /etc/jupyter/jupyter_server_config.d/hls.json { "LanguageServerManager": { "language_servers": { "haskell-language-server": { "version": 2, "argv": [ "haskell-language-server-wrapper-2.6.0.0", "--lsp", "-d" ], "languages": [ "haskell" ], "mime_types": [ "text/haskell", "text/x-haskell" ], "display_name": "haskell-language-server", "serverSettings": { "haskell": { "checkParents": "CheckOnSave", "checkProject": true, "maxCompletions": 40, "formattingProvider": "fourmolu", "plugin": { "stan": { "globalOn": true } } } } } } } } ```I'm running jupyter lab in the clone of IHaskell repository and the LSP isn't working properly since it isn't receiving configuration from the client. After running
jupyter lab --ContentsManager.allow_hidden=True
I get:Output
``` [I 2024-03-03 18:48:11.609 ServerApp] jupyter_lsp | extension was successfully linked. [I 2024-03-03 18:48:11.616 ServerApp] jupyter_server_terminals | extension was successfully linked. [I 2024-03-03 18:48:11.623 ServerApp] jupyterlab | extension was successfully linked. [I 2024-03-03 18:48:11.624 ServerApp] jupyterlab_jupytext | extension was successfully linked. [I 2024-03-03 18:48:11.628 ServerApp] nbclassic | extension was successfully linked. [I 2024-03-03 18:48:12.033 ServerApp] jupyter_nbextensions_configurator | extension was found and enabled by notebook_shim. Consider moving the extension to Jupyter Server's extension paths. [I 2024-03-03 18:48:12.033 ServerApp] jupyter_nbextensions_configurator | extension was successfully linked. [I 2024-03-03 18:48:12.033 ServerApp] notebook_shim | extension was successfully linked. [I 2024-03-03 18:48:12.067 ServerApp] notebook_shim | extension was successfully loaded. [I 2024-03-03 18:48:12.069 ServerApp] jupyter_lsp | extension was successfully loaded. [I 2024-03-03 18:48:12.070 ServerApp] [jupyter_nbextensions_configurator] enabled 0.6.3 [I 2024-03-03 18:48:12.070 ServerApp] jupyter_nbextensions_configurator | extension was successfully loaded. [I 2024-03-03 18:48:12.071 ServerApp] jupyter_server_terminals | extension was successfully loaded. [I 2024-03-03 18:48:12.077 LabApp] JupyterLab extension loaded from /home/le-moski/.local/lib/python3.10/site-packages/jupyterlab [I 2024-03-03 18:48:12.077 LabApp] JupyterLab application directory is /home/le-moski/.local/share/jupyter/lab [I 2024-03-03 18:48:12.078 LabApp] Extension Manager is 'pypi'. [I 2024-03-03 18:48:12.145 ServerApp] jupyterlab | extension was successfully loaded. [W 2024-03-03 18:48:12.146 ServerApp] [Jupytext Server Extension] Async contents managers like AsyncLargeFileManager are not supported at the moment (https://github.com/mwouts/jupytext/issues/1020). We will derive a contents manager from LargeFileManager instead. [I 2024-03-03 18:48:12.146 ServerApp] [Jupytext Server Extension] Deriving a JupytextContentsManager from LargeFileManager [I 2024-03-03 18:48:12.148 ServerApp] jupyterlab_jupytext | extension was successfully loaded. _ _ _ _ | | | |_ __ __| |__ _| |_ ___ | |_| | '_ \/ _` / _` | _/ -_) \___/| .__/\__,_\__,_|\__\___| |_| Read the migration plan to Notebook 7 to learn about the new features and the actions to take if you are using extensions. https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html Please note that updating to Notebook 7 might break some of your extensions. [I 2024-03-03 18:48:12.156 ServerApp] nbclassic | extension was successfully loaded. [I 2024-03-03 18:48:12.157 ServerApp] Serving notebooks from local directory: /home/le-moski/Repos/IHaskell [I 2024-03-03 18:48:12.157 ServerApp] Jupyter Server 2.12.5 is running at: [I 2024-03-03 18:48:12.157 ServerApp] http://localhost:8888/lab?token=b9b4ec1f0896a2721bb90b0a4877bcbc216200affa5e90b4 [I 2024-03-03 18:48:12.157 ServerApp] http://127.0.0.1:8888/lab?token=b9b4ec1f0896a2721bb90b0a4877bcbc216200affa5e90b4 [I 2024-03-03 18:48:12.157 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 2024-03-03 18:48:12.238 ServerApp] To access the server, open this file in a browser: file:///home/le-moski/.local/share/jupyter/runtime/jpserver-137682-open.html Or copy and paste one of these URLs: http://localhost:8888/lab?token=b9b4ec1f0896a2721bb90b0a4877bcbc216200affa5e90b4 http://127.0.0.1:8888/lab?token=b9b4ec1f0896a2721bb90b0a4877bcbc216200affa5e90b4 Opening in existing browser session. [I 2024-03-03 18:48:12.979 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server [I 2024-03-03 18:48:15.400 LabApp] `sys_prefix` level settings are read-only, using `user` level for migration to `lockedExtensions` [I 2024-03-03 18:48:15.447 LabApp] Build is up to date [I 2024-03-03 18:48:16.299 LabApp] `sys_prefix` level settings are read-only, using `user` level for migration to `lockedExtensions` [I 2024-03-03 18:48:16.316 LabApp] `sys_prefix` level settings are read-only, using `user` level for migration to `lockedExtensions` [I 2024-03-03 18:48:16.329 LabApp] `sys_prefix` level settings are read-only, using `user` level for migration to `lockedExtensions` [I 2024-03-03 18:48:17.027 ServerApp] Kernel started: 2957d348-05be-44ed-b459-c4ff11644407 [I 2024-03-03 18:48:35.452 ServerApp] Adapting from protocol version 5.0 (kernel 2957d348-05be-44ed-b459-c4ff11644407) to 5.3 (client). [I 2024-03-03 18:48:35.454 ServerApp] Connecting to kernel 2957d348-05be-44ed-b459-c4ff11644407. [I 2024-03-03 18:48:35.468 ServerApp] Adapting from protocol version 5.0 (kernel 2957d348-05be-44ed-b459-c4ff11644407) to 5.3 (client). [I 2024-03-03 18:48:35.468 ServerApp] Connecting to kernel 2957d348-05be-44ed-b459-c4ff11644407. [I 2024-03-03 18:48:35.481 ServerApp] Adapting from protocol version 5.0 (kernel 2957d348-05be-44ed-b459-c4ff11644407) to 5.3 (client). [I 2024-03-03 18:48:35.482 ServerApp] Connecting to kernel 2957d348-05be-44ed-b459-c4ff11644407. ghcide version: 2.6.0.0 (GHC: 9.6) (PATH: /home/le-moski/.cabal/store/ghc-9.6.4/ghcide-2.6.0.0-e-ghcide-882412df595efedaf11b3137560708ac54234fb9948efb07422886e7b9ecc009/bin/ghcide) Info | Logging heap statistics every 60.00s Info | Starting LSP server... If you are seeing this in a terminal, you probably should have run WITHOUT the --lsp option! PluginIds: [ ghcide-completions , ghcide-hover-and-symbols , LSPRecorderCallback , ghcide-type-lenses , ghcide-core ] Info | Starting server Warning | LSP: configuration parse error: parsing settings failed, expected Object, but encountered Null when parsing null Info | Started LSP server in 0.09s Debug | cabal exec -v0 -- ghc --print-libdir Debug | cabal exec -v0 -- ghc -package-env=- -ignore-dot-ghci -e Control.Monad.join (Control.Monad.fmap System.IO.putStr System.Environment.getExecutablePath) Debug | cabal --builddir=/home/le-moski/.cache/hie-bios/dist-IHaskell-d9d1573e852f827564b1984ae8f77615 v2-exec --with-compiler /home/le-moski/.cache/hie-bios/wrapper-b54f81dea4c0e6d1626911c526bc4e36 --with-hc-pkg /home/le-moski/.cache/hie-bios/ghc-pkg-2812326d6c0dd442840166eb10cad8e2 ghc -v0 -- --print-libdir Environment Variables HIE_BIOS_GHC: /home/le-moski/.ghcup/ghc/9.6.4/lib/ghc-9.6.4/bin/ghc-9.6.4 HIE_BIOS_GHC_ARGS: -B/home/le-moski/.ghcup/ghc/9.6.4/lib/ghc-9.6.4/lib Debug | Setting initial dynflags... Debug | shouldRunSubset: False Debug | Initializing exports map from hiedb Info | Registering IDE configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri (-6436715302807236951) "file:///home/le-moski/Repos/IHaskell/.virtual_documents"], clientSettings = hashed (Just Null)} Debug | Done initializing exports map from hiedb. Size: 0 Debug | LSP: not requesting configuration since the client does not support workspace/configuration Debug | LSP: set new config: { } Debug | Configuration changed: Config {checkParents = CheckOnSave, checkProject = True, formattingProvider = "ormolu", cabalFormattingProvider = "cabal-fmt", maxCompletions = 40, plugins = fromList []} Debug | Shake session initialized Debug | Warning: Client does not support watched files. Falling back to OS polling Debug | Finished build session AsyncCancelled Debug | Restarting build session due to config change Action Queue: [] Keys: [GetClientSettings; ] Aborting previous build session took 0.00s Debug | LSP: not requesting configuration since the client does not support workspace/configuration Debug | VFS: opening file:///home/le-moski/Repos/IHaskell/.virtual_documents/notebooks/%D0%9F%D1%80%D0%B0%D0%BA%D1%82%D0%B8%D0%BA%D0%B0%202.ipynb Warning | No plugin handles this "textDocument/didOpen" request. Warning | No plugin handles this "textDocument/didChange" request. Warning | No plugin handles this "textDocument/didChange" request. Warning | No plugin handles this "textDocument/hover" request. Warning | No plugin handles this "textDocument/documentHighlight" request. Warning | No plugin handles this "textDocument/documentHighlight" request. Warning | No plugin handles this "textDocument/documentHighlight" request. Warning | No plugin handles this "textDocument/completion" request. Warning | No plugin handles this "textDocument/documentHighlight" request. Warning | No plugin handles this "textDocument/documentHighlight" request. Warning | No plugin handles this "textDocument/documentHighlight" request. Warning | No plugin handles this "textDocument/documentHighlight" request. ^C[I 2024-03-03 18:49:33.152 ServerApp] interrupted [I 2024-03-03 18:49:33.153 ServerApp] Serving notebooks from local directory: /home/le-moski/Repos/IHaskell 1 active kernel Jupyter Server 2.12.5 is running at: http://localhost:8888/lab?token=b9b4ec1f0896a2721bb90b0a4877bcbc216200affa5e90b4 http://127.0.0.1:8888/lab?token=b9b4ec1f0896a2721bb90b0a4877bcbc216200affa5e90b4 Shutdown this Jupyter server (y/[n])? y [C 2024-03-03 18:49:33.987 ServerApp] Shutdown confirmed [I 2024-03-03 18:49:33.989 ServerApp] Shutting down 7 extensions [I 2024-03-03 18:49:33.991 ServerApp] Shutting down 1 kernel [I 2024-03-03 18:49:33.992 ServerApp] Kernel shutdown: 2957d348-05be-44ed-b459-c4ff11644407 Press Ctrl-C again to quit kernel. ```Basically the server does nothing, is there some way to fix this or is it some issue with jupyterlab-lsp, or even with hls settings?
Reproduce
.lsp_symlink
directing to/
.cabal.project
.jupyter lab --ContentsManager.allow_hidden=True
.Expected behavior
The language server should provide it's functionality but instead it returns a warning:
Warning | No plugin handles this "..." request.
I assume the established configuration doesn't get to the lsp since it shows: