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

Start Ydoc with the language server #9862

Merged
merged 68 commits into from
May 28, 2024
Merged

Conversation

4e6
Copy link
Contributor

@4e6 4e6 commented May 3, 2024

Pull Request Description

Changelog:

  • update: Ydoc starts with the language server on the localhost:1234 by default. The hostname and ports can be configured by setting environment variables LANGUAGE_SERVER_YDOC_HOSTNAME and LANGUAGE_SERVER_YDOC_PORT
  • update: by default npm dev run uses the node Ydoc server. You can control it with POLYGLOT_YDOC_SERVER env variable. For example,
    env POLYGLOT_YDOC_SERVER='true' npm --workspace=enso-gui2 run dev
    
    To connect to the Ydoc server running on the 1234 port (the one started with the language server)
    env POLYGLOT_YDOC_SERVER='ws://127.0.0.1:1235' npm --workspace=enso-gui2 run dev
    
    To connect to the provided URL. Can be useful for debugging when you start a separate Ydoc process.
  • update: run npm install before the engine build. It is required to create the Ydoc JS bundle.

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.

@4e6 4e6 added the CI: No changelog needed Do not require a changelog entry for this PR. label May 3, 2024
@4e6 4e6 self-assigned this May 3, 2024
@4e6 4e6 force-pushed the wip/db/ydoc-language-server branch 2 times, most recently from 4acf4d6 to 22488da Compare May 10, 2024 13:28
build.sbt Outdated Show resolved Hide resolved
build.sbt Show resolved Hide resolved
Comment on lines +9 to +13
// ydoc-server
requires io.helidon.webclient;
requires io.helidon.webclient.websocket;
requires io.helidon.webserver;
requires io.helidon.webserver.websocket;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good solution for now, if everything works with that. But at the end, we must ensure that runtime.jar does not require helidon modules. Let's keep that in mind and create a separate ticket for that before merging.

@@ -13,9 +13,9 @@ public class ClassLoaderConstants {
* consistent.
*/
public static final List<String> CLASS_DELEGATION_PATTERNS =
List.of("org.graalvm", "java", "org.slf4j", "ch.qos");
List.of("org.graalvm", "java", "org.slf4j", "ch.qos", "io.helidon");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. This ensures that our boot class loader deleagates loading of all io.helidon.* classes to the system class loader, which picks the classes from JARs inside the component directory.

@4e6 4e6 force-pushed the wip/db/ydoc-language-server branch from 5958a94 to d77d8a5 Compare May 13, 2024 15:59
@4e6 4e6 added CI: Clean build required CI runners will be cleaned before and after this PR is built. and removed CI: Clean build required CI runners will be cleaned before and after this PR is built. labels May 13, 2024
@4e6 4e6 force-pushed the wip/db/ydoc-language-server branch from d0f2108 to 8a16bf9 Compare May 17, 2024 06:16
@JaroslavTulach JaroslavTulach self-requested a review May 21, 2024 13:32
Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is great to see this to be green. Let's integrate and let's unblock the cloud integration.

@somebody1234
Copy link
Collaborator

hey, just wondering - what's the roadmap for this stuff? will this be theoretically ready for integration with Cloud after this PR? or are there more steps that are needed?

@somebody1234 somebody1234 requested a review from Frizi May 23, 2024 10:59
@4e6
Copy link
Contributor Author

4e6 commented May 23, 2024

This should be enough to start integration in the cloud

@4e6
Copy link
Contributor Author

4e6 commented May 24, 2024

@Frizi waiting for your approval

@PabloBuchu
Copy link
Contributor

| update: Ydoc starts with the language server on the localhost:1234 by default. The hostname and ports can be configured by setting environment variables LANGUAGE_SERVER_YDOC_HOSTNAME and LANGUAGE_SERVER_YDOC_PORT

Can you EXPOSE 1234 port in Dockerfile?

The port should be fixed there and both LANGUAGE_SERVER_YDOC_HOSTNAME LANGUAGE_SERVER_YDOC_PORT overridden (same as RPC_PORT and DATA_PORT)

@4e6
Copy link
Contributor Author

4e6 commented May 24, 2024

Sure, I'll update the Docerfile in the follow-up PR. This one has already too many stuff in it

@4e6 4e6 added CI: Ready to merge This PR is eligible for automatic merge and removed CI: Ready to merge This PR is eligible for automatic merge labels May 27, 2024
@JaroslavTulach JaroslavTulach mentioned this pull request May 27, 2024
5 tasks
@4e6 4e6 requested a review from marthasharkey as a code owner May 28, 2024 09:25
@4e6 4e6 requested a review from radeusgd May 28, 2024 09:28
}
try (var ydoc = new Ydoc.Builder().build()) {
ydoc.start();
lock.acquire();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional that this Semaphore is never released?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we are waiting for any interruption signal here. Otherwise, the main process ends.

@4e6 4e6 added the CI: Ready to merge This PR is eligible for automatic merge label May 28, 2024
@mergify mergify bot merged commit 858e646 into develop May 28, 2024
37 checks passed
@mergify mergify bot deleted the wip/db/ydoc-language-server branch May 28, 2024 13:51
@radeusgd
Copy link
Member

I realise that once this was merged, I can no longer compile the engine through sbt in IntelliJ, because I use the (recommended) version manager for Node: fnm. Unfortunately I was never able to set up IntelliJ to pick-up the environment changes that fnm generates to be able to 'see' node from an sbt shell in IntelliJ.

For now I just need to switch to using sbt from within PowerShell. This is okay, but a bit annoying as IntelliJ will start the sbt shell anyway to re-import the project from time to time.

Has anyone had a chance to set up IntelliJ to pick up the Node paths from fnm?

@Akirathan
Copy link
Member

I realise that once this was merged, I can no longer compile the engine through sbt in IntelliJ, because I use the (recommended) version manager for Node: fnm. Unfortunately I was never able to set up IntelliJ to pick-up the environment changes that fnm generates to be able to 'see' node from an sbt shell in IntelliJ.

For now I just need to switch to using sbt from within PowerShell. This is okay, but a bit annoying as IntelliJ will start the sbt shell anyway to re-import the project from time to time.

Has anyone had a chance to set up IntelliJ to pick up the Node paths from fnm?

@radeusgd My IntelliJ's builtin sbt shell stopped working approx 9 months ago. I have switched to a separate sbt process in the terminal entirely. It is interesting that you have even made it so far.

@4e6 4e6 mentioned this pull request Jun 7, 2024
3 tasks
mergify bot pushed a commit that referenced this pull request Jun 7, 2024
- followup #9862
- related #7954

Expose the Ydoc port in the Docker container to make it configurable in the Cloud environment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Clean build required CI runners will be cleaned before and after this PR is built. CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants