Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
596970c
feat: implement all REST endpoints from IntelliJ plugin
Artur- Aug 14, 2025
9cbaec9
feat: implement core REST endpoint functionality
Artur- Aug 14, 2025
a31de1f
feat: add comprehensive integration test suite
Artur- Aug 15, 2025
43eb163
refactor: restructure project as multi-module build with test fragment
Artur- Aug 15, 2025
044fe08
Fix REST service to work properly in headless test environment
Artur- Aug 15, 2025
58dbc9d
Implement remaining REST endpoints for Copilot integration
Artur- Aug 15, 2025
123cbb0
Complete implementation of all REST endpoints for Eclipse plugin
Artur- Aug 15, 2025
1feb662
Add comprehensive project documentation in AGENTS.md
Artur- Aug 15, 2025
90d6898
fix: Proper binary file undo/redo with base64 encoding
Artur- Aug 15, 2025
11afab8
feat: Add Spotless Maven plugin for code formatting
Artur- Aug 15, 2025
136661f
Fix Eclipse IDE import errors by exporting packages from main plugin
Artur- Aug 15, 2025
37bf668
docs: Update AGENTS.md with Eclipse IDE import fix
Artur- Aug 15, 2025
8c2739d
Make it work
Artur- Aug 15, 2025
e62fed1
feat: Add New Vaadin Project wizard
Artur- Aug 15, 2025
cdefc63
fix packages
Artur- Aug 15, 2025
bd7247b
test: Add comprehensive VaadinProjectAnalyzer tests
Artur- Aug 15, 2025
fc510e7
fix: Fix nested folder issue in New Vaadin Project wizard
Artur- Aug 15, 2025
8f72681
feat: Add Run/Debug on Server hook for WAR file injection
Artur- Aug 18, 2025
312c1ce
fix: Fix test failures in VaadinProjectAnalyzer and AdvancedEndpoints
Artur- Aug 18, 2025
8578116
fix: Fix VaadinProjectAnalyzer test failures
Artur- Aug 18, 2025
98eed56
fix: Extract zip contents directly to project root without nested folder
Artur- Aug 21, 2025
3969bc4
feat: Improve New Vaadin Project wizard UI
Artur- Aug 21, 2025
7344067
debug: Add logging to CopilotUndoManager for troubleshooting
Artur- Aug 21, 2025
c97178d
feat: Add Maven and Gradle nature to imported projects
Artur- Aug 21, 2025
1c3e600
feat: Automatically update Maven configuration after project import
Artur- Aug 21, 2025
44f67d0
fix: Force Maven configuration update from pom.xml
Artur- Aug 21, 2025
bceeec0
fix: Move Maven update after project import and refresh
Artur- Aug 21, 2025
c7d0e80
fix: Run Maven update as background job with proper delay
Artur- Aug 21, 2025
0cb0117
refactor: Import Maven projects directly using M2E API
Artur- Aug 21, 2025
db801e1
debug: Add detailed logging to Maven import process
Artur- Aug 21, 2025
fe896ae
fix: Add M2E as optional dependency to enable Maven project import
Artur- Aug 22, 2025
c84cb75
fix: Use M2E API directly with mandatory dependency
Artur- Aug 22, 2025
91eec01
fix: Fix Maven project import and compilation errors
Artur- Aug 22, 2025
3cf57d0
fix: Change groupId to com.example.application for project generation
Artur- Aug 22, 2025
ec10e43
feat: Add .copilot-plugin dotfile management for Vaadin projects
Artur- Aug 22, 2025
2ca9166
fix: Fix REST service not listening on reported port
Artur- Aug 22, 2025
1b1571b
spotless:apply
Artur- Aug 23, 2025
2836da2
feat: Implement Debug with Hotswap Agent support
Artur- Aug 22, 2025
f9836e1
fix: Fix JVM argument formatting for Hotswap Agent
Artur- Aug 22, 2025
b9b0f32
feat: Add 'Debug As > Java Application using Hotswap Agent' menu option
Artur- Aug 22, 2025
21abe31
fix: Fix JVM argument parsing for Hotswap Agent launch
Artur- Aug 22, 2025
a79466c
refactor: Remove redundant 'Vaadin > Debug with Hotswap Agent' menu o…
Artur- Aug 22, 2025
74cdf37
Fix arguments
Artur- Aug 22, 2025
ea64096
test: Add comprehensive tests for project creation wizard
Artur- Aug 22, 2025
3f9f534
feat: Make hello.txt available as classpath resource in deployed appl…
Artur- Aug 22, 2025
8e8bc00
refactor: Generate hello.txt during build instead of deployment
Artur- Aug 23, 2025
bf95b25
refactor: Simplify Vaadin dependency detection to use classpath only
Artur- Aug 23, 2025
33d7b26
refactor: Use Gson for JSON manipulation in flow-build-info.json
Artur- Aug 23, 2025
4a587fd
refactor: Replace manual JSON error strings with Gson in CopilotRestS…
Artur- Aug 23, 2025
7dfc9b0
refactor: Add helper methods for JSON response creation in CopilotRes…
Artur- Aug 23, 2025
114838e
fix: Remove feature reference from category.xml to fix CI build
Artur- Aug 23, 2025
9d3451d
docs: Condense AGENTS.md to essential information only
Artur- Aug 23, 2025
a03015e
docs: Update IntelliJ plugin limitations with accurate comparisons
Artur- Aug 23, 2025
f455b97
docs: Simplify TESTING.md to contain only generic testing information
Artur- Aug 23, 2025
f99895b
test: Add comprehensive test for Maven multi-module projects in getMo…
Artur- Aug 23, 2025
de50a0e
feat: Use Vaadin logo for New Project wizard
Artur- Aug 23, 2025
bb6bec8
refactor: Remove sample code and placeholder content
Artur- Aug 25, 2025
dd986bf
refactor: Remove unnecessary custom launcher delegate
Artur- Aug 26, 2025
1f235a4
fix: Prevent resource tree lock error during project creation
Artur- Aug 26, 2025
016f583
fix: Update project creation URLs to use correct parameters
Artur- Aug 26, 2025
59bbaaf
fix: Improve "Debug as Vaadin" functionality and availability
Artur- Sep 1, 2025
75a618a
fix: Make Starter and Hello World project types mutually exclusive
Artur- Sep 1, 2025
e68dcfc
feat: Show only relevant options based on selected project type
Artur- Sep 1, 2025
4d9ab6d
fix: Correct architecture parameter value for Hello World projects
Artur- Sep 1, 2025
74a6fc8
fix: Improve Gradle project import and dependency resolution
Artur- Sep 1, 2025
94516e9
fix: Improve Maven and Gradle project configuration for Kotlin support
Artur- Sep 1, 2025
00c64fa
fix: Use Buildship API directly with optional dependency for Gradle p…
Artur- Sep 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ local.properties
.settings/
.loadpath
.recommenders

target
.mvn
.vscode
6 changes: 6 additions & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Expand Down
113 changes: 113 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Vaadin Eclipse Plugin - Copilot Integration

## Project Overview

Eclipse plugin providing Copilot integration for Vaadin projects through a REST API interface. The plugin starts an embedded HTTP server that communicates with Vaadin Copilot for AI-assisted development.

## REST API Endpoints

All endpoints receive POST requests with JSON containing:
- `command`: The operation to perform
- `projectBasePath`: The project's file system path
- `data`: Command-specific parameters

### File Operations
- **write** - Write text content (params: `file`, `content`, `undoLabel`)
- **writeBase64** - Write binary content as base64 (params: `file`, `content`, `undoLabel`)
- **delete** - Delete files with undo tracking (params: `file`)
- **refresh** - Refresh project in workspace

### IDE Integration
- **showInIde** - Open file in editor (params: `file`, `line`, `column`)
- **undo/redo** - Perform undo/redo (params: `files` array, returns: `performed`)

### Project Analysis
- **getVaadinRoutes** - Find @Route annotated classes
- **getVaadinComponents** - Find Vaadin Component subclasses (params: `includeMethods`)
- **getVaadinEntities** - Find JPA @Entity classes (params: `includeMethods`)
- **getVaadinSecurity** - Find Spring Security configurations
- **getVaadinVersion** - Detect Vaadin version from classpath
- **getModulePaths** - Get project structure information

### Build & Execution
- **compileFiles** - Trigger incremental build (params: `files` array)
- **restartApplication** - Restart launch configurations (params: `mainClass` optional)
- **reloadMavenModule** - Refresh Maven modules (params: `moduleName` optional)
- **heartbeat** - Service health check

## Build Commands

```bash
# Format code (REQUIRED before committing)
mvn spotless:apply

# Compile only
mvn clean compile

# Run tests
mvn clean install

# Skip tests
mvn clean install -DskipTests
```

## Implementation Status

### ✅ Completed
- All core REST endpoints
- File operations with undo/redo support
- Binary file handling with base64 encoding
- Project analysis for Vaadin elements
- Eclipse IDE integration
- Comprehensive integration tests
- New Vaadin Project wizard
- Hotswap Agent support with JetBrains Runtime
- Build-time flow-build-info.json generation

### ⚠️ Limitations vs IntelliJ Plugin
1. **Architecture**: Monolithic switch-based handler vs individual handler classes
2. **Undo/Redo**: Simple per-file tracking vs IntelliJ's UndoManager integration
3. **Compilation**: No error tracking service (IntelliJ has CompilationStatusManagerService)
4. **Endpoint Discovery**: Basic annotation scanning vs microservices framework integration
5. **Project Events**: Basic open/close listeners vs comprehensive ProjectManagerListener
6. **Hilla Support**: No @Endpoint/@BrowserCallable detection (IntelliJ has VaadinHillaEndpointsProvider)

## Known Issues

1. **Headless limitations**: Some UI operations don't work in test environment
2. **No operation batching**: Multiple rapid operations aren't grouped for undo
3. **Undo/redo in tests**: Operation history context not properly initialized in test environment
4. **Java project classpath**: VaadinProjectAnalyzer tests fail due to classpath nesting issues

## Testing

### Test Coverage
- **CopilotRestServiceIntegrationTest** - REST endpoints with real workspace operations
- **CopilotClientIntegrationTest** - Client-server communication and endpoint contracts
- **VaadinProjectAnalyzerTest** - Project analysis functionality
- **NewVaadinProjectWizardTest** - Project creation wizard

Tests run in headless Eclipse environment with temporary workspace creation and automatic cleanup.

## Future Enhancements

### High Priority
1. Refactor to handler-based architecture
2. Add compilation status tracking service
3. Implement operation batching for undo/redo
4. Add comprehensive unit tests for analyzer and undo manager

### Medium Priority
1. Add project event listeners for automatic dotfile management
2. Implement Hilla endpoint discovery
3. Create centralized error handling service
4. Add VCS awareness for file operations

## Technical Notes

- **Port**: Dynamically assigned, communicated via dotfiles in `.vaadin/copilot/`
- **Java Version**: JavaSE-17
- **Eclipse Target**: 2024-03 release
- **Key Dependencies**: Eclipse JDT, Debug Core, Gson
- **Builder**: VaadinBuildParticipant automatically generates flow-build-info.json for projects with Vaadin dependencies
- **Hotswap**: Requires JetBrains Runtime for hot code replacement support
12 changes: 0 additions & 12 deletions META-INF/MANIFEST.MF

This file was deleted.

141 changes: 141 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Vaadin Eclipse Plugin - Testing Guide

## Test Architecture

The plugin uses a comprehensive testing approach with integration tests that validate the complete REST API functionality against real Eclipse workspace operations.

## Test Organization

Tests are organized as Eclipse test fragments that run within the OSGi runtime environment. This ensures accurate testing of Eclipse-specific functionality including:

- Workspace and resource management
- Project lifecycle operations
- Editor integration
- Build system interactions

## Running Tests

### Maven Build
```bash
# Run all tests
mvn clean install

# Skip tests
mvn clean install -DskipTests

# Run specific test class
mvn test -Dtest=TestClassName
```

### Eclipse IDE
1. Import project as existing Maven project
2. Right-click test class → Run As → JUnit Plug-in Test
3. Tests run in a separate Eclipse runtime workbench

### Manual Testing
For manual validation of REST endpoints:
1. Launch Eclipse with the plugin installed
2. Check console for REST service port
3. Use REST client tools to test endpoints
4. Verify operations in Eclipse workspace

## Test Coverage Areas

### Core Functionality
- REST API endpoint validation
- File operations (create, read, update, delete)
- Binary file handling with Base64 encoding
- Directory structure creation
- Workspace synchronization

### Integration Points
- Eclipse resource API integration
- Java project analysis
- Build system triggers
- Editor operations
- Undo/redo framework

### Error Handling
- Invalid file paths
- Project boundary validation
- Malformed requests
- Concurrent operation safety
- Resource cleanup

## Test Best Practices

### Test Isolation
- Each test creates temporary projects
- Automatic cleanup after test completion
- No shared state between tests
- Random port allocation for REST service

### Validation Approach
- HTTP status code verification
- Response content validation
- File system state verification
- Eclipse workspace consistency checks
- Thread safety validation

### Performance Considerations
- Tests use in-memory workspace when possible
- Minimal disk I/O for faster execution
- Parallel test execution where applicable
- Resource pooling for repeated operations

## Continuous Integration

Tests are designed to run in headless environments:
- No UI dependencies for core tests
- Configurable workspace location
- Exit codes for build system integration
- XML test reports for CI tools

## Troubleshooting

### Common Issues
- **OSGi resolution failures**: Check MANIFEST.MF dependencies
- **Port conflicts**: Service uses dynamic port allocation
- **Workspace locks**: Ensure proper cleanup in tearDown
- **Permission errors**: Verify file system permissions

### Debug Options
```bash
# Enable verbose logging
mvn test -Dorg.eclipse.equinox.http.jetty.log.stderr.threshold=DEBUG

# Run with Eclipse console
-consoleLog -console
```

## Test Maintenance

### Adding New Tests
1. Extend appropriate base test class
2. Use existing test utilities
3. Follow naming conventions
4. Document test purpose
5. Ensure cleanup in tearDown

### Updating Tests
- Keep tests focused on behavior, not implementation
- Update tests when API contracts change
- Maintain backwards compatibility tests
- Document breaking changes

## Quality Metrics

Target metrics for test suite:
- Code coverage: >80% for core functionality
- Test execution time: <5 minutes for full suite
- Flakiness rate: <1% failure rate
- Clear failure messages for debugging

## Future Improvements

Planned enhancements to testing infrastructure:
- Mock framework for external dependencies
- Performance benchmarking suite
- Stress testing for concurrent operations
- Integration with mutation testing tools
- Automated UI testing with SWTBot
8 changes: 8 additions & 0 deletions build.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="Running Platform">
<locations>
<repository location="https://download.eclipse.org/releases/2024-03" />
<location path="${eclipse_home}" type="Profile" />
</locations>
</target>
Binary file removed icons/sample.png
Binary file not shown.
Binary file removed icons/[email protected]
Binary file not shown.
67 changes: 0 additions & 67 deletions plugin.xml

This file was deleted.

Loading