Skip to content

LSP Client #1465

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

LSP Client #1465

wants to merge 21 commits into from

Conversation

RohitKushvaha01
Copy link
Collaborator

@RohitKushvaha01 RohitKushvaha01 commented Aug 1, 2025

Usage

// 0. lspClient
const lspClient = acode.require("lspClient")

// 1. Initialize client
const client = new lspClient("ws://localhost:2088", "python");

// 2. Connect to server
await client.connect();

// 3. Register active editor, (path can be null)
const editor = editorManager.activeFile.session.$editor;
client.addEditor(editor, "/project/main.py");

// 4. Optional: Set workspace folder
await client.setWorkspaceFolder("file:///project");

Document Formatting

// Format the current document
await client.formatDocument(editor);

Editor Management

// Remove editor when tab is closed
client.removeEditor(editor1);

// Disconnect when all editors are closed or LSP is no longer needed
client.disconnect();

Related Issues

Development Progress

  • Auto completion
  • Error, info, warnings diagnostics
  • Hover info
  • Workspaces support
  • Document formatter
  • Get declaration

@UnschooledGamer
Copy link
Collaborator

@bajrangCoder We're approaching it without Ace-Linters this time?

@bajrangCoder
Copy link
Collaborator

@RohitKushvaha01 implementation is good 👍
But only completion is working.
Btw it will be good to use ace-linter or we'll need to implement different LSP protocol and spec etc and Also this implementation will not work with some LSP servers

@UnschooledGamer
Copy link
Collaborator

UnschooledGamer commented Aug 1, 2025

@RohitKushvaha01 implementation is good 👍
But only completion is working.

Others need more code

Btw it will be good to use ace-linter or we'll need to implement different LSP protocol and spec etc and Also this implementation will not work with some LSP servers

Hmm.

@RohitKushvaha01 RohitKushvaha01 marked this pull request as draft August 1, 2025 04:50
@RohitKushvaha01 RohitKushvaha01 self-assigned this Aug 1, 2025
@RohitKushvaha01 RohitKushvaha01 marked this pull request as ready for review August 1, 2025 06:32
@UnschooledGamer

This comment was marked as off-topic.

@UnschooledGamer

This comment was marked as off-topic.

@UnschooledGamer
Copy link
Collaborator

@RohitKushvaha01 Also, add option for initializationOptions & give that initializationOptions option to serverData variable

image

@UnschooledGamer
Copy link
Collaborator

Now, Left out is raw requests & events. sendRequest method can be exposed for it.

For events, It's connection or message Controller is not exposed, You'll have to be Abit Hacky to get them: https://github.com/mkslanc/ace-linters/blob/main/packages%2Face-linters%2Fsrc%2Face-language-client.ts#L14-L21

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.

3 participants