Zum Hauptinhalt springen

Plugin API Reference

This page documents the public API available to ONE WARE Studio plugins through OneWare.Essentials and OneWare.UniversalFpgaProjectSystem.

Module Lifecycle

IOneWareModule

The core interface every plugin must implement (typically via OneWareModuleBase):

public interface IOneWareModule
{
string Id { get; }
IReadOnlyCollection<string> Dependencies { get; }
void RegisterServices(IServiceCollection services);
void Initialize(IServiceProvider serviceProvider);
}
MemberDescription
IdModule identifier (defaults to class name)
DependenciesModule IDs that must initialize before this one
RegisterServicesPhase 1: register types into the DI container
InitializePhase 2: resolve services and register extensions

OneWareModuleBase

Abstract base class providing sensible defaults:

public abstract class OneWareModuleBase : IOneWareModule
{
public virtual string Id => GetType().Name;
public virtual IReadOnlyCollection<string> Dependencies => Array.Empty<string>();
public virtual void RegisterServices(IServiceCollection services) { }
public virtual void Initialize(IServiceProvider serviceProvider) { }
}

Service Resolution

Use the Resolve<T>() extension method on IServiceProvider:

var windowService = serviceProvider.Resolve<IWindowService>();

This first tries GetService<T>(), then falls back to ActivatorUtilities.CreateInstance<T>().


Core Services

IWindowService

UI management — menus, dialogs, notifications, and UI extensions.

MethodDescription
RegisterMenuItem(key, items)Inject menu items by path (e.g., "MainWindow_MainMenu/View/Tool Windows")
RegisterUiExtension(key, extension)Add UI to named extension points
GetUiExtensions(key)Retrieve registered UI extensions
Show(window)Open a window
ShowDialogAsync(window)Open a modal dialog
ShowMessageBoxAsync(...)Show a message box
ShowNotification(...)Toast notification
ShowNotificationWithButton(...)Notification with action button
ShowInputAsync(...)Text input dialog
ShowFolderSelectAsync(...)Folder picker dialog
ActivateMainWindow()Bring main window to foreground

IMainDockService

Dockable panel and document management.

MethodDescription
RegisterDocumentView<T>(extensions)Map file extensions to document view models
RegisterFileOpenOverwrite(action, extensions)Override open behavior for specific extensions
RegisterLayoutExtension<T>(location)Add dockable tool window (Bottom, Left, Right)
Show<T>()Display a dockable view
OpenFileAsync(fullPath)Open a file in the editor
CloseFileAsync(fullPath)Close a document

ISettingsService

Persistent settings registration and access.

MethodDescription
RegisterSettingCategory(name)Create a settings group
RegisterSettingSubCategory(parent, name)Create a sub-group
Register<T>(key, defaultValue)Register a setting with type and default
GetSettingValue<T>(key)Read current value
SetSettingValue(key, value)Write value
GetSettingObservable<T>(key)Reactive observable for UI binding
Bind<T>(key, observable)Two-way bind a setting

IProjectExplorerService

Project tree manipulation and context menus.

MethodDescription
AddProject(root)Add a project to the explorer
TryCloseProjectAsync(root)Close a project
SaveProjectAsync(root)Save project state
RegisterConstructContextMenu(action)Add items to the right-click context menu
GetEntryFromFullPath(path)Resolve a path to a project entry node
ImportAsync(target, files)Import files into a project

IProjectManagerService

Project type registration.

MethodDescription
RegisterProjectManager(id, manager)Register a project type handler
GetManager(id)Resolve a project manager by type ID
GetManagerByExtension(ext)Resolve by file extension

Language & Editor Services

ILanguageManager

Language support registration — syntax highlighting, LSP, and type assistance.

MethodDescription
RegisterTextMateLanguage(id, grammarPath, extensions)Register TextMate grammar for highlighting
RegisterLanguageExtensionLink(source, target)Map one extension to another's language
RegisterService(type, workspaceDependent, fileTypes)Register an LSP language service
RegisterStandaloneTypeAssistance(type, fileTypes)Register editor assistance without LSP
GetLanguageService(fullPath)Resolve language service for a file

IErrorService

Diagnostic reporting.

MethodDescription
RegisterErrorSource(source)Register a named error source
RefreshErrors(errors, source, filePath)Replace diagnostics for a file
Clear(source)Clear all diagnostics from a source
GetErrorsForFile(filePath)Get diagnostics for a specific file

IOutputService

Output panel logging.

