richterger / Perl-LanguageServer

Language Server for Perl
Other
220 stars 53 forks source link

WIP: Add inline get-port.ts file #140

Closed hakonhagland closed 2 years ago

hakonhagland commented 2 years ago

(Note: this PR includes #139 which should be merged first)

Converted get-port.js from sindresorhus/get-port to typescript and added it to the src folder.

This was done in order to try work around the problem with ESM modules and import from VS Code as described in issue #116

In order to compile the typescript files you will also have to update the package @types/node to version 14.

I am adding this PR as WIP (work-in-progress) since this does not work for me yet. It seems like I always get the same port for some reason.

hakonhagland commented 2 years ago

This works for me now after the last commit. The problem was that config.get('debugAdapterPort') always returned 13603, so getPort() never got a chance to update the port number.

richterger commented 2 years ago

Thanks for your pull request. I have taken your ideas and some of your code an integrated it into extentions.ts. See commit 0fabd96215814f0aad18cc7bbea84dc10a83d67b