August 15, 2013 Re: Request for editor scripting help | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian Schott | On 2013-08-09 08:41, Brian Schott wrote: > I've been making some progress on a project called DCD[1], which is D's > answer to Go's Gocode[2]. It's a command-line client/server > autocompletion program for D built off the same lexer/parser/ast code > that powers DScanner. > > I'd like to get some help writing integration scripts for the editors > that I don't use such as Vim, Emacs, Sublime, and of course your > favorite that I left off the list. If you have experience scripting your > text editor of choice and some spare time to play with new and unstable > software, please consider creating a pull request. > > [1] https://github.com/Hackerpilot/DCD > [2] https://github.com/nsf/gocode I have read the documentation, but one thing I don't understand, when will "calltips" show up. BTW, how hard would it be to add some type information to the output? -- /Jacob Carlborg |
August 15, 2013 Re: Request for editor scripting help | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian Schott | On 2013-08-09 08:41, Brian Schott wrote: > I've been making some progress on a project called DCD[1], which is D's > answer to Go's Gocode[2]. It's a command-line client/server > autocompletion program for D built off the same lexer/parser/ast code > that powers DScanner. > > I'd like to get some help writing integration scripts for the editors > that I don't use such as Vim, Emacs, Sublime, and of course your > favorite that I left off the list. If you have experience scripting your > text editor of choice and some spare time to play with new and unstable > software, please consider creating a pull request. > > [1] https://github.com/Hackerpilot/DCD > [2] https://github.com/nsf/gocode I was able to try this now. It works on Mac OS X as well, at least with a simple test case. This looks awesome. -- /Jacob Carlborg |
August 16, 2013 Re: Request for editor scripting help | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian Schott | OK, I got dotComplete working in Vim, but I can't get the parenComplete calltips. Which cursor position should I give? The left-paren? The last character of the function name? Right after the left-paren? I can't seem to get any to work... |
August 16, 2013 Re: Request for editor scripting help | ||||
---|---|---|---|---|
| ||||
Posted in reply to Idan Arye | On Friday, 16 August 2013 at 19:21:53 UTC, Idan Arye wrote:
> OK, I got dotComplete working in Vim, but I can't get the parenComplete calltips. Which cursor position should I give? The left-paren? The last character of the function name? Right after the left-paren? I can't seem to get any to work...
It should work if you call it when the cursor is directly after the left paren.
|
August 17, 2013 Re: Request for editor scripting help | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian Schott | On Friday, 9 August 2013 at 06:41:10 UTC, Brian Schott wrote:
>
> I'd like to get some help writing integration scripts for the editors that I don't use such as Vim, Emacs, Sublime, and of course your favorite that I left off the list.
How do the existing plugins handle completion of non-saved parts of the file? Currently I'm just saving the file on every completion request. However that is a usability nightmare. Would saving to a temporary do without confusing DCD?
|
August 17, 2013 Re: Request for editor scripting help | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tobias Pankrath | On Saturday, 17 August 2013 at 18:25:50 UTC, Tobias Pankrath wrote:
> How do the existing plugins handle completion of non-saved parts of the file? Currently I'm just saving the file on every completion request. However that is a usability nightmare. Would saving to a temporary do without confusing DCD?
There are several ways that you can solve this, depending on the implementation of whatever function you use to launch the client.
The client supports reading from a file (which should be a temporary file to avoid the UI issues you mentioned), or from standard input. It writes to standard output.
1. Write the buffer to a temporary file, run the client on this file and redirect to another temporary. Then read this file and display the completions
2. popen "dcd-client > output.txt" and read the completions. This is what I use with Lua because its implementation of popen doesn't allow reading and writing to the same process. (I know the implementation in git at the moment does this backwards. I'm going to fix it this evening)
3. popen the client and handle everything in memory. This is probably the best way to handle it.
|
Copyright © 1999-2021 by the D Language Foundation