Closed akosyakov closed 3 months ago
I'm also interested in support for this
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.
With LSP, Inteiilsence will be available for ace editor. Hope that ace editor can integrate LSP.
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
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
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).
@kungfooman where do you run LSP server in your use case?
@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:
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.
thanks, we're currently designing our solution to actually support both use cases for remote LSP server and in-browser one
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?
any updates on this?
any updates on this?
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.
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.
This is impressive work @nightwing @andrewnester!
I'll run live tests and let you know of any bugs
People can build LSP servers on top of Ace via ace-linters from @mkslanc, or use the API of ACE directly to add markers and add auto-complete.
Hello @whazor, Can you guys also provide a Quick Start example with ace-linters? Like a complete separate repository possibly. The current implementations are using a lot of utility functions that might be hard to get the head around without diving into the core ace codebase. I tried to use it alongside a react project a long time ago but failed miserably and switched to monaco.
A minimal vite project with maybe type-scipt-language-server
and websockets would be cool👍🏼
This ace sample shows how to setup a HTML language server with ace-code
and ace-linters
.
Hi @CypherpunkSamurai ! For websockets example you could look into readme or Verified Language Servers on wiki. Also demo has plenty of useful examples
Microsoft has announced Language Server Protocol. Is there any plans to provide integration with it?