Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add Clangd-wasm example, build LS images with GHA #734

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

kaisalmen
Copy link
Collaborator

@kaisalmen kaisalmen commented Aug 23, 2024

This PR adds the clangd wasm port from https://github.com/guyutongxue/clangd-in-browser into a new example. The client side of the example is already clean-up / aligned to the other example. TODO: The server side code needs some polishing.

In addition the following things have been added along:

  • GHA actions that build all container based language servers (groovy, eclipse.jdt.ls, clangd). They need to be manually started, but images are stored in the container registry already

Once we have clangd in integrated, we have together with pyright and eclispe.jdt.ls enough complex language server (worker and web socket conn.) available to integrate different ways of file synchronizations. This PR enables more future enhancements.

@kaisalmen kaisalmen changed the title WIP: Port Clangd example, language server images, language wrapper improvements WIP: Add Clangd-wasm example, build LS images with GHA, LanguageClientWrapper improvements Aug 23, 2024
@CGNonofr
Copy link
Collaborator

I did some investigation around clangd and the possibility to run it in the browser already, here's what I've found:

I was able to run a small C program compiled into wasm, properly accessing the VSCode virtual filesystem. But since it doesn't support some basic features like threads, it failed to run any "advanced" binaries

The only option currently seems to be https://github.com/guyutongxue/clangd-in-browser, but I wonder if it's able to interact with the filesystem, and how?

@kaisalmen
Copy link
Collaborator Author

kaisalmen commented Aug 23, 2024

I did some investigation around clangd and the possibility to run it in the browser already

@CGNonofr Great, thanks for sharing 👍 If this becomes fully working in the browser at one point in time (via whatever tech) it will be awesome.

The only option currently seems to be https://github.com/guyutongxue/clangd-in-browser, but I wonder if it's able to interact with the filesystem, and how?

It brings its own virtual file system. You can read and write files (done here: https://github.com/TypeFox/monaco-languageclient/blob/clangd-example/packages/examples/src/clangd/worker/clangd-server.ts)

@CGNonofr
Copy link
Collaborator

It brings its own virtual file system. You can read and write files (done here: https://github.com/TypeFox/monaco-languageclient/blob/clangd-example/packages/examples/src/clangd/worker/clangd-server.ts)

Isn't there any way to provide our own implementation instead? which would access the VSCode filesystem? That would be a shame to have to watch the filesystem to register the files one by one

@kaisalmen
Copy link
Collaborator Author

Isn't there any way to provide our own implementation instead?

The wasm already contains the header files meaning when you have it loaded you can read all the header files as far as I understand it. Something must be adjusted in the build process to change that, I guess. I did not investigate any of this so far.

@kaisalmen
Copy link
Collaborator Author

But now we can start to play with it and try things...

@kaisalmen
Copy link
Collaborator Author

@CGNonofr I will open up a second PR with the wrapper improvements and base this one on it. I need to fix some build problems first.

@kaisalmen kaisalmen changed the title WIP: Add Clangd-wasm example, build LS images with GHA, LanguageClientWrapper improvements WIP: Add Clangd-wasm example, build LS images with GHA Sep 5, 2024
- UserConfig is now WrapperConfig and one level less deep
- Language client config has better names and is structured more logically
- Introduce new two_langauge_clients.html example replacing wrapper_adv.html
- Condense code
- Make use of new wrapper features
- Increase clangd timeout to 150 minutes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants