简体   繁体   English

Visual Studio Code - 即使安装了 Intellisense,它也无法在 SSH 服务器上运行

[英]Visual Studio Code - Intellisense not working on SSH server even though it's installed

So for some reason my intellisense is not working.因此,出于某种原因,我的智能感知无法正常工作。

I tried the solutions suggested here Visual Studio Code: Intellisense not working .我尝试了此处建议的解决方案Visual Studio Code: Intellisense not working

The solution that seems to help most people is adding "python.autoComplete.extraPaths": [ "${workspaceFolder}/customModule" ] , didn't work.似乎对大多数人有帮助的解决方案是添加"python.autoComplete.extraPaths": [ "${workspaceFolder}/customModule" ] ,但没有用。 Also VS Code says it doesn't recognize python.pythonPath when I add it. VS Code 还说当我添加它时它无法识别python.pythonPath

Auto-complete not working, screen capture didn't capture my cursor, but it's right after argparse.自动完成不起作用,屏幕截图没有捕捉到我的 cursor,但它就在argparse. , which should give the option to auto-complete with a list that includes: ArgumentParser : ,它应该提供自动完成列表的选项,其中包括: ArgumentParser

Remote server installed extensions:远程服务器安装的扩展:
在此处输入图像描述

Settings.json This is settings.json on remote server Settings.json这是远程服务器上的settings.json

{
    "remote.autoForwardPortsSource": "output",
    "python.languageServer": "None",
    "python.analysis.completeFunctionParens": true,
    "python.analysis.diagnosticMode": "workspace",
}

Setup:设置:

  • Running using Conda env使用 Conda 环境运行
  • Linux remote server Linux 远程服务器

Note: Something else off is my "find declaration of function or class" is also not working.注意:还有其他问题是我的“查找 function 或类的声明”也不起作用。

the first solutions are kind of obvious, but ill add them anyway,第一个解决方案有点明显,但无论如何我都会添加它们,

  1. Removing reinstalling it both locally and remotely删除本地和远程重新安装它
  2. Make sure VS code is updated to its last version确保 VS 代码更新到最新版本
  3. In settings.json , set a language server in "python.languageServer" .settings.json ,在"python.languageServer"中设置一个语言服务器。 The Language Server includes: Jedi (build-in Python extension ), Microsoft , Pylance , since you have already installed Pylance , let's start with that one (if that doesnt work, try the others). Language Server 包括: Jedi (内置 Python 扩展名)、 MicrosoftPylance ,既然您已经安装了Pylance ,那么让我们从那个开始吧(如果不起作用,请尝试其他)。
  4. set your python.pythonPath to the path returned in your terminal for which python3将您的python.pythonPath设置为在您的终端中返回的路径, which python3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM