-
Notifications
You must be signed in to change notification settings - Fork 34
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
External autocomplete #48
Comments
Conceivably #47 should be folded into this? |
Having just discovered that Ctrl-F works in Acme. How does one pick one of the completions in in the +Errors window? Just Snarf it? I think it would be really interesting to hook this into one of Go's auto-complete libraries. |
Yes. Snarf the result or type more until there is only one choice. And yes. The point of the bug would be to permit an external auto-completion system to be added with the libraries that you're thinking about or something like YCM running as a separate program. |
Note: |
Language Server Protocol (LSP) has support for auto-completion. I've been working on a tool that integrates LSP with acme. Currently I can have a window in acme that shows a list of possible completions in a window and update it as I move the cursor. However, the way I'm implementing it is very inefficient because it reads the whole body when I move the cursor (or type something). I think what's needed for an external auto-completion (and other LSP features) is a log file for each window, similar to the global log file, but it'd allow clients to passively monitor each window. In theory this should already be possible with the event file, but somehow writing back events to the event file doesn't always update the tag correctly. So, perhaps the event file needs to be fixed instead. Something else to think about: can we expand the file server enough, so that it's possible to separate the acme file server part from the GUI part? This would make something like |
Several comments:
|
My LSP tool should already work with Edwood, since the file server is currently compatible with acme. I've been using it for a while instead of A and acmego for Go programming. It doesn't use the official Go lsp server yet, but it will when that's ready. The problem with event file is that if you run a simple program (see below) that just writes back the events, "Put" and "Undo" doesn't automatically show up when you modify the text in the window. The window is marked as dirty but somehow the tag isn't updated so that the user can Save/Undo the file. I'm not too concerned with picking auto-completion just yet. I'd be happy just to get a list of completions that's computed fast. package main
import (
"log"
"os"
"strconv"
"9fans.net/go/acme"
)
func main() {
n, err := strconv.Atoi(os.Getenv("winid"))
if err != nil {
panic(err)
}
w, err := acme.Open(n, nil)
if err != nil {
panic(err)
}
for {
e, err := w.ReadEvent()
if err != nil {
break
}
if err := w.WriteEvent(e); err != nil {
log.Printf("WriteEvent: %v\n", err)
}
}
} |
Out of curiosity, as I am currently trying to make it work:
How do I use |
You can't unfortunately. I've opened 9fans/acme-lsp#14. |
Thank you. |
Acme has a built-in simple autocomplete system that Edwood has inherited. The inclusion of this functionality isn't necessarily compatible with the Acme "IDE built of UNIX commands" model. We should consider implementing a scheme where an external command (perhaps configurable per
Window
) would be responsible for autocompletion functionality.The text was updated successfully, but these errors were encountered: