mjrodgers / pulsar-ide-python

Python language support for Atom-IDE :atom: :snake:
https://web.pulsar-edit.dev/packages/ide-python
MIT License
7 stars 3 forks source link

linter not working #1

Closed contang0 closed 1 year ago

contang0 commented 1 year ago

As mentioned here , the linter does not work with pulsar-ide-python. The only way I got it to work was by enabling both pulsar-ide-python and ide-python, using linter-ruff

I am on Pulsar 1.107.1, Windows 11, pyls v0.36.2, using the latest version of both ide-python and pulsar-ide-python.

I just disabled ide-python, left pulsar-ide-python enabled, and in dev tools I see the following error:

Uncaught (in promise) TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at sanitizeConfig (C:\Users\Julius\.pulsar\packages\pulsar-ide-python\lib\utils.js:60:10)
    at PythonLanguageClient.mapConfigurationObject (C:\Users\Julius\.pulsar\packages\pulsar-ide-python\lib\main.js:52:15)
    at C:\Users\Julius\.pulsar\packages\pulsar-ide-python\node_modules\atom-languageclient\build\lib\auto-languageclient.js:413:47
    at Config.observeKeyPath (C:\Users\Julius\AppData\Local\Temp\2KOMWC68y6grPtVY8hEDbLbDKhO\resources\app.asar\src\config.js:1134:5)
    at Config.observe (C:\Users\Julius\AppData\Local\Temp\2KOMWC68y6grPtVY8hEDbLbDKhO\resources\app.asar\src\config.js:517:19)
    at PythonLanguageClient.<anonymous> (C:\Users\Julius\.pulsar\packages\pulsar-ide-python\node_modules\atom-languageclient\build\lib\auto-languageclient.js:412:54)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\Julius\.pulsar\packages\pulsar-ide-python\node_modules\atom-languageclient\build\lib\auto-languageclient.js:5:58)
mjrodgers commented 1 year ago

Okay, please test with the original ide-python and linter-ruff both disabled. Also you should uninstall pyls and try using the python-lsp-server (pylsp) instead of pyls, as it is actively maintained (and it also offers linting using ruff as a plugin for the lsp if that's what you prefer to use, you shouldn't need a separate Pulsar extension for this). Also, can you check the package settings? Which plugins are enabled?

Can you try this, and then we can see what is going on with the linting?

mjrodgers commented 1 year ago

I can confirm I have this issue also, the linting works on the 1.9.7 version but not the 1.10.1... I'll try to find the problem.

mjrodgers commented 1 year ago

Okay, I think I have the problem fixed in the newest version of pulsar-ide-python (1.10.3) (though I still recommend using pylsp instead of pyls). I see that while there is a ruff plugin for the pylsp server, I probably have to add some config options to make it available so i guess until I can get to that, linter-ruff is where to go if you want that (although in that case it will probably give duplicate warnings with pulsar-ide-python so you may want to disable some of those linters). thanks for reporting this, and please let me know if this doesn't fix the issue.

contang0 commented 1 year ago

Works fine now, thanks a lot! I have python-lsp-ruff enabled and linter-ruff disabled. It would be cool to have ruff options in the settings, however, the most canonical way of configuring it is the pyproject.toml file anyways.