MethodDescription
WriteLine(text, color, owner)Append a line to the output panel
Write(text, color, owner)Append inline text

Tool & Package Services

IToolService

External tool registration and execution.

MethodDescription
Register(toolContext, strategy)Register a tool with its execution strategy
RegisterStrategy(toolKey, strategy)Add an alternative strategy for a tool
GetAllTools()List registered tools
GetStrategy(toolKey)Get active strategy for a tool

IPackageService

Downloadable package management (tools, plugins, hardware).

MethodDescription
RegisterPackage(package)Register a downloadable package
RegisterPackageRepository(url)Add a package repository URL
InstallAsync(packageId, version)Install a package
RemoveAsync(packageId)Uninstall a package
RefreshAsync()Refresh package metadata

IChildProcessService

External process execution.

MethodDescription
ExecuteShellAsync(path, args, workDir, status, ...)Run a tool with UI status tracking
StartChildProcess(startInfo)Start a managed child process
Kill(process)Terminate a process

IEnvironmentService

Environment variable management for tool execution.

MethodDescription
SetEnvironmentVariable(key, value)Set an environment variable
SetPath(key, path)Add to PATH

UI Extension Points

Register UI components at named locations using IWindowService.RegisterUiExtension:

KeyLocation
MainWindow_RoundToolBarExtensionMain toolbar row
UniversalFpgaToolBar_CompileMenuExtensionCompile button dropdown
UniversalFpgaToolBar_PinPlannerMenuExtensionPin planner menu
UniversalFpgaToolBar_DownloaderConfigurationExtensionDownload configuration area
CompileWindow_TopRightExtensionPin planner window (top right)
EditView_TopTop of editor panel

Register menu items using IWindowService.RegisterMenuItem with these path prefixes:

  • MainWindow_MainMenu/File
  • MainWindow_MainMenu/Edit
  • MainWindow_MainMenu/View/Tool Windows
  • MainWindow_MainMenu/Extras
  • MainWindow_MainMenu/Help

FPGA Project System

Available when depending on OneWare.UniversalFpgaProjectSystem.

FpgaService

Central registry for FPGA extension points.

MethodDescription
RegisterFpgaPackage(package)Register a hardware package
RegisterFpgaExtensionPackage(package)Register a board extension
RegisterToolchain<T>()Register an FPGA toolchain
RegisterLoader<T>()Register a programming/download tool
RegisterSimulator<T>()Register a simulation tool
RegisterTemplate<T>()Register a project template
RegisterPreCompileStep<T>()Add a pre-compile hook
RegisterNodeProvider<T>()Register HDL node extraction
RegisterLanguage(ext, name)Register an HDL language for FPGA projects
RegisterProjectEntryModification(action)Custom project explorer adornments

Key Interfaces

InterfacePurpose
IFpgaToolchainSynthesis/place-and-route implementation
IFpgaLoaderDevice programming
IFpgaSimulatorSimulation execution
IFpgaProjectTemplateNew project file generation
IFpgaPreCompileStepPre-compile processing
INodeProviderHDL signal/port extraction for pin planning

Project Properties

FPGA projects (.fpgaproj) store configuration as JSON key-value pairs:

KeyDescription
topEntityRelative path to the top-level HDL file
toolchainActive toolchain ID
loaderActive loader ID
fpgaSelected FPGA package name
include / excludeGlob patterns for file inclusion
testBenchesRelative paths marked as test benches
compileExcludedFiles excluded from compilation

Miscellaneous Services

ServiceDescription
IPathsApp directories: AppDataDirectory, PackagesDirectory, PluginsDirectory, TempDirectory
IFileIconServiceRegister file extension icons
IHttpServiceDownload files, archives, images, and text
IApplicationStateServiceStatus tracking, notifications, shutdown hooks
IWelcomeScreenServiceAdd items to the welcome screen
IChatService / IChatManagerServiceAI chat provider integration
ITerminalManagerServiceExecute commands in terminal panes

Plugin Loading & Compatibility

Plugins are loaded via IPluginService.AddPlugin(path):

  1. Plugin folder is copied to a session directory
  2. All .dll files are scanned and loaded
  3. Assemblies are checked for IOneWareModule implementations
  4. RegisterServices() is called on discovered modules
  5. Initialize() is called in dependency-sorted order

The compatibility.txt file at the plugin root declares required host dependencies:

OneWare.Essentials : 1.0.0
OneWare.UniversalFpgaProjectSystem : 1.0.0

Version checking is enforced by PluginCompatibilityChecker. Incompatible plugins are flagged but not loaded.