question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Language Server Configuration UI

See original GitHub issue

Elevator Pitch

Add a per-language-server configuration system.

Motivation

Many useful properties of the language servers (and their plugins) cannot be controlled with checked-in files. This has been mentioned for pyls in specific, but other servers (like markdown) are almost unusable without deeper configuration (e.g. ignored words in spell check).

Design Ideas

Once #192 allows for fine-grained control of which server you are talking to, we can store each server’s config in a Big Untyped Blob in the lab settings, keyed by implementation name. You’d just edit it by hand in Advanced Settings. It probably makes sense to separate this from our (hopefully) well-typed config. So the advanced settings might look like:

[ ] Language Server Client    | // consult your language server for configuration options
[x] Language Servers          | {
...                           |    "pyls": {}
                              | }

I don’t think we can have (or would even want) one per server, as I don’t think there’s a way to dynamically change schema at the labextension level.

Once it’s available, it would “just” be a new message for the client to send to the proxy, and on to the server.

Maybe on the initial PR?

Once getting it working the first time, we could look at using the per-server schema to generate a UI:

We may also want to let such configuration (or humanely, collection of files, keyed by implementation name) to be checked into a repo (or put in a home dir) and found at runtime. This suggests a:

  • a set of well-known locations, e.g. for pyls:
${PREFIX}/etc/jupyter/lsp/pyls.json
~/.jupyter/lsp/pyls.json
$(cwd)/.jupyter-lsp/pyls.json # could hide .virtual in here
  • a lsp/config/<language-server> handler
    • merges configs from the search path?
  • a new part of ILanguageServerManager that knows how to fetch it
    • merge with any stuff from jupyterlab-managed config?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
trajamsmithcommented, Apr 15, 2020

I’ve got some bandwidth to help with this, if that’s alright with you all. What’s the preferred workflow? Should I fork and branch off of master?

2reactions
bollwyvlcommented, Apr 15, 2020

In the interest of #244 and other issues, here’s a sketch of what it would take to get some kind of configurability, with the least surprising UI:

  • add a JupyterLab config section (as edited with JSON in the Advanced Settings UI) to the existing plugin.json for language_servers
    • perhaps reserve the top-level object for future space, so client_settings
  • when a new connection is made by the ConnectionManager, check for that language server name and send the appropriate message
  • when you live edit it, send the config message

Basically everything else we can push off until later: i definitely want the ability to store this stuff someplace on the server, so it is easier to check in and share on a team, but if this answers the need on #244, and gives us the opportunity to iterate with something that works, we can make do!

I’m not sure when I’d get to this, but can certainly provide further insights.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Language Server Extension Guide - Visual Studio Code
This section contributes configuration settings to VS Code. The example will explain how these settings are sent over to the language server on...
Read more >
Language Server Protocol - Microsoft Open Source
The Language Server Protocol (LSP) defines the protocol used between an editor or IDE and a language server that provides language features like...
Read more >
Configuration File · sumneko/lua-language-server Wiki
A language server that offers Lua language support - programmed in Lua - Configuration File · sumneko/lua-language-server Wiki.
Read more >
A Practical Guide for Language Server Protocol
It provides an interface called LanguageServer that should be realized when implementing a concrete LS. According to LSP4J, a Language Server ...
Read more >
Configuration — haskell-language-server 1.8.0.0 documentation
Language servers like haskell-language-server expose most of their configuration via the client (i.e. the editor). That means that the way in which you ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found