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

Tolerate missing settings in initialize #453

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

inducer
Copy link

@inducer inducer commented Feb 7, 2024

This is needed in order to get the language server to go with helix, using configuration as follows (in languages.toml):

[language-server.black-lsp]
command = "black-lsp"
args = ["--stdio"]
config = {}

[[language]]
name = "python"
language-servers = [
  "black-lsp"
]

Helix appears to pass null for initializationOptions, which appears to be allowed according to the spec.

Copy link
Member

@karthiknadig karthiknadig left a comment

Choose a reason for hiding this comment

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

Could you add a test for this?

bundled/tool/lsp_server.py Outdated Show resolved Hide resolved
Co-authored-by: Karthik Nadig <kanadig@microsoft.com>
@inducer
Copy link
Author

inducer commented Feb 7, 2024

Where would the tests for this live? How are they run?

@karthiknadig
Copy link
Member

karthiknadig commented Feb 7, 2024

See here: https://github.com/microsoft/vscode-black-formatter/blob/main/src/test/python_tests/test_path_specialization.py

You should be able to run these tests using pytest src/test/python_tests. I recommend running specific file that you edit. The test_edit_utils.py can take over 10 mins.

You need to do the following to set up:

  1. Create a virtual environment
  2. Install nox and run nox --session install_bundled_libs
  3. Install test requirements from here: https://github.com/microsoft/vscode-black-formatter/blob/main/src/test/python_tests/requirements.txt
  4. Then run pytest src/test/python_tests/<your test file>.py

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.

None yet

2 participants