vidarlib

package module
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2023 License: MPL-2.0 Imports: 0 Imported by: 0

README

Vidar Libraries

This repository contains libraries for interacting with Vidar, intended for implementing plugins.

Versioning

Starting with v0.7.0, only major (v0.x.0) releases will be tagged, corresponding to the same major version of vidar itself. We may make minor (non-go-related) changes in the mean time, but any changes to the go module force a major version change in vidar, and go will always pick up new tags as new module versions.

Libraries

vidar-lib provides the following types of libraries:

Earthfile

The Earthfile in this repository is intended for building vidar and any plugins that are built for vidar. It provides a common base OS (with all necessary dependencies installed) and scripts for testing/building plugins for specific versions of vidar.

Use earthly doc or view the earthfile for more information.

User Defined Commands

Since earthly doc does not (currently) document UDCs, this is just a note that there are some UDCs provided for plugins to use. At the time of this writing, CHECK_DEPS and SYNC_DEPS were provided to check/sync a go.mod file against the dependencies of a specific version of vidar; but check the Earthfile for more information.

Go

Go Reference

Most of these libraries contain interface types and little else. The reason for this is to provide a common place for parameter and return types for methods to be defined. This allows plugins to define local interface types that refer to implementations in Vidar without actually importing any of Vidar's core libraries.

The main purpose of separating imports this way is so that plugins don't have to be rebuilt for every bugfix and minor version of Vidar itself. Go's plugin package requires that a plugin and the importing package have the exact same version of all shared libraries. If we define these interfaces in the packages where they're used, then plugins would have to be rebuilt for every single bugfix version of Vidar that makes any change to those common packages.

This also allows us to provide these small interface types under a more permissive license, while keeping the main body of work of the editor itself under a more copyleft license.

License

All files in this package are licensed under version 2 of the Mozilla Public License. A copy of this license has been included in LICENSE in the top level of this repository.

Plugin Development Guide

If you want a guide on how to create a plugin, please read the plugin development guide. General help on developing plugins is included there, and more specific information can be found in the godoc documentation for sub-packages.

Documentation

Overview

Package vidarlib contains APIs intended for plugins to use to access parts of vidar. Most of the code contained in these sub-packages is interface type definitions which vidar uses for parameter and return types. This way, plugins can define local interface types which vidar implements without importing any code directly from vidar.

Directories

Path Synopsis
Package constant contains various types intended to be defined in const blocks, as well as any constant values that may need to be defined for the whole project.
Package constant contains various types intended to be defined in const blocks, as well as any constant values that may need to be defined for the whole project.
Package inform includes helper functions for informing the user about errors, warnings, etc.
Package inform includes helper functions for informing the user about errors, warnings, etc.
Package input contains the types that vidar uses to process user input.
Package input contains the types that vidar uses to process user input.
Package lsp contains some sugar for setting up language server protocol servers for vidar to interact with.
Package lsp contains some sugar for setting up language server protocol servers for vidar to interact with.
package pref provides types used when passing preferences to plugins.
package pref provides types used when passing preferences to plugins.
Package ui contains the interface types that a UI library needs to implement in order for vidar to be able to use it to draw windows with.
Package ui contains the interface types that a UI library needs to implement in order for vidar to be able to use it to draw windows with.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL