-
Notifications
You must be signed in to change notification settings - Fork 325
Autocompletion and function help not working in FreeBSD with Pylance #7459
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
Comments
@Huskers2020 Thanks for filing a bug. Would you mind checking whether this bug repros in the latest version of VS Code (1.60) and extensions? |
Version 1.60 has not yet been ported to FreeBSD, so cannot comment. I did check my ArchLiux install and it works with 1.56 before upgrading it to 1.60 |
Seems like this is a general Pylance issue -- not supporting FreeBSD. Please assign back if it's something on our end. |
Where did you see the message?
There shouldn't be any reason why we don't work on FreeBSD, other than that typeshed doesn't recognize or test anything other than the major three platforms. The only compiled code we have is for IntellICode, which should gracefully fail to load, and can be tested pretty easily by not having IC installed. "command 'python.analysis.restartLanguageServer' already exists." is from the Python extension, and is more an artifact of how language servers work there; you have to reload the editor when you change LSs (though this particular message should not appear). |
The error output (No native build was found for paltform=freebsd arch=x64 runtime=electron abi=87 uv=1 libc=glibc) When the mouse is moved over the code - the error "command 'python.analysis.restartLanguageServer' already exists." starts showing up under juptyer output. This is after multiple relaunches - with language server setting set to "Pylance" in both user and workspace |
On playing around with the install and on checking different combinations of launch it seems the issue starts with pylance extension not being installed completely even though the extension shows it has been installed correctly. I cannot check for version 1.6 as it has not been ported to FreeBSD. If I were to follow 131232 and try to install the extension manually it fails on version check. This error does not show up on install directly from extensions on the IDE |
As far as I can tell, there are no official builds of VS Code for FreeBSD, and Pylance does not support unofficial builds and won't run on one. You should be using JediLSP instead, though the message about the command existing is likely an artifact of some code in the Python extension that only knows about Pylance getting disabled too late. Those are likely covered by the two issues you linked in the original issue: microsoft/vscode-python#13474 microsoft/vscode-python#13441 The rest all appears to be coming from the Jupyter extension, and happens regardless of the language server choice. |
Apologies for the double transfer, clicked the wrong |
The jupyter errors are benign. It means there's no ZMQ support for FreeBSD. We'll still run without it. Anything else seems to already be covered by what Jake said. |
I did restart the IDE and the IDE also pop up a notification at lower right corner suggesting "reload" |
s
The issue I notice is JediLSP by itself does not work in the Jupyter notebook and for auto-completion to work Pylance has to be installed. Post-installation one has to follow the steps that I have outlined above to make it work. This is a nuance one has to go through every time IDE is launched. The same JediLSP works on python code flawlessly. |
ZMQ libs are available, and I noticed it got installed. After a little research, I could gather the issue is with the installation of Pylance extension. A little digging under output logs (Python), I now see a message buried in indicating "ms-python.vscode-pylance not installed" though the IDE shows it as installed. Pylance and Python Language Server logs are empty when set to Pylance. So even though the IDE shows properties related to Pylance in IDE, indicating the installation was successful and complete but in reality, it is not complete. I tried to install it manually, and it failed due to version differences(refer to my note above). Not sure how the IDE is installing it and marking the installation as complete and successful. I did check Pylance on Arch Linux with ver 1.56, and it did work (before upgrading to 1.60). On FreeBSD, 1.60 is yet to be ported, so I can only validate it against 1.56. If there is the possibility to force the installation of this extension manually on FreeBSD, do let me know, and I will give it a try. For now, I highly suspect the installation is the issue. |
Environment data
I'm not sure if this extension supports FreeBSD; I believe it should work if my understanding is incorrect. My apologies.
I have also provided steps on how to get JediLSP working for anyone interested; I cannot comment if this was working before with Jupyter as JediLS does work flawlessly with Python on FreeBSD.
Actual behavior
1 - Pylance LS does not recognize FreeBSD as an OS platform and fails on startup
[Error: No native build was found for paltform=freebsd arch=x64 runtime=electron abi=87 uv=1 libc=glibc ..
2- On setting to JediLSP, the LS starts and fails with error:-
[Error: command 'python.analysis.restartLanguageServer' already exists.
There was an issue logged last year and was addressed, but this issue still prevails on FreeBSD - 13441 & 13474
Workaround to make JediLSP work:-
To make JediLSP work set the language server to "JediLSP" and open "JSON" settings in VSCode along with a python code on the side.
Close VSCode
Open VSCode and let all the initialization of Jupyter and Language Server complete. (Review Jupyter output logs to check there are no errors except for the first error on the platform.)
Open an existing Jupyter notebook and watch the Jupyter output log; there should be no errors.
Move your mouse over Jupiter notebook cell python code and watch help info pop up.
In a new cell, type python code and watch autocompletion work.
For the above to work, I had commented out the following in my JSON settings -
"jupyter.experiments.optOutFrom": ["NativeNotebookEditor"],
Note:- I did notice at times there was lag; restarting VSCode resolved the issue.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
The text was updated successfully, but these errors were encountered: