Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Locally disable warnings of Python Language Server in Visual Studio Code

I have recently installed Python Language Server in Visual Studio Code.

I sometimes have some warnings that I want to locally disabled

For example, let's assume I have the following code:

import org.sikuli.script.SikulixForJython
from sikuli.Sikuli import *
from guide import *

It is normally run from Sikulix, which uses Jython libraries. Since my favorite editor cannot load this module, it would raise a warning:
unresolved import 'org.sikuli.script.SikulixForJython' Python(unresolved-import)

With pylint, I can disable that warning for only these 3 lines with something like:

# pylint: disable=unresolved-import
import org.sikuli.script.SikulixForJython
from sikuli.Sikuli import *
from guide import *
# pylint: enable=unresolved-import

How to do something similar with Python Language Server?

Thanks

like image 248
Jean-Francois T. Avatar asked Mar 25 '19 10:03

Jean-Francois T.


1 Answers

There's currently no support for per-line warning suppression. To request such a feature, please open an issue at https://github.com/microsoft/python-language-server.

like image 146
Brett Cannon Avatar answered Sep 30 '22 21:09

Brett Cannon