1

I’m using VScode to develop a Django web application on the next environment:

• OS and Version: Windows 10

• VS Code Version: 1.52.2

• Python Extension Version: v2021.5.842923320

• Remote – SSH Version: v0.65.4

From my Windows laptop, I work on an Ubuntu 20.04 VM using the Remote – SSH plugin, So I have configured a python3.9 virtual environment with Django3.2 and others python packages. Also, I have pylint installed and all works as expected.

The issue arises when I mount a folder inside the application media folder (inside the workspace) from another station through sshfs. What happens is that autocomplete stops working and when y press Clr+Space I just get a loading message.

Note that this folder that I mount through sshfs is very big more than 1 TB with many files including python scripts and also I note that even when I close the VScode I cannot unmount this folder because the fusermount said that the folder is used by some process (I guess is the VScode process inside the VM). After all, if I don’t open the VScode I'm able to mount and unmount this folder without a problem.

I have also excluded this media folder using the "files.exclude" and "files.watcherExclude" but the issue persists.

There is someone who has had this issue before or some similar problem. I would appreciate any suggestions.

[Update] Even using files.exclude, serach.exclude or not, the Intellisence works fine for a while if I mount the folder after open VScode. But if I close and reopen the Vscode the intellisence stops work. The same issue if I mount the folder before open the VScode.

[Update2] Python language sever OUTPUT panel

Best Regards.

Javier
  • 41
  • 8

2 Answers2

2

creating a "pyrightconfig.json" at the root of the workspace, and adding the exclude solve the issue https://github.com/microsoft/pyright/blob/main/docs/configuration.md#main-pyright-config-options

{"exclude": ["**/application/media"]}
Javier
  • 41
  • 8
0

You should take search.exclude instead of files.exclude.

  // Configure glob patterns for excluding files and folders in fulltext searches and quick open. Inherits all glob patterns from the `files.exclude` setting.
  "search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true,
    "**/*.code-search": true
  },

  // Configure glob patterns for excluding files and folders. For example, the file Explorer decides which files and folders to show or hide based on this setting. Refer to the `search.exclude` setting to define search specific excludes.
  "files.exclude": {
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/CVS": true,
    "**/.DS_Store": true
  },

The official docs

Update:

Which Language Server are you using? Pylance?, Jedi?. Could you try to switch the Language Server?

And could you have a look at these panles?

enter image description here

Update2:

Can you try to upgrade the Python extension? And if it doesn't work, can you try to downgrade the node version to 12? You can refer to this page.

Steven-MSFT
  • 7,438
  • 1
  • 5
  • 13
  • thanks for your answer, but it doesn’t work. The issue persists. I already knew about `search.exclude` but as I understand this option inherits all the paths specified on `files.exclude`. that’s why I thought that just use `files.exclude` for this could be enough. I putted an update end what really is happening – Javier Jun 08 '21 at 10:54
  • @Javier hi, could you look into the update? – Steven-MSFT Jun 09 '21 at 08:41
  • I'm using Pylance, and I get an error on the output panle for Python Language Server. I will share it on top question. – Javier Jun 09 '21 at 11:28
  • I don't have the VS IntelliCode entry like you. I will try to switch to Jedi? I realy appreciate you help on this. Thanks! – Javier Jun 09 '21 at 11:40
  • @Javier Can you try to downgraded Pylance to 2021.5.4? And it should be fixed in the next version. You can refer to here:https://github.com/microsoft/pylance-release/issues/1397. – Steven-MSFT Jun 09 '21 at 12:52
  • It was not solved with the Pylance downgraded and also I tried with Jedi and the issue persist. this is driving me insane, because when I mount another folder that contain a few data , everything works fine. The problem is with that huge folder. – Javier Jun 09 '21 at 14:27
  • @Javier hi, can you have a look at the update? – Steven-MSFT Jun 10 '21 at 02:17
  • @Javier Hi friend, have you solved the problem? – Steven-MSFT Jun 29 '21 at 14:39
  • Hi, no, I'm working without mount this folder. Seems to me that the issue is more releate with some specific type of files inside that folder than the amount of files. After investigating and investigating and not finding a solution I have already given up – Javier Jul 01 '21 at 08:13