multilspy icon indicating copy to clipboard operation
multilspy copied to clipboard

Project workspace setup in eclipse_jdtls

Open ghost opened this issue 11 months ago • 2 comments

In the current implementation, the workspace directory for Eclipse JDTLS is generated using a random UUID for every invocation:

ws_dir = str(PurePath(
        MultilspySettings.get_language_server_directory(),
        "EclipseJDTLS",
        "workspaces",
        uuid.uuid4().hex,
    )
)

Two directories are created inside ws_dir:

data_dir = str(PurePath(ws_dir, "data_dir"))
dtls_config_path = str(PurePath(ws_dir, "config_path"))

Shouldn't workspace directories be consistent across invocations for the same project?

ghost avatar Dec 27 '24 13:12 ghost

This repository was created with AI4Code applications in mind, where often, when you are benchmarking on a particular codebase/repository, you want to start from a "clean"/"pristine" workspace dir, which is not impacted by any of the actions taken in the past on the repository workspace (for example, for Monitor-Guided Decoding, for which multilspy was built, the monitor would append and delete text within different files). Hence, I had decided to go with creating a new workspace directory for every invocation.

Having said that, I agree that it is much more useful (in general) to have a common workspace dir for the same project. I believe the right way to go to ensure both usecases can be satisfied is to let it be a config. The user can specify a custom workspace dir when invoking multilspy, and if it is None, then it creates a new workspace dir (as currently implemented).

Would you be able to create a PR for the same?

LakshyAAAgrawal avatar Dec 28 '24 06:12 LakshyAAAgrawal

Hello LakshyAAAgrawal Thanks for the explanation. I'd be happy to work on that PR: make the workspace configurable, either by passing it as a config to the server factory or by inferring the workspace directory for the project if it already exists.

Can we make the launch command part of the config too. For now, a default command with default runtime dependencies is used to launch the server instance. We could make this part of the config and fall back to the default command if none is provided.

ghost avatar Dec 28 '24 10:12 ghost