Skip to content

LSP Client#1465

Closed
RohitKushvaha01 wants to merge 21 commits intoAcode-Foundation:mainfrom
RohitKushvaha01:lsp
Closed

LSP Client#1465
RohitKushvaha01 wants to merge 21 commits intoAcode-Foundation:mainfrom
RohitKushvaha01:lsp

Conversation

@RohitKushvaha01
Copy link
Copy Markdown
Member

@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
Copy Markdown
Member

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

@bajrangCoder
Copy link
Copy Markdown
Member

@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
Copy Markdown
Member

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
Copy Markdown
Member

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

image

@UnschooledGamer
Copy link
Copy Markdown
Member

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

@UnschooledGamer
Copy link
Copy Markdown
Member

UnschooledGamer commented Aug 28, 2025

Closure! Would be taken as a Task in Migration to CodeMirror 6

Quoted:

It's Currently Delayed due to Migration from Ace Editor to Codemirror 6, as it would've created problems for Plugin Devs to migrate if the API had been released & received a breaking change too quickly.

For Now, Use Plugins Created by the Community.

Once the Migration to CodeMirror 6 Happens. Acode Editor would have LSP Support.

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