-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Common Lisp Completion #466
Comments
I'm not sure about this. In my perspective, conjure is designed as an evaluation environment, rather than a completion source. Also does that require common lisp codes in this project? What's preventing you from writing a common lisp language server? That feels more modular than just integrate the feature you request for in this project. |
I'm very strongly leaning towards "just use LSP" for anything like this these days. The tooling outside and inside of Neovim has come along so far. LSP + DAP cover 90% of what everyone needs beautifully, Conjure should narrow it's focus down onto running your program and executing chunks of code, allowing you to merge the concept of editor and REPL. I'm going to close this in favour of recommending LSP for now, feel free to reopen or comment with opinions against this! |
This isn't an option, mainly since I've not found an LSP that works, but also because there is not really a way to do an LSP in the traditional sense in Common Lisp. The whole language environment is so dynamic that static analysis like what an LSP would typically do is impossible. The only way an LSP in CL could possibly work is if it were running under the same runtime as the REPL server Conjure is connected to. However, such an LSP does not exist. Considering that this would then mean having 2 connections between the CL runtime and Neovim (1 for Conjure, 1 for this hypothetical LSP) whereas the SWANK API Conjure uses already provides LSP-like APIs for completion and such (I believe?), this solution makes little to no sense. |
Ah interesting, I didn't realise static analysis was kinda not valid in the CL space, I've never looked into it too closely and have very surface level knowledge. Thanks for explaining! I'll reopen and keep it in the backlog of things to enhance if there's no LSP with autocomplete for CL, I just thought it'd be similar to Clojure or something where yes there's REPL state, but it should almost perfectly reflect the static analysis anyway. |
Well then the codebase should be shifted to another project that implement LSP based on Sly/Swank or whatever. BTW, Olical says he will likely to redesign this plugin (reference here ). I guess by then people can implement whatever they want in a separate plugin rather than keep throwing everything together. |
Alternatives to LSP:
Having said that, if the future direction of Conjure stil includes completions as a client feature, then it would be reasonable to add the functionality to the Common Lisp client. Of course, someone needs to implement the completion functionality whether the "mode" is LSP, nvim-cmp source, or client feature. |
Hmm we already have a cmp source I think? And conjure clients have a hook
for completions, each client needs to implement it though.
So if we implement that function in the CL client we just need to know
which code to eval to complete a given string. This is all in conjure
already and how Clojure does it.
…On Sat, 8 Jul 2023, 02:46 Russ Tokuyama, ***@***.***> wrote:
Alternatives to LSP:
- nvim-cmp-vlime <https://github.com/HiPhish/nvim-cmp-vlime> is an
nvim-cmp completion source for Common Lisp via Vlime
<https://github.com/vlime/vlime> (see List of sources
<https://github.com/hrsh7th/nvim-cmp/wiki/List-of-sources>). Downside:
duplicated REPLs and more set-up.
- Another project to build an nvim-cmp completion source plugin that
would use the Conjure Common Lisp client's connection to a Common Lisp REPL
running the Swank LISP code. Downside: a bit convoluted but, hopefully,
less work than building an LSP server.
Having said that, if the future direction of Conjure stil includes
completions
<https://github.com/Olical/conjure/wiki/Client-features#completions> as a
client feature, then it would be reasonable to add the functionality to the
Common Lisp client.
Of course, someone needs to implement the completion functionality whether
the "mode" is LSP, nvim-cmp source, or client feature.
—
Reply to this email directly, view it on GitHub
<#466 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACM6XPFHVYQ3OJSWBXYMVLXPC3YFANCNFSM6AAAAAAVF5QLPM>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
I just don't know what CL to execute to get completions...
…On Sat, 8 Jul 2023, 10:19 Oliver Caldwell, ***@***.***> wrote:
Hmm we already have a cmp source I think? And conjure clients have a hook
for completions, each client needs to implement it though.
So if we implement that function in the CL client we just need to know
which code to eval to complete a given string. This is all in conjure
already and how Clojure does it.
On Sat, 8 Jul 2023, 02:46 Russ Tokuyama, ***@***.***> wrote:
> Alternatives to LSP:
>
> - nvim-cmp-vlime <https://github.com/HiPhish/nvim-cmp-vlime> is an
> nvim-cmp completion source for Common Lisp via Vlime
> <https://github.com/vlime/vlime> (see List of sources
> <https://github.com/hrsh7th/nvim-cmp/wiki/List-of-sources>).
> Downside: duplicated REPLs and more set-up.
> - Another project to build an nvim-cmp completion source plugin that
> would use the Conjure Common Lisp client's connection to a Common Lisp REPL
> running the Swank LISP code. Downside: a bit convoluted but, hopefully,
> less work than building an LSP server.
>
> Having said that, if the future direction of Conjure stil includes
> completions
> <https://github.com/Olical/conjure/wiki/Client-features#completions> as
> a client feature, then it would be reasonable to add the functionality to
> the Common Lisp client.
>
> Of course, someone needs to implement the completion functionality
> whether the "mode" is LSP, nvim-cmp source, or client feature.
>
> —
> Reply to this email directly, view it on GitHub
> <#466 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AACM6XPFHVYQ3OJSWBXYMVLXPC3YFANCNFSM6AAAAAAVF5QLPM>
> .
> You are receiving this because you modified the open/close state.Message
> ID: ***@***.***>
>
|
Looking at the Slimv plugin, it appears that these should ask Swank (running in the Common Lisp REPL) for completions:
Slimv uses a Python provider to talk to Swank. |
@LordMZTE, how do you have your Common Lisp set up with Swank? I haven't used Comon Lisp before and was going to try set up Conjure to talk to sbcl. |
Oops! I just saw that there is a dev/common-lisp/README.adoc file. I'll read that. |
Also https://github.com/Olical/conjure/wiki/Quick-start:-Common-Lisp-(Swank) if you prefer roswell. |
I use cl-repl as a command-line REPL. I've set up a custom command to start swank, so I just have to open cl-repl and type |
I opened the Then I tried evaluating some forms that I thought might coax Swank into replying with some suggested words for completions. The
But
This should provide some starting point to flesh out a |
This is now merged into |
It'd be awesome to get Conjure to provide completion for Common Lisp. I've looked far and wide, and couldn't find any suitable language server or other completion provider that's easy to integrate into nvim-cmp. Considering that Conjure otherwise makes for an amazing development environment, it'd be great to expand it further.
The text was updated successfully, but these errors were encountered: