Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code - Python - List Index Limit Max 300 - Debugger

I have a list contains several hundred entries. I think the total size of the list is 3.5 MB.

When debugging an issue I can't seem to view any entry passed 300 and I see this message 'Too large to show contents. Max items to show: 300'

Any ideas?

Enter image description here

like image 907
agleno Avatar asked May 27 '19 10:05

agleno


People also ask

How do I enable Python debugger in Visual Studio Code?

If you're only interested in debugging a Python script, the simplest way is to select the down-arrow next to the run button on the editor and select Debug Python File in Terminal.

Can I debug python in Visual Studio?

Python in Visual Studio supports debugging without a project. With a stand-alone Python file open, right-click in the editor, select Start with Debugging, and Visual Studio launches the script with the global default environment (see Python environments) and no arguments.


2 Answers

You want to find a file named pydevd_resolver.py under your Visual Studio Code workspace directory (you can find it with Bash this command: find / -name pydevd_resolver.py 2>/dev/null).

Open the file, and inside it look for a constant definition: MAX_ITEMS_TO_HANDLE = 300. You can change this number to whatever you like, but please note this will of course consume more resources, so be careful with this.

Just for the sake of completion, I paste the note provided above this definition in pydevd_resolver.py itself:

Note: 300 is already a lot to see in the outline (after that the user should really use the shell to get things) and this also means we'll pass less information to the client side (which makes debugging faster).

like image 53
Adam.Er8 Avatar answered Oct 09 '22 06:10

Adam.Er8


For the windows!

You can edit that file, pydevd_resolver.py, at:

USER_NAME\.vscode\extensions\ms-python.python-2021.3.680753044\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle

It works for me.

like image 26
Quang Vu Tran Avatar answered Oct 09 '22 06:10

Quang Vu Tran