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

Autocompletion Service Support for external text editors #2245

Closed
ficoos opened this issue Jul 9, 2015 · 30 comments
Closed

Autocompletion Service Support for external text editors #2245

ficoos opened this issue Jul 9, 2015 · 30 comments

Comments

@ficoos
Copy link
Contributor

ficoos commented Jul 9, 2015

Allow for external editor to connect to a specific port for GDScript code completion.
for instance, when the editor is on an editor plugin could send a request in the form of:
http://localhost:9999/auto_complete?postions=position with the buffer as the post buffer.
In return get a json list of available completions from the internal analyzer.
This will allow the use of external editors without having to explicitly support them.

It could even be implemented in a simpler manner with sockets and a bi-directional json steam

@reduz
Copy link
Member

reduz commented Jul 9, 2015

is there any kind of standard on this?

On Thu, Jul 9, 2015 at 9:32 AM, Saggi Mizrahi notifications@github.com
wrote:

Allow for external editor to connect to a specific port for GDScript code
completion.
for instance, when the editor is on an editor plugin could send a request
in the form of:
auto_complete(file_buffer, position) and get a list of available
completions from the internal analyzer.
This will allow the use of external editors without having to explicitly
support them.


Reply to this email directly or view it on GitHub
#2245.

@ficoos
Copy link
Contributor Author

ficoos commented Jul 9, 2015

Not that I am aware of.
Most text editors allow you to write your own code completion plugins but they are always mutually incompatible.

That is why I suggested implementing the server side only and letting the community contribute the plugins.

They all generally look like:
get_completions_at(string buffer, int position)
Where the result is something like

{
   display_text: string
   completion_value: string
   type: enum(function, variable, etc....)
}

sublime api
YCM api (for vim)
clang_completer
intellij CompletionContributor

@bojidar-bg

This comment has been minimized.

@reduz
Copy link
Member

reduz commented Jul 17, 2015

Yeah i guess this would probably be not that difficult to implement
On Jul 9, 2015 5:00 PM, "Saggi Mizrahi" notifications@github.com wrote:

Not that I am aware of.
Most text editors allow you to write your own code completion plugins but
they are always mutually incompatible.

That is why I suggested implementing the server side only and letting the
community contribute the plugins.

They all generally look like:
get_completions_at(string buffer, int position)
Where the result is something like

{
display_text: string
completion_value: string
type: (function, variable, etc....)
}

sublime api
http://sublime-text-unofficial-documentation.readthedocs.org/en/latest/reference/api.html#sublime_plugin.EventListener.on_query_completions
YCM api (for vim)
https://github.com/Valloric/ycmd/blob/master/ycmd/completers/completer.py
clang_completer
http://clang.llvm.org/doxygen/group__CINDEX__CODE__COMPLET.html#ga50fedfa85d8d1517363952f2e10aa3bf
intellij CompletionContributor
https://github.com/JetBrains/intellij-community/blob/master/platform/lang-api/src/com/intellij/codeInsight/completion/CompletionContributor.java


Reply to this email directly or view it on GitHub
#2245 (comment).

@fazjaxton

This comment has been minimized.

@crr0004
Copy link
Contributor

crr0004 commented Sep 4, 2015

I'd like to see this. Would be up for helping to create it. Is there somewhere we can keep track of this besides here? The issues on this repo are getting out of hand as there is so many open.

@fazjaxton
Copy link

I would be glad to help too, but would like some direction about how the Godot developers think it should be implemented. I would love to have this for my editor.

@akien-mga akien-mga changed the title [RFE] Autocompletion Service Support Autocompletion Service Support for external text editors Nov 11, 2015
@akien-mga
Copy link
Member

Sounds like a useful feature. It should probably be tracked in a task on OpenProject @reduz.

@neikeq
Copy link
Member

neikeq commented Dec 12, 2015

I made a module for this. You can find it here: https://github.com/neikeq/gd-autocomplete-service

@neikeq
Copy link
Member

neikeq commented Mar 5, 2016

If we intend to add something like this to this repository, the main problem I faced was extracting parts of the code that was required for code completion from TextEditor, ScriptTextEditor and other places (can't remember), to put them in a single class that would provide these suggestions. This was the result: https://github.com/neikeq/gd-autocomplete-service/blob/master/autocomplete_service/code_completion_service.cpp

@reduz
Copy link
Member

reduz commented Mar 5, 2016

I would actually make it part of the engine... the script API already contains abstract functions for this, but you likely need to add this code in the script text editorfor better context.

@akien-mga
Copy link
Member

What's the status on this? Isn't this something that was already implemented, or do I misunderstand it?

@neikeq
Copy link
Member

neikeq commented Jul 21, 2016

This is already done as a module, but @reduz mentioned above that he would prefer it to be part of the engine. If that's going to happen, it would need some refactoring (I could try doing it) since as shown in this source file I had to duplicate code from different parts that were not exposed for this kind of usage or that were hard coded in classes like TextEdit.

@razcore-rad
Copy link
Contributor

Alright @neikeq I'm very interested in this, how can I help? I would like this to be included in godot so people that want completion don't have to recompile the thing. I am looking into ways to add autocompletion to vim/neovim with YCMD and your module. So what exactly needs refactoring?

@PLyczkowski

This comment has been minimized.

@rosshadden
Copy link
Contributor

👍 This would be a huge advancement for workflows using neovim or vim. Or Atom, even, if you're into that.

@ficoos
Copy link
Contributor Author

ficoos commented Mar 13, 2017

Just wanted to give a signal boost and to say that since this was submitted Microsoft came out with the Language Server Protocol to solve this exact problem.

@GordianDziwis
Copy link

A completer for ycm would be really great. Currently there are clients for the following editors:

  • Vim
  • Emacs
  • Atom
  • Sublime
  • Kakoune
  • Visual Studio
  • Geany
  • GNU Nano

With neikeq module already existing, this looks like a low hanging fruit.

@rosshadden
Copy link
Contributor

It sounds like integrating this into the engine might give anyone that adds their own language through GDNative the ability to additionally add their own completion support, instead of it just being for GDScript. Which would be a huge win!

@nsrosenqvist
Copy link

Just wanting to add that LSP (Language Server Protocol) is become a more widely adopted standard now and that it is probably the best way forward for this. Atom recently announced Atom IDE which is built around LSP and GNOME Builder have had integrations built around it for a year or so.

@rosshadden
Copy link
Contributor

Great! We've been talking about YCM a lot but that's just an implementation detail. Supporting any thing like LSP or YCM will be a very big milestone for external editor workflows.

@ghost ghost added the usability label Oct 10, 2017
@nsrosenqvist
Copy link

nsrosenqvist commented Oct 12, 2017

Microsoft also have the debugger adapter protocol for VSCode (also what Atom plans to use) which is the debugger equivalent of LSP. Link to repo: https://github.com/Microsoft/vscode-debugadapter-node

@emersonmx
Copy link

Dead? 😕

@Anudin
Copy link

Anudin commented Apr 2, 2019

Bump. I don't mind using the built in editor but a LSP server would be a game changer.

@obsoke
Copy link

obsoke commented Apr 2, 2019

This would be a huge win for Godot, IMO. I appreciate the effort put into the built-in editor but I'd rather use the editors I work with on a daily basis. An LSP would help in enabling that type of workflow.

I'd be happy to help contribute to this effort!

@zohozer
Copy link

zohozer commented Jun 13, 2019

Seems that there is a GSOC project that will bring LSP support to Godot.

https://summerofcode.withgoogle.com/organizations/6553848640962560/#6258227275104256

Some very preliminary extension for VSCode it is online:

https://marketplace.visualstudio.com/items?itemName=AnkitPriyarup.gdscript-lsp-extension#overview

@creikey
Copy link
Contributor

creikey commented Jul 16, 2019

I can try implementing this, sounds relatively simple

@Calinou
Copy link
Member

Calinou commented Jul 16, 2019

@creikey This is already being worked on in #29780.

@Lorespo
Copy link

Lorespo commented Dec 13, 2019

Are there any developments? I've tried to add @neikeq module's to godot 3.1.2 but i've run into an unrecognised type while building

@akien-mga
Copy link
Member

Fixed by #29780.

@akien-mga akien-mga added this to the 3.2 milestone Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests