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

Language Server Spec v1 #90

Merged
merged 11 commits into from
Nov 5, 2019
Merged

Conversation

bollwyvl
Copy link
Collaborator

@bollwyvl bollwyvl commented Nov 2, 2019

For #89.

  • add all the goodies from Enhance language server spec #89 to the schema
    • also env
  • make the spec nested under the session
    • we may want to split these up: the specs are (basically) static, but with the config schema, etc. pretty heavy duty
  • add first kitchen-sink example
  • docs
  • hard version bump
  • generate typescript types from schema
new example output
{
  "version": 1,
  "sessions": [
    {
      "handler_count": 0,
      "status": "not_started",
      "last_server_message_at": null,
      "last_handler_message_at": null,
      "spec": {
        "languages": [
          "bash",
          "sh"
        ],
        "version": 1
      }
    },
    {
      "handler_count": 0,
      "status": "not_started",
      "last_server_message_at": null,
      "last_handler_message_at": null,
      "spec": {
        "languages": [
          "css",
          "less",
          "scss"
        ],
        "version": 1
      }
    },
    {
      "handler_count": 0,
      "status": "not_started",
      "last_server_message_at": null,
      "last_handler_message_at": null,
      "spec": {
        "languages": [
          "dockerfile"
        ],
        "version": 1
      }
    },
    {
      "handler_count": 0,
      "status": "not_started",
      "last_server_message_at": null,
      "last_handler_message_at": null,
      "spec": {
        "languages": [
          "html"
        ],
        "version": 1
      }
    },
    {
      "handler_count": 0,
      "status": "not_started",
      "last_server_message_at": null,
      "last_handler_message_at": null,
      "spec": {
        "languages": [
          "javascript",
          "jsx",
          "typescript",
          "typescript-jsx"
        ],
        "version": 1
      }
    },
    {
      "handler_count": 2,
      "status": "started",
      "last_server_message_at": "2019-11-02T18:00:17.538010+00:00",
      "last_handler_message_at": "2019-11-02T18:00:17.286804+00:00",
      "spec": {
        "languages": [
          "json"
        ],
        "version": 1
      }
    },
    {
      "handler_count": 0,
      "status": "not_started",
      "last_server_message_at": null,
      "last_handler_message_at": null,
      "spec": {
        "languages": [
          "markdown",
          "ipythongfm"
        ],
        "version": 1
      }
    },
    {
      "handler_count": 0,
      "status": "not_started",
      "last_server_message_at": null,
      "last_handler_message_at": null,
      "spec": {
        "languages": [
          "python"
        ],
        "version": 1,
        "display_name": "pyls",
        "mime_types": [
          "text/python",
          "text/x-ipython"
        ],
        "urls": {
          "home": "https://github.com/palantir/python-language-server",
          "issues": "https://github.com/palantir/python-language-server/issues"
        },
        "install": {
          "pip": "pip install python-language-server[all]",
          "conda": "conda install -c conda-forge python-language-server"
        },
        "extend": [
          {
            "display_name": "pyls-mypy",
            "install": {
              "pip": "pip install pyls-mypy"
            }
          },
          {
            "display_name": "pyls-black",
            "install": {
              "pip": "pip install pyls-black"
            }
          },
          {
            "display_name": "pyls-isort",
            "install": {
              "pip": "pip install pyls-isort"
            }
          }
        ],
        "config_schema": {
          "title": "Python Language Server Configuration",
          "type": "object",
          "properties": {
            "pyls.executable": {
              "type": "string",
              "default": "pyls",
              "description": "Language server executable"
            },
            "pyls.configurationSources": {
              "type": "array",
              "default": [
                "pycodestyle"
              ],
              "description": "List of configuration sources to use.",
              "items": {
                "type": "string",
                "enum": [
                  "pycodestyle",
                  "pyflakes"
                ]
              },
              "uniqueItems": true
            },
            "pyls.plugins.jedi_completion.enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable or disable the plugin."
            },
            "pyls.plugins.jedi_completion.include_params": {
              "type": "boolean",
              "default": true,
              "description": "Auto-completes methods and classes with tabstops for each parameter."
            },
            "pyls.plugins.jedi_definition.enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable or disable the plugin."
            },
            "pyls.plugins.jedi_definition.follow_imports": {
              "type": "boolean",
              "default": true,
              "description": "The goto call will follow imports."
            },
            "pyls.plugins.jedi_definition.follow_builtin_imports": {
              "type": "boolean",
              "default": true,
              "description": "If follow_imports is True will decide if it follow builtin imports."
            },
            "pyls.plugins.jedi_hover.enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable or disable the plugin."
            },
            "pyls.plugins.jedi_references.enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable or disable the plugin."
            },
            "pyls.plugins.jedi_signature_help.enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable or disable the plugin."
            },
            "pyls.plugins.jedi_symbols.enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable or disable the plugin."
            },
            "pyls.plugins.jedi_symbols.all_scopes": {
              "type": "boolean",
              "default": true,
              "description": "If True lists the names of all scopes instead of only the module namespace."
            },
            "pyls.plugins.mccabe.enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable or disable the plugin."
            },
            "pyls.plugins.mccabe.threshold": {
              "type": "number",
              "default": 15,
              "description": "The minimum threshold that triggers warnings about cyclomatic complexity."
            },
            "pyls.plugins.preload.enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable or disable the plugin."
            },
            "pyls.plugins.preload.modules": {
              "type": "array",
              "default": null,
              "items": {
                "type": "string"
              },
              "uniqueItems": true,
              "description": "List of modules to import on startup"
            },
            "pyls.plugins.pycodestyle.enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable or disable the plugin."
            },
            "pyls.plugins.pycodestyle.exclude": {
              "type": "array",
              "default": null,
              "items": {
                "type": "string"
              },
              "uniqueItems": true,
              "description": "Exclude files or directories which match these patterns."
            },
            "pyls.plugins.pycodestyle.filename": {
              "type": "array",
              "default": null,
              "items": {
                "type": "string"
              },
              "uniqueItems": true,
              "description": "When parsing directories, only check filenames matching these patterns."
            },
            "pyls.plugins.pycodestyle.select": {
              "type": "array",
              "default": null,
              "items": {
                "type": "string"
              },
              "uniqueItems": true,
              "description": "Select errors and warnings"
            },
            "pyls.plugins.pycodestyle.ignore": {
              "type": "array",
              "default": null,
              "items": {
                "type": "string"
              },
              "uniqueItems": true,
              "description": "Ignore errors and warnings"
            },
            "pyls.plugins.pycodestyle.hangClosing": {
              "type": "boolean",
              "default": null,
              "description": "Hang closing bracket instead of matching indentation of opening bracket's line."
            },
            "pyls.plugins.pycodestyle.maxLineLength": {
              "type": "number",
              "default": null,
              "description": "Set maximum allowed line length."
            },
            "pyls.plugins.pydocstyle.enabled": {
              "type": "boolean",
              "default": false,
              "description": "Enable or disable the plugin."
            },
            "pyls.plugins.pydocstyle.convention": {
              "type": "string",
              "default": null,
              "enum": [
                "pep257",
                "numpy"
              ],
              "description": "Choose the basic list of checked errors by specifying an existing convention."
            },
            "pyls.plugins.pydocstyle.addIgnore": {
              "type": "array",
              "default": null,
              "items": {
                "type": "string"
              },
              "uniqueItems": true,
              "description": "Ignore errors and warnings in addition to the specified convention."
            },
            "pyls.plugins.pydocstyle.addSelect": {
              "type": "array",
              "default": null,
              "items": {
                "type": "string"
              },
              "uniqueItems": true,
              "description": "Select errors and warnings in addition to the specified convention."
            },
            "pyls.plugins.pydocstyle.ignore": {
              "type": "array",
              "default": null,
              "items": {
                "type": "string"
              },
              "uniqueItems": true,
              "description": "Ignore errors and warnings"
            },
            "pyls.plugins.pydocstyle.select": {
              "type": "array",
              "default": null,
              "items": {
                "type": "string"
              },
              "uniqueItems": true,
              "description": "Select errors and warnings"
            },
            "pyls.plugins.pydocstyle.match": {
              "type": "string",
              "default": "(?!test_).*\\.py",
              "description": "Check only files that exactly match the given regular expression; default is to match files that don't start with 'test_' but end with '.py'."
            },
            "pyls.plugins.pydocstyle.matchDir": {
              "type": "string",
              "default": "[^\\.].*",
              "description": "Search only dirs that exactly match the given regular expression; default is to match dirs which do not begin with a dot."
            },
            "pyls.plugins.pyflakes.enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable or disable the plugin."
            },
            "pyls.plugins.pylint.enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable or disable the plugin."
            },
            "pyls.plugins.pylint.args": {
              "type": "array",
              "default": null,
              "items": {
                "type": "string"
              },
              "uniqueItems": false,
              "description": "Arguments to pass to pylint."
            },
            "pyls.plugins.rope_completion.enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable or disable the plugin."
            },
            "pyls.plugins.yapf.enabled": {
              "type": "boolean",
              "default": true,
              "description": "Enable or disable the plugin."
            },
            "pyls.rope.extensionModules": {
              "type": "string",
              "default": null,
              "description": "Builtin and c-extension modules that are allowed to be imported and inspected by rope."
            },
            "pyls.rope.ropeFolder": {
              "type": "array",
              "default": null,
              "items": {
                "type": "string"
              },
              "uniqueItems": true,
              "description": "The name of the folder in which rope stores project configurations and data.  Pass `null` for not using such a folder at all."
            }
          }
        }
      }
    },
    {
      "handler_count": 0,
      "status": "not_started",
      "last_server_message_at": null,
      "last_handler_message_at": null,
      "spec": {
        "languages": [
          "r"
        ],
        "version": 1
      }
    },
    {
      "handler_count": 3,
      "status": "started",
      "last_server_message_at": "2019-11-02T18:00:17.445828+00:00",
      "last_handler_message_at": "2019-11-02T18:00:17.212276+00:00",
      "spec": {
        "languages": [
          "yaml"
        ],
        "version": 1
      }
    }
  ]
}

while definitely still wip, i'd love feedback here or on #89 as to what else might drive UI value...

@jupyterlab-dev-mode
Copy link

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

@bollwyvl bollwyvl mentioned this pull request Nov 3, 2019
@bollwyvl bollwyvl changed the title [wip] Language Server Spec v1 Language Server Spec v1 Nov 5, 2019
{
"title": "Python Language Server Configuration",
"type": "object",
"properties": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that these properties are too heavy here and would ideally be stored and/or available under a different endpoint, but it seems reasonable to start small and refactor later on. Maybe it will turn out that it works just fine as-is!

@krassowski
Copy link
Member

Is this still WIP, or should we merge?

@bollwyvl
Copy link
Collaborator Author

bollwyvl commented Nov 5, 2019 via email

@krassowski krassowski merged commit 44b4d40 into jupyter-lsp:master Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants