A comprehensive sample plugin demonstrating all the capabilities available in the Code on the Go plugin system.
- Main Editor Tabs - Full-featured tabs alongside code editor tabs
- Bottom Sheet Integration - Multiple tabs in the editor bottom sheet
- Sidebar Navigation - Actions and navigation items in the side menu
- Main Menu Integration - Menu items in the application menu bar
- Documentation System - Integrated help and tooltips using IdeTooltipService
- Service Integration - Full access to all IDE services
IPlugin- Core plugin interfaceUIExtension- UI contributions (bottom sheet, sidebar, menus)EditorTabExtension- Main editor tab integrationDocumentationExtension- Tooltip and help system integration
This plugin demonstrates comprehensive documentation support through the IdeTooltipService:
- DocumentationExtension Interface - Plugin implements this to provide tooltips
- IdeTooltipService - Service that displays interactive help tooltips
- PluginTooltipEntry - Individual help topics with HTML content
- Long-press Tooltips - UI elements support long-press for contextual help
- Category System - Plugin documentation organized by category (
plugin_sample) - Rich HTML Content - Support for formatted text, lists, and styling
- Context-Aware Help - Different help content based on usage context
- Interactive Buttons - Tooltip buttons for additional resources
- Multi-level Content - Summary and detailed explanations
// Show tooltip on any view
tooltipService?.showTooltip(
anchorView = button,
category = "plugin_sample",
tag = "sample_plugin.overview"
)
// Long-press tooltip setup
view.setOnLongClickListener {
tooltipService?.showTooltip(
anchorView = it,
category = "plugin_sample",
tag = "sample_plugin.main_tab"
)
true
}sample-plugin/
├── build.gradle.kts # Build configuration
├── proguard-rules.pro # ProGuard rules
├── src/main/
│ ├── AndroidManifest.xml # Plugin metadata
│ ├── kotlin/com/example/sampleplugin/
│ │ ├── SamplePlugin.kt # Main plugin class
│ │ └── fragments/
│ │ └── SampleFragment.kt # Reusable fragment
│ └── res/
│ ├── layout/
│ │ └── fragment_sample.xml # Fragment layout
│ └── values/
│ └── strings.xml # String resources
└── README.md # This file
- plugin.id - Unique plugin identifier
- plugin.name - Display name
- plugin.version - Version string
- plugin.description - Plugin description
- plugin.author - Author information
- plugin.min_ide_version - Minimum IDE version
- plugin.permissions - Required permissions
- plugin.main_class - Main plugin class path
The plugin demonstrates usage of all available IDE services:
IdeProjectService- Project information and manipulationIdeUIService- UI interactions (toasts, dialogs)IdeTooltipService- Documentation and help tooltipsIdeFileService- File system operationsIdeBuildService- Build status monitoringIdeEditorTabService- Editor tab management
# Build release plugin
./gradlew assemblePlugin
# Build debug plugin
./gradlew assemblePluginDebug- Release:
build/plugin/sample-plugin.cgp - Debug:
build/plugin/sample-plugin-debug.cgp
- Copy the
.cgpfile to Code on the Go's plugins directory - Restart the IDE or use the plugin manager to reload
- The plugin will be automatically loaded and activated
- Use sidebar → "Open Sample Plugin" to open the main tab
- Full-screen interface with all plugin features
- Tab can be closed and reopened as needed
- Open any file in the editor
- Access bottom sheet tabs: "Sample Tab" and "Tools"
- Compact interface optimized for quick access
- Open sidebar menu
- Look for "Tools" group
- Find "Open Sample Plugin" and "Sample Action" items
- Long-press any UI element for contextual help
- Click "Show Help" button for immediate tooltip
- Different help content based on current context
- Rich HTML tooltips with interactive elements
- Change package name in all files
- Update plugin metadata in AndroidManifest.xml
- Modify fragment layout and functionality
- Add your own service integrations
- Customize documentation entries
- Implement
DocumentationExtension - Define
getTooltipCategory()with unique identifier - Create
PluginTooltipEntryobjects with:- tag - Unique identifier within category
- summary - Brief HTML description
- detail - Comprehensive HTML content
- buttons - Optional action buttons
- Use
IdeTooltipServiceto display tooltips
// Get services in fragment
val serviceRegistry = PluginFragmentHelper.getServiceRegistry(PLUGIN_ID)
val tooltipService = serviceRegistry?.get(IdeTooltipService::class.java)
// Use services
tooltipService?.showTooltip(anchorView, category, tag)plugin-api- Code on the Go Plugin API (compileOnly)androidx.fragment- Fragment supportandroidx.appcompat- AppCompat librarymaterial- Material Design components
- Minimum IDE version: 1.0.0
- Required permissions:
filesystem.read,filesystem.write,project.structure - Android API: 26+ (Android 8.0)
- Kotlin version: 2.1.21+
This sample plugin is provided as-is for educational and development purposes. Use it as a foundation for creating your own Code on the Go plugins.