microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.32k stars 1.18k forks source link

Time to retrieve the Interpreter Information is to short #7841

Closed anmiro closed 5 years ago

anmiro commented 5 years ago

Environment data

Expected behaviour

Enough time to retrieve the interpreter informations properly. Should be a configurable value.

Actual behaviour

After 5s the process will be canceled with the return value --- Timed Out --- which leads to an exception.

Steps to reproduce:

Set our Interpreter as Standard and wait till the timeout will occur

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Error Python Extension: 2019-10-09 12:22:25: Failed to parse interpreter information for 'C:\Program Files\Schneider Electric\EcoStruxure Machine Expert\V1.1\LogicBuilderShell.exe' with JSON --timed out-- [SyntaxError: Unexpected number in JSON at position 1
    at JSON.parse (<anonymous>)
    at PythonExecutionService.getInterpreterInformation (d:\python-vscode\vscode-python\out\client\common\process\pythonProcess.js:44:29)]
rchiodo commented 5 years ago

What's the exception that occurs after the timeout? This looks to me like it's working as expected. That executable isn't a python executable, can it run python files?

anmiro commented 5 years ago

What's the exception that occurs after the timeout?

It´s the standard exception that no interpreter was set. The exception above appears in the debug output of the extension.

This looks to me like it's working as expected. That executable isn't a python executable, can it run python files?

Yes, the LogicBuilderShell.exe wraps an IronPyhon 2.7.x based interpreter and adds some additional objects and a runtime/compiler for machine programming (IEC 61131 languages). Its one of the tools of Schneider Electric´s Machine Expert Our customers are able to automate a lot of tasks/create new projects/code or even unit test machine code with this python interface and they love to use Visual Studio Code and the Python Extension to develop their scripts. Unfortunately our interpreter is not fast enough to deliver the information needed by the extension.

brettcannon commented 5 years ago

After discussing this feature request on the team we have unfortunately decided we will not be accepting the PR or trying to implement it. There isn't enough widespread need for this to warrant the maintenance cost for the feature. Thanks for bringing up the idea, @anmiro .