CodinGame / monaco-vscode-api

VSCode public API plugged on the monaco editor
MIT License
243 stars 32 forks source link

Can I register extension redhat.java and vscode-lombok with this?? #211

Closed adj5672 closed 1 year ago

adj5672 commented 1 year ago

I'm using monaco-vscode-api and monaco-languageclient to edit Java code with monaco editor. (with @codingame default java extension)

I have my own language server based on eclipse.jdt.ls and pretty works well like this.

image

but, there's something I want to register extensions.

It's vscode-lombok..

since my language server has lombok dependency, so annotations of lombok can auto complete. but, getter and setter method can not be recognized..

image image

I think that if I register vscode-lombok extension then it may works well.. (since lombok extension use redhat java extension, java extension have to register too..) I don't know how to register extension using registerExtension method..

Is it possible..?? and if possible, how I register that extension... 🥲

CGNonofr commented 1 year ago

Yes it's possible, but you'll need the remote ext host server

On the server:

On the client:

adj5672 commented 1 year ago

@CGNonofr thanks for your answer :)

I have some additional questions.

  1. My understanding is that I need 3 servers. client server, language server and remote extension host server. is it correct?

  2. my client server's host is http://localhost:3000 and language server is ws://localhost:30000/java.

    when I run vscode-ext-host-server, it seems open with localhost:8000.

    image

    then, Is remoteAuthority localhost:8000??

    When I request to localhost:8000, response is 403 forbidden.. 🥲 (Run with --without-connection-token option, response turn to be 'not found ')

  3. In my code, I set userServices like this. and I cannot understand how I provide remoteAuthority to the environment service override as parameter... 🥲

    image image
  4. Is there any remote ext host example that I can refer to??

CGNonofr commented 1 year ago

What is the "client" server ? The vscode extension already includes the language client/server, you don't need anything else

You need the environment service override to set the remoteAuthority

The demo here demonstates it on a simple remote extension

adj5672 commented 1 year ago

What I meant by client server was langauge client.. 😅

I registered service override like this and extension host looks like works. :) thanks @CGNonofr

image image

The following warning log also occurred. Is there any problem?

image

Red Hat Java extension seems to have been applied well.. But lombok doesn't seem to apply. 🥲

adj5672 commented 1 year ago

In my language servers, after set vmargs javaagent lombok path, it perfectly works!!

-javaagent:path-to-lombok-jar -Xbootclasspath/a:path-to-lombok-jar

image image

Thanks :)