perl-language-server icon indicating copy to clipboard operation
perl-language-server copied to clipboard

Non file:// schema URIs cause server crash

Open FractalBoy opened this issue 1 year ago • 0 comments

https://github.com/FractalBoy/perl-language-server/blob/77584351bc7a1875c8ba5cebb229fc004ca848fe/server/lib/PLS/Server/Request/Initialize.pm#L38C5-L38C78

There are scenarios where the URIs in a workspace are not file based (file:// schema), which causes this line of code to crash.

We can't really do anything with non-file URIs so we should just filter them out.

Something like this:

@{$workspace_folders} = map { $_->file } grep { $_->can('file') } map { URI->new($_) } @{$workspace_folders};

FractalBoy avatar Jan 09 '24 18:01 FractalBoy