Skip to content

Move VS Code extension into compiler repo #6994

Closed

Description

@cknitt

Move the VS Code extension sources from https://github.com/rescript-lang/rescript-vscode into the compiler repo so that they can be maintained together and binary compatibility is ensured (see e.g. #6979 (comment)).

Activity

  1. added this to the v12 milestone on Aug 31, 2024
  2. self-assigned this
    on Aug 31, 2024
  3. fhammerschmidt commented on Aug 31, 2024

    @fhammerschmidt
    Member

    Sidenote: At some point the repo should probably just be called ReScript, or something else, because it is much more than just a compiler now.

  4. cometkim commented on Sep 10, 2024

    @cometkim
    Member
  5. cometkim commented on Sep 22, 2024

    @cometkim
    Member

    IMHO it would be better to integrate the LSP feature into the compiler and leave the VSCode extension itself external.

  6. nojaf commented on Sep 23, 2024

    @nojaf
    Collaborator

    This is how gleam does it. You install it and their cli has a command to start the lsp server.
    All logic happens there and you have thin clients that connect to it.

  7. nojaf commented on Oct 24, 2024

    @nojaf
    Collaborator

    I have one question: Currently, the LSP tooling calls OCaml components externally. These tools read artifact files from the lib folder. It's somewhat fortunate that this setup works as it does. If the compiler generates slightly different *cmt files, for example, the tooling could potentially break. So, having the LSP server integrated into the rescript command would be ideal to ensure that the tooling always runs on a compatible version, right?

  8. zth commented on Oct 24, 2024

    @zth
    Member

    @nojaf that's the gist of it yes. Essentially, whatever works on the compiler artifacts is what's in danger of breaking. That's currently the thing we call analysis, which is an OCaml program that drives most of the editor tooling functionality. tools is another thing which operates on these files.

    The language server itself isn't that important to move, but mid to long term the goal is to integrate that into the compiler repo and ship something like a command (rescript lsp) that starts a language server dedicated to that particular project + compiler version.

    We still have to worry about all existing compiler versions that doesn't ship with its own language server. So, the current extension and analysis will need to remain in some form, regardless of whether we ship the compiler stuff. But that's a minor issue, we could hide that fairly well, and it'd rarely be updated.

    That has been my worry mostly, that we've been working so actively on the editor tooling and that locking improvements down to compiler versions means people on older versions don't get access to the improvements. But slowly we're getting to a state where that's more acceptable.

  9. nojaf commented on Oct 25, 2024

    @nojaf
    Collaborator

    I believe v12 is a perfect opportunity to introduce rescript lsp. Users on older versions can continue using the current VSCode plugin. While it's a commendable goal to support all versions of ReScript with a single plugin, we should keep in mind that most of this work is done by volunteers in their spare time. Therefore, I wouldn't be too hard on myself for not supporting older versions any longer.

    Additionally, providing new tooling benefits could motivate users to upgrade to the latest version of ReScript.

  10. cknitt commented on Nov 28, 2024

    @cknitt
    MemberAuthor

    OCaml sources (tools, analysis) were copied to the compiler repo.

    The JS part stays in the extension repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions