Skip to content

Instantly share code, notes, and snippets.

@ankitpriyarup
Last active September 5, 2019 03:53
Show Gist options
  • Save ankitpriyarup/20b1727dbb678bf1cf10a51f14bbc0e2 to your computer and use it in GitHub Desktop.
Save ankitpriyarup/20b1727dbb678bf1cf10a51f14bbc0e2 to your computer and use it in GitHub Desktop.

It was an incredible learning experience with GSoC and Godot Engine! I can’t believe three months have passed so quick that I’m writing this final report, summarizing all the exciting work I did in these Summers (27 May - 26 Aug 2019).

Project Name: GDScript Language Server
Student: Ankit Priyarup (@ankitpriyarup)
Mentors: Geequlim (@geequlim) and Jiacheng Lu (@jason0214)
Repositories:

Pull Requests:

What's the project?:

Integrated script editor in Godot lacks features found in editors like VS Code, Sublime, Emacs, etc. These editors are also more popular among developers and therefore are better to switch for usability. However, to implement core functionalities such as - Diagnosis, Registering custom symbols, jump to definition, etc a Language Server structure has to be adopted. For example, the client (say vs code) will communicate the godot language server to give desired result.

Microsoft's Language Server Protocol (LSP) is flexible and powerful to implement these functionalities. It also supports many editors - VS Code, Atom, Sublime, etc. Hence, instead of writing complete extensions for each editor (client) using LSP servers can be reused while the client which is an editor extension has to be only re-written.

Installation:

Currently, the pull request is still yet to be merged with the actual Godot working repository. To run the LSP implementation, client and server both needs to be run seperately. Client (https://github.com/godotengine/godot-vscode-plugin) Server (https://github.com/godotengine/godot) Client is a vscode extension, open it inside VS Code and first install required dependencies using npm install command after that running will simply open the client in Extension Development Environment. To create an output extension format from the project use vsce, you can learn more about it from here https://code.visualstudio.com/api/working-with-extensions/publishing-extension

GSoC Journey:

Community Bounding Period
I started off with getting familliar with Godot code base and understanding the previous implementation of Godot Tools. I also got familliar with my metor and other developers over IRC.

Coding Period #1 (May 27,2019 - June 24,2019)
My mentor, Geequlim already had a basic version of LSP server and client for vscode implemented so my task was to improve upon it try to identify possible point of failures and also include all the features. At first we implemented Error Diagnostics - Everytime there's a change detected by the LSP Server from client and diagnostics are updated i.e. Errors and warnings along with their relevant informations such as Range and message are being parsed by an Extended GDScript Parser.

Coding Period #2 (June 28,2019 - July 22,2019)
Geequlim have been very active throughout, during this period initially he implemented an entire symbol cache pool while I was working on Code Completion Feature. The cache pool is filled at the startup by parsing all scripts in the workspace for script symbols and loading native symbols from DocData. Later on I used that symbol pool to implement features such as - Hover Provider, Function Assist, Symbol Resolve & Go to definition.

At the end of this period I started with implementing a documentation system. It started off with me understanding what will be good for VS Code plugin, originally Godot relies on Sphinx for rendering mardown docs but I realized that it's better to stick with markdown because of it's good compatibility with VS Code.

I've also worked on a rename symbol feature during this time which I couldn't complete as there were cases it was still missing (ankitpriyarup/godot#5), I'm looking forward to fixing it post GSoC period.

Coding Period #3 (July 26,2019 - August 19,2019)
I improved upon the Markdown rendering system, I added link system in it so that one can jump to other class documentation by clicking on it's name within docs. Next I added a Regex parser is capable of parsing the class name on 'View Symbol Documentation' incase parsed symbol isn't recognised list of all the symbols will be shown.

Lastly I implemented Document Link support for direct access of files within gdscript using ctrl + click or cmd + click on path string, relative paths are also supported.

Majority of my task within final month revolved around testing the framework on larger open source GDScript projects. Bugs are regularly being tracked.

Acknowledgment:

I would like to thank my mentor and the folks at Godot for offering their advice and help when reviewing my code and also when answering my queries on the community IRC chat. These three months have been best coding experience of my life. Thanks to Google for providing me this amazing opportunity of working with Godot. I've learnt a lot within this period.

I'm looking forward to contribute and work upon things that I missed post-GSoC and also encourage others who wish to contribute to this part of codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment