microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.7k stars 768 forks source link

No parameter hints for gurobipy #1178

Closed jhelgert closed 2 years ago

jhelgert commented 3 years ago

Environment data

Expected behaviour

Bildschirmfoto 2021-04-21 um 13 32 13

(This is using the standard MS Python language server)

Actual behaviour

Bildschirmfoto 2021-04-21 um 13 29 16 Bildschirmfoto 2021-04-21 um 13 29 24

Logs

Python Language Server Log

[Info  - 1:33:20 PM] Pylance language server 2021.4.2-pre.1 (pyright 6410a8a2) starting
[Info  - 1:33:20 PM] Server root directory: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist
[Info  - 1:33:20 PM] Background analysis(1) root directory: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist
[Info  - 1:33:20 PM] Background analysis(1) started
[Info  - 1:33:20 PM] No configuration file found.
[Info  - 1:33:20 PM] Setting pythonPath for service "pylance_example": "/usr/local/bin/python3"
Search paths found for configured python interpreter:
  /usr/local/Cellar/python@3.9/3.9.2/Frameworks/Python.framework/Versions/3.9/lib/python3.9
  /usr/local/Cellar/python@3.9/3.9.2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload
  /Users/jonathan/Library/Python/3.9/lib/python/site-packages
  /usr/local/lib/python3.9/site-packages
  /usr/local/lib/python3.9/site-packages/cyipopt-1.0.0.dev0-py3.9-macosx-10.15-x86_64.egg
  /usr/local/lib/python3.9/site-packages/docloud-1.0.375-py3.9.egg
  /usr/local/lib/python3.9/site-packages/python_cpp_example-0.2-py3.9-macosx-10.15-x86_64.egg
  /usr/local/lib/python3.9/site-packages/DPQCQPv3-0.2-py3.9-macosx-10.15-x86_64.egg
  /usr/local/lib/python3.9/site-packages/pycombina-0.3.2-py3.9-macosx-10.15-x86_64.egg
  /usr/local/lib/python3.9/site-packages/pyDPQCQP-0.1-py3.9-macosx-10.15-x86_64.egg
  /usr/local/Cellar/pybind11/2.6.2/libexec/lib/python3.9/site-packages
  /usr/local/lib/python3.9/site-packages
[Warn  - 1:33:20 PM] stubPath /Users/jonathan/Documents/pylance_example/typings is not a valid directory.
[Info  - 1:33:20 PM] Assuming Python version 3.9
[Info  - 1:33:20 PM] Assuming Python platform Darwin
[Info  - 1:33:20 PM] Searching for source files
[Info  - 1:33:20 PM] Found 1 source file
Background analysis message: setConfigOptions
Background analysis message: ensurePartialStubPackages
Background analysis message: setTrackedFiles
Background analysis message: markAllFilesDirty
Background analysis message: setFileOpened
Background analysis message: analyze
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py ...
[BG(1)]   parsing: /Users/jonathan/Documents/pylance_example/test.py (21ms)
[BG(1)]   parsing: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 3ms] (95ms)
[BG(1)]   binding: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stdlib/builtins.pyi (32ms)
[BG(1)]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[BG(1)]   checking: /Users/jonathan/Documents/pylance_example/test.py ...
[BG(1)]     parsing: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stdlib/typing.pyi [fs read 1ms] (31ms)
[BG(1)]     binding: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stdlib/typing.pyi (11ms)
[BG(1)]     parsing: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi [fs read 1ms] (10ms)
[BG(1)]     binding: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi (1ms)
[BG(1)]     parsing: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stubs/typing-extensions/typing_extensions.pyi [fs read 0ms] (2ms)
[BG(1)]     binding: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stubs/typing-extensions/typing_extensions.pyi (1ms)
[BG(1)]     parsing: /usr/local/lib/python3.9/site-packages/gurobipy/__init__.py [fs read 0ms] (0ms)
[BG(1)]     binding: /usr/local/lib/python3.9/site-packages/gurobipy/__init__.py (1ms)
[BG(1)]   checking: /Users/jonathan/Documents/pylance_example/test.py (81ms)
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py (231ms)
Background analysis message: resumeAnalysis
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
[FG] parsing: /Users/jonathan/Documents/pylance_example/test.py (43ms)
[FG] parsing: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 3ms] (99ms)
[FG] binding: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stdlib/builtins.pyi (32ms)
[FG] binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
IntelliCode model /Users/jonathan/.vscode/extensions/visualstudioexptteam.vscodeintellicode-1.2.12/cache/E61945A9A512ED5E1A3EE3F1A2365B88F8FE_E4E9EADA96734F01970E616FAB2FAC19
Loading ONNX runtime...
Loaded ONNX runtime. Creating IntelliCode session...
Created IntelliCode session.
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:4:1 ...
[FG]   parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG]   binding: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG]   parsing: /usr/local/lib/python3.9/site-packages/gurobipy/__init__.py [fs read 1ms] (2ms)
[FG]   binding: /usr/local/lib/python3.9/site-packages/gurobipy/__init__.py (0ms)
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:4:1 [found 33 items] (11ms)
IntelliCode: current invocation did not produce any meaningful tokens.
Time taken to get recommendations: 3 ms, Memory increase: 60 KB.
[FG] parsing: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stdlib/typing.pyi [fs read 2ms] (44ms)
[FG] binding: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stdlib/typing.pyi (16ms)
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:4:5 ...
[FG]   parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:4:5 [found 47 items] (4ms)
IntelliCode: current invocation did not produce any meaningful tokens.
Time taken to get recommendations: 1 ms, Memory increase: 30 KB.
[FG] parsing: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi [fs read 2ms] (14ms)
[FG] binding: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi (2ms)
[FG] parsing: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stubs/typing-extensions/typing_extensions.pyi [fs read 0ms] (3ms)
[FG] binding: /Users/jonathan/.vscode/extensions/ms-python.vscode-pylance-2021.4.2-pre.1/dist/typeshed-fallback/stubs/typing-extensions/typing_extensions.pyi (1ms)
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:4:6 ...
[FG]   parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:4:6 [found 26 items] (4ms)
IntelliCode: current invocation did not produce any meaningful tokens.
Time taken to get recommendations: 0 ms, Memory increase: 27 KB.
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:4:7 ...
[FG]   parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:4:7 [found 12 items] (4ms)
IntelliCode: current invocation did not produce any meaningful tokens.
Time taken to get recommendations: 1 ms, Memory increase: 33 KB.
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
[FG] parsing: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] parsing: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: analyze
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py ...
[BG(1)]   parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[BG(1)]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[BG(1)]   checking: /Users/jonathan/Documents/pylance_example/test.py (5ms)
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py (6ms)
Background analysis message: resumeAnalysis
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: analyze
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py ...
[BG(1)]   parsing: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[BG(1)]   binding: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[BG(1)]   checking: /Users/jonathan/Documents/pylance_example/test.py (3ms)
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py (4ms)
Background analysis message: resumeAnalysis
[FG] parsing: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] binding: /Users/jonathan/Documents/pylance_example/test.py (1ms)
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:1 ...
[FG]   parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:1 [found 61 items] (4ms)
IntelliCode: current invocation did not produce any meaningful tokens.
Time taken to get recommendations: 1 ms, Memory increase: 43 KB.
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: analyze
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py ...
[BG(1)]   parsing: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[BG(1)]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[BG(1)]   checking: /Users/jonathan/Documents/pylance_example/test.py (5ms)
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py (6ms)
Background analysis message: resumeAnalysis
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:2 ...
[FG]   parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:2 [found 0 items] (6ms)
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:3 ...
[FG]   parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:3 [found 0 items] (6ms)
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:5 ...
[FG]   parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:5 [found 0 items] (4ms)
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:6 ...
[FG]   parsing: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:6 [found 0 items] (5ms)
Background analysis message: analyze
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py ...
[BG(1)]   parsing: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[BG(1)]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[BG(1)]   checking: /Users/jonathan/Documents/pylance_example/test.py (4ms)
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py (5ms)
Background analysis message: getDiagnosticsForRange
Background analysis message: resumeAnalysis
Background analysis message: getDiagnosticsForRange
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:7 ...
[FG]   parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:7 [found 0 items] (4ms)
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:8 ...
[FG]   parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:8 [found 0 items] (4ms)
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:9 ...
[FG]   parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[FG] completion at /Users/jonathan/Documents/pylance_example/test.py:6:9 [found 0 items] (5ms)
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG] binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
Background analysis message: analyze
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py ...
[BG(1)]   parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[BG(1)]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[BG(1)]   checking: /Users/jonathan/Documents/pylance_example/test.py (5ms)
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py (6ms)
Background analysis message: getDiagnosticsForRange
Background analysis message: resumeAnalysis
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
[FG] parsing: /Users/jonathan/Documents/pylance_example/test.py (1ms)
[FG] binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
Background analysis message: analyze
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py ...
[BG(1)]   parsing: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[BG(1)]   binding: /Users/jonathan/Documents/pylance_example/test.py (0ms)
[BG(1)]   checking: /Users/jonathan/Documents/pylance_example/test.py (4ms)
[BG(1)] analyzing: /Users/jonathan/Documents/pylance_example/test.py (4ms)
Background analysis message: resumeAnalysis
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange

Code Snippet / Additional information

from gurobipy import Model

m = Model()
jakebailey commented 3 years ago

gurobipy appears to be a compiled module without any type information (and additionally is proprietary). For this to work, the library would need to ship type stubs, or someone would have to write type stubs for it externally.

RATCOinc commented 2 years ago

Gurobi has provided the required stubs, available at the following links: https://pypi.org/project/gurobipy-stubs/ https://github.com/Gurobi/gurobipy-stubs