richterger / Perl-LanguageServer

Language Server for Perl
Other
222 stars 53 forks source link

JSON parsers recursion depth #65

Closed franklx closed 2 years ago

franklx commented 3 years ago

Extension in vscode panics opening a project of about 50 perl files:

json text or perl structure exceeds maximum nesting level (max_depth set too low?) at /usr/local/share/perl/5.30.0/Perl/LanguageServer/Parser.pm line 487.

I fixed it modifying json max_depth in LanguageServer.pm

our $json = JSON -> new -> utf8(1) -> max_depth(10240) -> ascii(1) ;

A plugin option to set the value could be useful or maybe is fine hardcoding it with an high value (like I did). 4096 was too low for my case so I set 10240.

richterger commented 3 years ago

I normally use the LanguageServer with many thousend files. It would be great if you can find out which of your 50 files are causing this issue, so we can investigate further.