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

Type-checking does not work #62

Closed
GammaGames opened this issue Jul 6, 2020 · 2 comments
Closed

Type-checking does not work #62

GammaGames opened this issue Jul 6, 2020 · 2 comments

Comments

@GammaGames
Copy link

Environment data

  • Language Server version: 0.5.51.0
  • OS and version: Linux x64 5.3.0-62-generic
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.9

Expected behaviour

I have added "python.analysis.typeCheckingMode": "strict" to my settings.json file and it should show type checking. I have also tried the "basic" setting. This is what pyright looks like:
image
image

Actual behaviour

It does not:
image

Logs

[Info  - 12:38:27 PM] Microsoft Python Language Server version 0.5.51.0
[Info  - 12:38:27 PM] Workspace root: 
[Info  - 12:38:28 PM] GetCurrentSearchPaths /usr/bin/python3 
[Info  - 12:38:28 PM] Interpreter search paths:
[Info  - 12:38:28 PM]     /usr/lib/python3.6
2020-07-06 11:38:29.088963488 [W:onnxruntime:, graph.cc:814 Graph] Initializer embeddings_matrix:0_quantized appears in graph inputs and will not be treated as constant value/weight. This may fail some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.
2020-07-06 11:38:29.089008350 [W:onnxruntime:, graph.cc:814 Graph] Initializer embeddings_matrix:0_scale appears in graph inputs and will not be treated as constant value/weight. This may fail some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.
2020-07-06 11:38:29.089017140 [W:onnxruntime:, graph.cc:814 Graph] Initializer embeddings_matrix:0_zero_point appears in graph inputs and will not be treated as constant value/weight. This may fail some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.
2020-07-06 11:38:29.089026287 [W:onnxruntime:, graph.cc:814 Graph] Initializer fixed_quantization_range_uint8 appears in graph inputs and will not be treated as constant value/weight. This may fail some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.
2020-07-06 11:38:29.089036869 [W:onnxruntime:, graph.cc:814 Graph] Initializer fixed_zero appears in graph inputs and will not be treated as constant value/weight. This may fail some of the graph optimizations, like const folding. Move it out of graph inputs if there is no need to override it, by either re-generating the model with latest exporter/converter or with the tool onnxruntime/tools/python/remove_initializer_from_input.py.
[Info  - 12:38:29 PM]     /usr/lib/python3.6/lib-dynload
[Info  - 12:38:29 PM]     /home/jlieberg/.local/lib/python3.6/site-packages
[Info  - 12:38:29 PM]     /usr/local/lib/python3.6/dist-packages
[Info  - 12:38:29 PM]     /usr/lib/python3/dist-packages
[Info  - 12:38:29 PM] User search paths:
[Info  - 12:38:29 PM] Initializing for /usr/bin/python3
[Info  - 12:38:29 PM] Analysis caching mode: None.
Opening document file:///home/jlieberg/Downloads/test.py
Analysis of test (User) queued. Dependencies: 
Analysis version 1 of 1 entries has started.
Analysis of test (User) on depth 0 completed in 20.01 ms.
Indexing libraries.
Analysis complete: 1 modules in 71.06 ms.
Analysis version 1 of 1 entries has been completed in 32.46 ms.

Code Snippet / Additional information

class Point():
    def __init__(self, x: float, y: float):
        self.x = x
        self.y = y


def test():
    p = Point(1.0, "1.0")
    print(p)


test()

Also, is this extension designed to replace some of the features of the older Python extension? It seems like there's some overlap but I'm not 100% sure what the goal of this extension is.

@GammaGames GammaGames changed the title Cannot get extension to work Type-checking does not work Jul 6, 2020
@huguesv
Copy link
Contributor

huguesv commented Jul 6, 2020

Thanks for including the log, it shows that it is starting the old Microsoft Python Language Server, not Pylance.

You'll need to install the Pylance extension for VS Code. The main vscode-python extension you linked to is still needed, Pylance extension will install it if needed.

After that, see #16 (comment)

@GammaGames
Copy link
Author

GammaGames commented Jul 7, 2020

I added "python.languageServer": "Pylance" to my settings it the "Python Language Server" output is now empty (even with "python.analysis.logLevel": "Trace").

Edit: I restarted a few more times and it appears to be working now, that was strange.

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

No branches or pull requests

2 participants