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

Language Server Protocol Integration #3124

Open
akosyakov opened this issue Oct 20, 2016 · 15 comments
Open

Language Server Protocol Integration #3124

akosyakov opened this issue Oct 20, 2016 · 15 comments

Comments

@akosyakov
Copy link

Microsoft has announced Language Server Protocol. Is there any plans to provide integration with it?

@jgoldshlag
Copy link

I'm also interested in support for this

@Aerilius
Copy link

Aerilius commented Oct 2, 2018

I would be interested as well, as it promises higher quality code-completion than I currently have, with less maintenance effort. Having LSP support helps to keep Ace relevant for my project in the long-term.

@hez2010
Copy link

hez2010 commented Sep 20, 2019

With LSP, Inteiilsence will be available for ace editor. Hope that ace editor can integrate LSP.

@apttap
Copy link

apttap commented May 29, 2021

it would be a nice extension at the very least, I would love to develop a custom ide ultimately with the work I'm doing in lsp. ace would be my preferred method for that

@andrewnester andrewnester added this to the LSP milestone May 9, 2022
@andrewnester andrewnester removed this from the LSP milestone May 20, 2022
@andrewnester
Copy link
Contributor

Just to provide an update on this - we're looking into LSP support for Ace as it's obviously one of the most asked features, so we'll keep this thread updated with any progress we make. In the meantime feel free to provide any feedback or ideas about how would you use Ace with LSP servers

@andrewnester andrewnester pinned this issue May 29, 2022
This was referenced May 29, 2022
@kungfooman
Copy link

In the meantime feel free to provide any feedback or ideas about how would you use Ace with LSP servers

I use TypeScript for "live coding" and LSP could provide type safety and IntelliSense for quicker live coding. I usually bind Ctrl+Enter to "execute" all code in ACE and then copy over the snippets into VSCode.

I am also interested in language design itself, so that would also help building custom languages (e.g. TypeScript with operator overloading support or languages completely from scratch - nice for CS students for example).

@andrewnester
Copy link
Contributor

@kungfooman where do you run LSP server in your use case?

This was referenced May 31, 2022
@kungfooman
Copy link

@andrewnester I never worked with LSP before, so I just collected some information how its done in the field:

  1. LSP over WebSocket to a "native" binary (messaging via JSON RPC)
  2. WebWorker messaging like its done in Monaco/TypeScript, using node_modules/monaco-editor/dev/vs/language/typescript/tsWorker.js

Option (2) feels a bit easier to me, but (1) is probably more generic, even though it feels like more overhead and harder to debug.

While with (2) you can just set some breakpoints into the WebWorker (at least in Chrome) and see whats going on rather easily:

image

Of course I realize that this issue is about LSP, but for my sake I just aim for better/easy-to-extend IntelliSense, no matter how its done.

@andrewnester
Copy link
Contributor

andrewnester commented May 31, 2022

thanks, we're currently designing our solution to actually support both use cases for remote LSP server and in-browser one

@CypherpunkSamurai
Copy link

Any updates on this?

I'm currently trying to create a completer that sends the completion prompt via websocket, but i cant seem to understand how to send the received websock message as a autocompletion callback. Any help would be apreciated

completer code:

var completer = {
    getCompletions: function(editor, session, pos, prefix, callback) {
        if (prefix.length === 0) { callback(null, []); return }
        // Get file contents
        const contents = editor.getValue();
        const row = pos.row;
        const col = pos.column;
        const triggerChar = prefix;
        didChange(socket, currentFilepath, contents);
        getLSPCompletion(socket, currentFilepath, row, col, triggerChar);
    }
}
socket.onmessage = function(event) {
    // Log
    console.log(event);
}

Is there any way to use the socket onmessage to trigger the autocomplete prompt along with the values returned by the lsp?

@renhiyama
Copy link

any updates on this?

1 similar comment
@Dineshchitta
Copy link

any updates on this?

@andrewnester
Copy link
Contributor

The team is picking up this work and you should expect to see some related code changes any time soon :)
It's an important project for us and we will keep this thread updated with any details.

@nightwing
Copy link
Member

The initial version is available at https://github.com/mkslanc/ace-linters. Currently it includes support for connecting to lsp server via websocket, and to monaco language services running in a webworker.

Any feedback and feature requests are highly appreciated.

@CypherpunkSamurai
Copy link

This is impressive work @nightwing @andrewnester!

I'll run live tests and let you know of any bugs

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

No branches or pull requests