You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
update the "setup_runtime_dependencies" method to ensure that the environment is setup for executing the language server binary. You can download/install the binaries in this method. Please store all URLs in the file <target_ls_name>/runtime_dependencies.json.
Update the init method to set the path of the runtime binary that will be launched.
Update src/multilspy/language_server.py:init method to import your language server when the language is <target_language>
Tal (@mrT23) If you end up getting Javascript support working on your own fork, I'd love to see as I will be needing the same in the coming weeks!
Lakshya A Agrawal (@LakshyAAAgrawal) And thank you for the excellent repo, it has saved me a lot of time with a system that requires accurately parsing code references.
One of the primary intentions I had with this repository was for it to be reference for the community to implement and use clients for various language servers. While most language server clients target an IDE like vscode, multilspy is intended to be a repository for programmatic uses of language servers, as opposed to user-facing usecases like in vscode.
I would be really glad if you could contribute your implementation of a js client!
Lakshya A Agrawal (@LakshyAAAgrawal) I ended up implementing a JS/TS client with the typescript-language-server package about a month ago. It's actually being used in production now, but I definitely didn't follow your procedures haha. Will follow your guide when we implement Golang and PHP next!
Tal (@mrT23)Tim Newman (@imanewman) This is our implementation, please lmk if you find this useful for your implementation(s) in any way. Should work out of the box, but you'll need NPM + Typescript + the language server installed locally.
Yes absolutely Lakshya A Agrawal (@LakshyAAAgrawal)! Our intention was always to merge our work into multilspy. It has served us very well so far and we'd like to give back to the community. I will open it later today once I fill out the Microsoft CLA.
i cloned the draft PR, and did some QA. on some repos it worked, on others, it got stuck.
I saw this happens for an inner code of us, but also for public repos.
If I am doing something wrong, do let me know
Tal (@mrT23) yeah fairly likely that if node_modules isn't being included when you index ts-pattern - it may be related to that event loop fix that I reverted. Or you aren't filtering out non-JS/TS files.
But I'm not sure of the exact solution yet, it's pretty late for me right now. Will investigate tomorrow morning. I think I have some code that can help you with that filtering step too.
Tal (@mrT23) Haven't had time to test your code out yet - mainly because I've actually been using the synchronous LSP client in multilspy, so kinda unfamiliar with the async behavior.
But here's some helper functions I wrote that essentially prunes out all non-relevant file types for a given repo. Also works on multi-lingual monorepos, and splits them into unique trees per language group e.g python that still preserve their structure so multilspy can still work over it.
EXT_TO_LANGUAGE_DATA is essentially just a dictionary with this form.
Hope this helps you for now. I'll look at your example at night. Will also discuss w/ Lakshya A Agrawal (@LakshyAAAgrawal) if this automated approach for filtering out language specific subtrees is appropriate for inclusion in multilspy with a follow up PR.
For each repo, copying all the relevant files to a cloned repo seems to me like a non optimal operation. I think we should be able to tell the LSP which file types to take, instead of doing by default cloning
Activity
LakshyAAAgrawal commentedon Oct 7, 2024
Steps to add a new language to multilspy:
At step 5, you may need the complete server logs to debug. You can pass a logger to the init method for the same.
Please feel free to reach out to me if you face any issues.
mrT23 commentedon Oct 7, 2024
Thanks a lot for the feedback !
will try
imanewman commentedon Oct 7, 2024
Tal (@mrT23) If you end up getting Javascript support working on your own fork, I'd love to see as I will be needing the same in the coming weeks!
Lakshya A Agrawal (@LakshyAAAgrawal) And thank you for the excellent repo, it has saved me a lot of time with a system that requires accurately parsing code references.
LakshyAAAgrawal commentedon Oct 8, 2024
One of the primary intentions I had with this repository was for it to be reference for the community to implement and use clients for various language servers. While most language server clients target an IDE like vscode, multilspy is intended to be a repository for programmatic uses of language servers, as opposed to user-facing usecases like in vscode.
I would be really glad if you could contribute your implementation of a js client!
themichaelusa commentedon Oct 8, 2024
Lakshya A Agrawal (@LakshyAAAgrawal) I ended up implementing a JS/TS client with the
typescript-language-serverpackage about a month ago. It's actually being used in production now, but I definitely didn't follow your procedures haha. Will follow your guide when we implement Golang and PHP next!Tal (@mrT23) Tim Newman (@imanewman) This is our implementation, please lmk if you find this useful for your implementation(s) in any way. Should work out of the box, but you'll need NPM + Typescript + the language server installed locally.
LakshyAAAgrawal commentedon Oct 8, 2024
Michael Usachenko (@themichaelusa) I checked out the repository, and it looks well implemented!
Would it be okay with you and your team to create a PR and add it to multilspy so that the wider community could make use of it?
themichaelusa commentedon Oct 8, 2024
Yes absolutely Lakshya A Agrawal (@LakshyAAAgrawal)! Our intention was always to merge our work into multilspy. It has served us very well so far and we'd like to give back to the community. I will open it later today once I fill out the Microsoft CLA.
themichaelusa commentedon Oct 9, 2024
#6 Here's my branch, will work on tidying it up today. Should be ready very soon.
mrT23 commentedon Oct 9, 2024
Michael Usachenko (@themichaelusa)
Thanks for sharing the code.
i cloned the draft PR, and did some QA. on some repos it worked, on others, it got stuck.
I saw this happens for an inner code of us, but also for public repos.
If I am doing something wrong, do let me know
Here is a reproducible example:
clone
https://github.com/gvergnaud/ts-patternrun:
it gets stuck here
interestingly, when I run only on the
srcdirectory:it works, so I think the LSP might have problems with repos too large, or with some specific files or extensions present somewhere in the repo.
themichaelusa commentedon Oct 9, 2024
Tal (@mrT23) yeah fairly likely that if
node_modulesisn't being included when you indexts-pattern- it may be related to that event loop fix that I reverted. Or you aren't filtering out non-JS/TS files.But I'm not sure of the exact solution yet, it's pretty late for me right now. Will investigate tomorrow morning. I think I have some code that can help you with that filtering step too.
themichaelusa commentedon Oct 10, 2024
Tal (@mrT23) Haven't had time to test your code out yet - mainly because I've actually been using the synchronous LSP client in multilspy, so kinda unfamiliar with the async behavior.
But here's some helper functions I wrote that essentially prunes out all non-relevant file types for a given repo. Also works on multi-lingual monorepos, and splits them into unique trees per language group e.g
pythonthat still preserve their structure so multilspy can still work over it.EXT_TO_LANGUAGE_DATAis essentially just a dictionary with this form.{ ".py": { "is_code": true, "language_mode": "python" }, ... }Hope this helps you for now. I'll look at your example at night. Will also discuss w/ Lakshya A Agrawal (@LakshyAAAgrawal) if this automated approach for filtering out language specific subtrees is appropriate for inclusion in multilspy with a follow up PR.
mrT23 commentedon Oct 10, 2024
The problem occurs both with sync and async
For each repo, copying all the relevant files to a cloned repo seems to me like a non optimal operation. I think we should be able to tell the LSP which file types to take, instead of doing by default cloning
themichaelusa commentedon Oct 10, 2024
I generally agree that cloning isn't perfect. Luckily this is code that runs outside of the package.
I do wonder if this is possible in
initialize_params.jsone.g programmatically excluding certain subpaths or file extensions.Will look into it after this PR is merged.
themichaelusa commentedon Oct 16, 2024
Lakshya A Agrawal (@LakshyAAAgrawal) my PR #6 is ready for your review. Excited to get this in!
LakshyAAAgrawal commentedon Dec 17, 2024
A very useful general reference: https://github.com/joaotavora/eglot?tab=readme-ov-file