sublimelsp / LSP-pyright

Python support for Sublime's LSP plugin provided through microsoft/pyright.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

not reading pyrightconfig.json?

sryza opened this issue · comments

I put some misformatted JSON in my pyrightconfig.json, and then turned on Sublime, but the language server appears to be running successfully. This leads me to believe that this file is not being read.

Is this expected?

This is the output I'm seeing in the sublime console.

LSP-pyright: Using python path "/usr/bin/python"
LSP: starting ['/Users/sryza/Library/Caches/Sublime Text/Package Storage/lsp_utils/node-runtime/16.15.0/node/bin/node', '/Users/sryza/Library/Caches/Sublime Text/Package Storage/LSP-pyright/16.15.0/language-server/node_modules/pyright/langserver.index.js', '--stdio'] in /Users/sryza/dagster
LSP: LSP-pyright: supported code action kinds: ['quickfix', 'source.organizeImports']

Thanks in advance for any help!

Provide some misformatted JSON in my pyrightconfig.json.

Here's what it looked like (notice "fdjskl"):

{
  "exclude": [
    "**/alembic",
    "**/__pycache__",
    "**/node_modules",
    "**/.git",
    "**/.tox",
    "../internal/**/alembic",
    "../internal/**/__pycache__",
    "../internal/**/node_modules",
    "../internal/**/.git",
    "../internal/**/.tox",
    "../internal/**/.venv*"
  ],
  fdjskl
  "venvPath": "/Users/sryza/.pyenv/versions/3.9.11/envs/",
  "venv": "dagster-3.9.11",
  "reportImplicitStringConcatenation": false,
}

There is a warning in the LSP log panel (open with LSP: Toggle Log Panel):

LSP-pyright: Config file "/usr/local/workspace/github/pylsp-mypy/pyrightconfig.json" could not be parsed. Verify that format is correct.

So pyright ignores an invalid configuration file. What is your expectation here?

There is a warning in the LSP log panel (open with LSP: Toggle Log Panel):

I was not aware of that! Huge. Was able to use that to find the issue. So closing this.

I think it could be worthwhile mentioning this somewhere in the README.

By "mentioning this", I mean mentioning that you can toggle the log panel to help with debugging setup issues.