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

GSoC Project Outline for a .NET API Client #8337

Closed
b-r-o-c-k opened this Issue May 1, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@b-r-o-c-k
Copy link
Contributor

b-r-o-c-k commented May 1, 2018

As a student for Google Summer of Code 2018, I will be working on a C# API client library for the .NET platform. I am very excited to have the opportunity to contribute to Neovim this summer with guidance from my mentor @justinmk. Here are the implementation details and timeline from my proposal:

Implementation Details

  • Asynchronous design: The Task-based Asynchronous Pattern (TAP) will be used because is the most common design pattern for .NET applications. Each API method will allow for asynchronous invocation with the C# async keyword. The library will allow Neovim requests and notifications to be handled through assigned callbacks, which will also be called asynchronously.
  • Auto-generated method definitions: C# and most .NET languages are statically-typed and object-oriented making it suitable to provide classes containing methods that correspond to each Neovim API function. A small utility bundled with the library will be created to automatically generate these method definitions using the API metadata received from nvim --api-info.
  • Support for different transports: There are three types of transports Neovim supports: stdin/stdout streams, IPC sockets (Unix domain sockets and Windows named pipes), and TCP/IP sockets. The library will support all of them and also provide a method for starting nvim with specific command-line arguments.
  • Test suite: To ensure everything is working properly, a test suite using the Microsoft Test Framework (MSTest V2) will be included in the project. The tests will be based on the ones in the Python API client reference implementation and the CI services will be configured to run them after each build.
  • Continuous integration: The CI services AppVeyor and Travis CI will be integrated with the repository to verify that the tests pass on both Windows and Linux. The method definitions will also be generated as part of the CI process.
  • Documentation and examples: It’s important to provide clear and detailed documentation to make it easier for others to use. Neovim is very well-documented and the API client deserves the same quality of documentation. It will also be helpful to include some examples showing simple usage of the library to help developers start using it.

Timeline

May 14 - June 3 (4 weeks):

  • Set up a C# project that is .NET Standard 2.0 compatible.
  • Integrate the msgpack-cli library for handling the MessagePack protocol and the Microsoft Test Framework (MSTest V2) for testing. Documentation and tests will be written throughout the course of development.
  • Create MessagePack data types for serializing and deserializing Neovim messages.
  • Add functionality for starting a Neovim process and communicating with it through stdin/stdout streams.

June 4 - July 1 (4 weeks):

  • Implement the RPC interface that will allow Neovim RPC functions to be asynchronously called.
  • Add the ability to handle notifications by registering callbacks for them.
  • Create a utility for generating classes and method definitions from the API metadata received by starting nvim with the --api-info argument.
  • Verify there is an adequate amount of test coverage and all tests are passing.

July 2 - July 15 (2 weeks):

  • Make it possible to install the library as a NuGet package.
  • Integrate AppVeyor and Travis CI services into the GitHub repository.
  • Create build scripts that will run the method generation utility, build the project, run the tests, create a NuGet package and upload it to the NuGet Gallery.

July 16 - July 29 (2 weeks):

  • Add support for communicating with Neovim through Unix domain sockets, Windows named pipes, and TCP/IP sockets. Transport layers other than stdin/stdout will be implemented toward the end of the project because they are lower priority.

July 30 - August 6 (1 week):

  • Revise and improve the documentation.
  • Add example code demonstrating usage of the library.
@b-r-o-c-k

This comment has been minimized.

Copy link
Contributor Author

b-r-o-c-k commented Aug 14, 2018

.NET API Client

The API client is finished with all features listed in the comment above. It allows plugins to be created by using method attributes for specifying functions, commands, and autocommands that will be exported by the plugin. It is similar to other Neovim API clients, but the library also provides XML documentation for all API methods and a simpler way of handling UI events.

Visual Studio Extension

After completing my proposed project ahead of schedule, I spent the remainder of my time creating a basic Visual Studio extension called VSNvim that integrates most of Neovim's functionality inside of the IDE. The extension supports Visual Studio 2017 and is written in C++/CLI so it can interact seamlessly with both the .NET extension API and the libnvim C API. The extension should allow most of Neovim's functionality to be used, however, more work needs to be done to better integrate it with Visual Studio.


Participating in GSoC was very exciting and educational. I would like to thank my mentor @justinmk for his guidance and also the Neovim organization for giving me the opportunity to learn and contribute.

@b-r-o-c-k b-r-o-c-k closed this Aug 14, 2018

@neovim neovim locked as resolved and limited conversation to collaborators Mar 17, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.