Skip to content
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

It unhighlights everything #6442

Closed
debonte opened this issue Sep 24, 2024 · 12 comments
Closed

It unhighlights everything #6442

debonte opened this issue Sep 24, 2024 · 12 comments
Assignees
Labels
user responded Was "waiting for user response" and they responded

Comments

@debonte
Copy link
Contributor

debonte commented Sep 24, 2024

From Marketplace review:

Ss Sh
WTF is this extension it unhighlights everything ...confusing and unnecessary not to mention useless

@debonte debonte added the skip-reassign Optional label that tells the issue automation bot to not reassign the owner label Sep 24, 2024
@debonte debonte self-assigned this Sep 24, 2024
@debonte debonte added waiting for user response Requires more information from user and removed skip-reassign Optional label that tells the issue automation bot to not reassign the owner labels Sep 24, 2024
@zhangxiwensjtu
Copy link

zhangxiwensjtu commented Oct 11, 2024

Here is an example.
It used to be like this:
Image
but now it looks like this:
Image

And also, in the function, there is no highlight:
Image

@rchiodo
Copy link
Contributor

rchiodo commented Oct 11, 2024

That likely means the extension is not running. Can you include any output in the 'Python Language Server' tab?

@debonte
Copy link
Contributor Author

debonte commented Oct 11, 2024

Can you check if Pylance is both installed and enabled? When Pylance is unavailable, the Python extension will use Jedi as the Python language server instead of Pylance.

If Pylance is installed and enabled, please provide your "Python Language Server" log from the Output pane.

I'm able to reproduce the same behavior by disabling the Pylance extension:
Image

And then when I re-enable it, I see this:
Image

Another way to check which language server you're using would be to mouse over add_args. Jedi shows this:
Image

whereas Pylance shows this:
Image

@github-actions github-actions bot added user responded Was "waiting for user response" and they responded and removed waiting for user response Requires more information from user labels Oct 11, 2024
@debonte debonte added waiting for user response Requires more information from user and removed user responded Was "waiting for user response" and they responded labels Oct 11, 2024
@zhangxiwensjtu
Copy link

Python Language Server" lo

Hi, sorry for the late reply.
I have enabled Pylance:
Image

And here is the Python Language Server output:
Image

When I put my mouse over functions, it shows "Loading...", it maybe some Vscode bug? No matter how long I wait, it stays "Loading..."
Image

@debonte
Copy link
Contributor Author

debonte commented Oct 14, 2024

That sounds like Pylance either crashed or is hung. Is the log output that you included above the complete log? Does this only happen in certain projects? For example, if you open a new, empty folder in VS Code and create a new Python file there, does the issue still occur?

@github-actions github-actions bot added user responded Was "waiting for user response" and they responded and removed waiting for user response Requires more information from user labels Oct 14, 2024
@debonte debonte added waiting for user response Requires more information from user and removed user responded Was "waiting for user response" and they responded labels Oct 14, 2024
@zhangxiwensjtu
Copy link

That sounds like Pylance either crashed or is hung. Is the log output that you included above the complete log? Does this only happen in certain projects? For example, if you open a new, empty folder in VS Code and create a new Python file there, does the issue still occur?

Yes! I tried to create a new repo and find Pylance works well in that new repo! Any clues on how to restart Pylance in certain project ? I tried to uninstall and reinstall it, but it doesn't work.

@debonte
Copy link
Contributor Author

debonte commented Oct 15, 2024

Can you share the project where you're seeing this?

@github-actions github-actions bot added user responded Was "waiting for user response" and they responded and removed waiting for user response Requires more information from user labels Oct 15, 2024
@zhangxiwensjtu
Copy link

Can you share the project where you're seeing this?

Sorry, I can't make the project code public.

Here are a few possible reasons I suspect for the issue:

  1. I tried running the command du -h --max-depth=1 in the project directory and found that the .venv folder is quite large. I'm not sure if this affects the functioning of Pylance.
  2. There's a symbolic link in my project directory that points to a model weight file of 100GB in size.
    I suspect that these large files might be causing Pylance to malfunction.
    So I tried to create a .vscode/pyrightconfig.json file under the .vscode folder. The content is as following:
    Image

Then I restarted Python Language Server, and here is the complete log:
Image
It says: The existing extension didn't exit within 10 seconds. New instance will start, but you might encounter issues.

I'm confused about it, since I've already added the symbolic link and .venv path to the pyrightconfig.json.

@GF-Huang
Copy link

Same issue due to the latest update.

Image

And, Restart language server failed.

Image

@GF-Huang
Copy link

When I downgrade to v2024.9.2, all things works well.

@zhangxiwensjtu
Copy link

finally I solve this problem.
For me, the lack of syntax highlighting and navigation isn't due to a Pylance version issue, but rather because my VSCode workspace contains too many files. Even though I set up a pyrightconfig.json file to ignore those large folders, I discovered that the pyrightconfig.json file wasn't actually working. When I started VSCode, the Python language server still reported a timeout error when scanning files. Finally, I found that setting the exclude file paths in this specific location resolved the issue.

Image
reference : https://github.com/microsoft/pylance-release/wiki/Opening-Large-Workspaces-in-VS-Code

@judej
Copy link
Contributor

judej commented Oct 17, 2024

@zhangxiwensjtu, glad you found that the wiki was helpful. Appreciate the update.

@GF-Huang, would you please check if this fixes your issue too? If not, would you please create a new issue and add the information in the report as described in the troubleshooting guide?

@judej judej closed this as completed Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user responded Was "waiting for user response" and they responded
Projects
None yet
Development

No branches or pull requests

5 participants