Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance language server spec #89

Open
bollwyvl opened this issue Nov 1, 2019 · 6 comments
Open

Enhance language server spec #89

bollwyvl opened this issue Nov 1, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@bollwyvl
Copy link
Collaborator

bollwyvl commented Nov 1, 2019

For https://github.com/krassowski/jupyterlab-lsp/pull/81#issuecomment-548042214

The current spec is a little limited as revealed in #81 for really driving UI. A more complete spec might be something like (not suggesting YAML, just easier to write):

# from spec version 0
argv: 
  - pyls
languages:
  - python
# definitely want
display_name: pyls
mime_types: # could be the source-of-truth instead of guessing in client
  - text/python
  - text/x-ipython
urls:
  home: https://github.com/palantir/python-language-server
  issues: https://github.com/palantir/python-language-server/issues
debug_argv: # will be complicated with helpers, e.g. r
  - pyls
  - v
# nice-to-have
config_schema: # it would be better to have these on the ts side, but...
  pyls.plugins.pydocstyle.enabled:
    type: boolean
    # so much more...
    # https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json
install: # for docs only
  pip: pip install python-language-server[all]
  conda: conda install -c conda-forge python-language-server
extend: # at least a few other servers are extensible
  - display_name: mypy 
    install: ...
  - display_name: isort
    install: ...
  - display_name: black
    install: ...
environment: # just because kernels have them
  PYTHONUNBUFFERED: "1"

This would necessitate a bump to the entry_point spec version, e.g. jupyter_lsp_spec_v1, though it may be possible to maintain backwards compatibility...

@bollwyvl bollwyvl added the enhancement New feature or request label Nov 1, 2019
@bollwyvl bollwyvl mentioned this issue Nov 2, 2019
8 tasks
@bollwyvl
Copy link
Collaborator Author

bollwyvl commented Nov 4, 2019

It's probably also worth generating some documentation from the schema:
https://github.com/adobe/jsonschema2md

@krassowski
Copy link
Member

+1 for more readable (markdown) schema docs.

As for the UI/UX feedback and in regard to the design proposed in https://github.com/krassowski/jupyterlab-lsp/issues/85#issuecomment-549745289 the only thing I have a problem with right now is to group connections by the server. This is usually an easy task, but the problem comes in when there is more than one LSP server supporting the same language:

  1. will this ever be the case that we will have two LSP servers for a language? I guess it's likely once users start to experiment
  2. How we can identify the LSP server in use by a particular connection? Probably comparing the endpoint address of the connection and the endpoint assigned by the server extension would make sense (even if two servers provide a language, there is only one in use at a time, and it is the one which handles the endpoint, right?) - in that case we would like to have the endpoint names which redirected to a particular server available in the sessions response; something like:
[
    {
         "display_name": "Server 1",
         "languages": ["javascript"],
         "endpoints": ["javascript"]
    },
    {
         "display_name":": "Server 2",
         "languages": ["javascript", "typescript"],
         "endpoints": ["typescript"]
    }
]

where server1 is specialized in JS and takes precedence over server2 in handling JS, even though both support JS. Just a hypothetical situation I want to ponder right now so we are prepared for the future. Does it make sense?

@bollwyvl
Copy link
Collaborator Author

bollwyvl commented Nov 5, 2019 via email

@bollwyvl
Copy link
Collaborator Author

bollwyvl commented Nov 5, 2019 via email

@krassowski
Copy link
Member

there's no reason not to have one socket per language server,
and it will advertise to the client what file extensions, mime types, etc.
it supports. This would normalize a lot of things.

so we are heading towards /lsp/<server>/<language> as in /lsp/plys/python for the next spec version?

@bollwyvl
Copy link
Collaborator Author

bollwyvl commented Nov 5, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants