neikeq / gd-autocomplete-service Goto Github PK
View Code? Open in Web Editor NEWGodot module that provides autocomplete suggestions via HTTP requests
License: MIT License
Godot module that provides autocomplete suggestions via HTTP requests
License: MIT License
As you might have seen, I've commented on the godotengine/godot#2245 about including this in the code base and I've been looking at YCMD and it only provides information about the current line the cursor is on, not the full script text and I was wondering why would you need the whole text file? Plus, if you have large files wouldn't this be slow?
In vim/neovim I think there are ways to access the whole text file and if not I could still just use python to read the file from the disk it's just that I don't understand why you need all of it...
Can you compatibilize with GDNative for include it without compiling?
So I'm trying to make autocompletion work for vim but even before getting to that the server always gives me 404 status. I tried with
curl -H 'Content-Type: application/json; charset=UTF-8' -H 'Connection: keep-alive' -H 'Accept: application/json' -X POST -d '{"path": "/home/razvan/Projects/github/debug/addons/KOBUGE-games.CircularContainer/register.gd", "text": "", "cursor": {"row": 0, "column": 0}, "meta": ""}' -v http://localhost:6070
and the response I get is:
* Rebuilt URL to: http://localhost:6070/
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 6070 (#0)
> POST / HTTP/1.1
> Host: localhost:6070
> User-Agent: curl/7.50.1
> Content-Type: application/json; charset=UTF-8
> Connection: keep-alive
> Accept: application/json
> Content-Length: 155
>
* upload completely sent off: 155 out of 155 bytes
< HTTP/1.1 404 Not Found
< server: Godot Auto-complete Service
< connection: keep-alive
< content-length: 0
<
* Connection #0 to host localhost left intact
So I have no idea what I'm doing wrong. The /home/razvan/Projects/github/debug/addons/KOBUGE-games.CircularContainer/register.gd
is just in a debug project use for something else but it has these GDScript files. I'm running only one godot instance.
Thanks!
Many of the include paths need to be updated. and the root dir needs to have the code in it so that the code can be cloned into the modules folder. The repo needs to be named with underscores instead of dashes, or the compile will fail for some reason.
In the following files I think the OBJ_TYPE lines need to be changed to GDCLASS:
code_completion_server.h: GDCLASS(CodeCompletionServer, Object);
code_completion_service.h: GDCLASS(CodeCompletionService, Node);
completion_service_plugin.h: GDCLASS(CompletionServicePlugin, EditorPlugin);
And there is still one final error that I do not yet know how to overcome. At the end of compile I get the following error:
scons -j8 platform=x11
scons: Reading SConscript files ...
Enabling ALSA
Enabling PulseAudio
Checking for C header file mntent.h... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
[ 7%] Compiling ==> modules/autocomplete_service/register_types.cpp
[100%] progress_finish(["progress_finish"], [])
[100%] Linking Program ==> bin/godot.x11.tools.64
[100%] modules/libmodules.x11.tools.64.a(register_types.x11.tools.64.o): In function `EditorPlugin* EditorPlugins::creator<CompletionServicePlugin>(EditorNode*)':
godot/modules/autocomplete_service/../../editor/editor_plugin.h:255: undefined reference to `CompletionServicePlugin::CompletionServicePlugin(EditorNode*)'
collect2: error: ld returned 1 exit status
scons: *** [bin/godot.x11.tools.64] Error 1
scons: building terminated because of errors.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.