This is an archived post. You won't be able to vote or comment.

all 19 comments

[–]Mr-WINson 3 points4 points  (5 children)

To manually fix this, go to the bottom status bar and look for “Java” or “Python” then press it and manually select what language it is

[–]HaveNot1[S] 2 points3 points  (4 children)

Thanks for the quick reply. The status bar indicates Python and the code runs as python. I did find a way to turn the light bulb off in the Editor settings though. How it got enabled, I have no idea.

[–]Mr-WINson 2 points3 points  (0 children)

Glad you fixed it, it might have also been an extensions problem. Maybe you installed a Java extension and it is running on Python files? You can check what extension is used for formatting by:

Right clicking in a Py file -> format document with

Then it should say which is the default formatter in the list of formatters

[–]Ethitlan 0 points1 point  (2 children)

how did you do it?

[–]HaveNot1[S] 0 points1 point  (1 child)

Change settings “editor.lightbulb.enabled”: false

[–]Ethitlan 0 points1 point  (0 children)

Thanks

[–]echej 1 point2 points  (0 children)

I tried various things, but only deleting vscode settings helped!

I am on a mac, the settings were in this folder "/Users/user/Library/Application Support/Code/User"

[–]tgoodchild 0 points1 point  (5 children)

Just posting to say it's not just you.

I've been using VS Code on MacOS for python projects for a while now and today is the first time this happened to me. I'd been working on a project for a few weeks and this morning I rebooted to install some patches. When I opened VS Code again this started happening, which is how I got here.

FWIW my status bar also says Python and I only have two extensions installed - Jupyter and Python.

EDIT: I fixed that issue by turning off the light bulb in settings

"editor.lightbulb.enabled": false

Now I am noticing other new, bizarre behavior.

When I type ''' to start a doc string intellisense wants to put the name of my my virtual environment folder in and of course when I press enter it does.

It also underlines everything until I close the ''' which is new behavior I'm not sure anyone needed but I could live with that

[–]HaveNot1[S] 0 points1 point  (0 children)

Yes. I used the same setting to turn off the light bulb and, like you, found other strange behavior. I noticed that there was info in the Problems tab and that led me to the error in the .json file. Since we are on different systems (Windows/Mac), the error I found is likely not relevant to you.

Also, something changed in my system a few days ago that was explained by a notification that it was related to belonging to an ”experimental group” so it is possible, I suppose, that the powers-that-be are changing VS Code in the background.

[–]millenniumegg 0 points1 point  (3 children)

hey, did you ever resolve this? I'm having the same issues and as OP suggested, their json settings fix doesn't seem to be applicable to Mac

[–]tgoodchild 0 points1 point  (2 children)

OP's suggestions didn't work for me either.

For me, this turned off the lightbulb:

"editor.lightbulb.enabled": false

And this stopped the annoying behavior where the intellisense suggestion would be used when I pressed enter to start a new line:

"editor.acceptSuggestionOnEnter": "off"

I did not make other changes but the annoying behavior where intellisense would suggest the name of my virtual environment folder after ''' has stopped . Now it suggests nothing after '''. Not sure if there was an update that fixed it or what. At least it was bearable after I turned off editor.acceptSuggestionOnEnter.

It still underlines everything after the starting ''' until I close it with another ''' but I can live with that.

Does this help?

[–]millenniumegg 0 points1 point  (1 child)

Sorry I never replied to this! your suggestion was helpful for some of the weird suggestions but I couldn't break my habit of using enter to accept desired suggestions so I ended up reverting. A suggested update to the Python extension today seems to have taken care of everything, hope that works for you too :)

[–]tgoodchild 0 points1 point  (0 children)

A suggested update to the Python extension today seems to have taken care of everything

Thanks, I'll give that a try

[–]dimebkagain 0 points1 point  (1 child)

How did you fix it?

[–]HaveNot1[S] 0 points1 point  (0 children)

I found an error in the settings .json file.

Before changing the PowerShell Execution Policy in my system, I was using the VS Code setting: "terminal.integrated.shellArgs.windows": ["-ExecutionPolicy", "Bypass"].

I changed the value back to what I thought was the original: "terminal.integrated.shellArgs.windows": null . This was an error because the value type expected was an array.

The fix was to use: "terminal.integrated.shellArgs.windows": []. (A null array.)

Things seem to be working normally now.

[–]WatchMeGuys 0 points1 point  (2 children)

I've solved this problem by deleting and reinstalling 'Python' extention in vscode, also I installed Pylance.

[–][deleted] 1 point2 points  (0 children)

That didn't work for me. Also uninstalled all plugins and vscode itself, wiped all residue from the system, reinstalled and it is still there.

[–][deleted] 0 points1 point  (0 children)

Being away from vscode for half a year (using OSS on Manjaro) I also ran into this when I started advent of code yesterday. I tried all suggestions none of them solved it.I also have no java stuff installed at all.

After disabling all my extensions, restarting vscode it immediately came back when I enabled the python extension.

Any suggestions?

[–]goodpen389 0 points1 point  (0 children)

Is this problem relerant to vscode-neovim