code_forge 8.1.1
code_forge: ^8.1.1 copied to clipboard
A sophisticated code editor package with AI completion, LSP support, syntax highlighting, and advanced editing capabilities.
1.0.0 #
🎉 Initial Release
CodeForge is a sophisticated, feature-rich code editor widget for Flutter applications, inspired by VS Code and Monaco Editor. This release introduces a comprehensive set of editing capabilities with modern developer experience features.
✨ Core Features #
📝 Advanced Text Editing
- Efficient Text Management: Uses rope data structures for optimal performance with large files
- Multi-language Syntax Highlighting: Support for numerous programming languages via
re_highlight - Code Folding: Visual fold/unfold indicators with automatic range detection
- Smart Indentation: Auto-indentation with customizable behavior
- Bracket Matching: Automatic bracket highlighting and matching
- Line Operations: Move lines up/down, duplicate lines, smart indentation
- Word Navigation: Ctrl+arrow key navigation and word-level deletion
🎨 Customizable UI & Theming
- Flexible Styling: Extensive customization options for all UI elements
- Theme Support: Built-in VS2015 dark theme with full customization
- Gutter Customization: Line numbers, fold icons, error/warning highlighting
- Selection Styling: Custom cursor colors, selection highlighting, cursor bubbles
- Overlay Styling: Suggestion popups, hover documentation with themes
- Font Integration: Custom icon fonts for completion items (auto-loaded)
🔧 Developer Experience
- Undo/Redo System: Sophisticated operation merging with timestamp-based grouping
- Read-only Mode: Optional read-only editing for display purposes
- Auto-focus: Automatic focus on widget mount
- Line Wrapping: Configurable line wrapping vs horizontal scrolling
- Indentation Guides: Visual guides for code structure
- Search Highlighting: Highlight search results and matches
🚀 Language Server Protocol (LSP) Integration #
- Full LSP Support: Complete Language Server Protocol implementation
- Semantic Highlighting: Advanced token-based syntax coloring
- Intelligent Completions: Context-aware code completion with custom icons
- Hover Documentation: Rich hover information with markdown support
- Diagnostics Integration: Real-time error and warning display
- Multiple Server Types: Support for stdio and WebSocket LSP servers
- Document Synchronization: Bidirectional sync with LSP servers
- Error Gutter: Visual error/warning indicators in line numbers
🤖 AI-Powered Code Completion #
- Multi-Model Support: Integration with Gemini and extensible to other AI models
- Completion Modes: Auto, manual, and mixed completion triggering
- Smart Debouncing: Prevents excessive API calls during typing
- Response Processing: Intelligent parsing and code cleaning
- Custom Instructions: Configurable AI prompts for different use cases
- Caching: Response caching for improved performance
🎯 Key Capabilities #
Performance & Efficiency
- Optimized Rendering: Custom viewport with efficient repaint management
- Large File Support: Handles files of any size with rope-based operations
- Debounced Operations: Semantic token updates and AI requests are debounced
- Memory Efficient: Minimal memory footprint with smart caching
Integration & Extensibility
- Flutter Native: Seamless integration with Flutter's text input system
- Custom Controllers: Flexible controller architecture for advanced use cases
- Event Streaming: LSP response streaming for real-time updates
- Plugin Architecture: Extensible design for custom features
Accessibility & UX
- Keyboard Shortcuts: Full keyboard navigation support
- Context Menus: Right-click context menus with copy/paste/select-all
- Visual Feedback: Loading states, error handling, and user feedback
- Mobile Support: Touch-friendly interactions for mobile platforms
📚 Documentation & Examples #
- Comprehensive API Docs: Fully documented public APIs with examples
- Example Application: Complete working example in
/example/ - Type Safety: Strong typing throughout the codebase
- Error Handling: Robust error handling with user-friendly messages
🔧 Technical Highlights #
- Pure Dart: No native dependencies, works on all Flutter platforms
- Widget Architecture: Built as a proper Flutter widget with state management
- Custom Rendering: Optimized rendering pipeline for code editing
- Test Coverage: Comprehensive test suite for reliability
- Linting: Follows Flutter best practices and linting rules
🎨 Supported Languages & Features #
Syntax Highlighting: Dart, Python, JavaScript, TypeScript, Java, C++, C#, Go, Rust, PHP, Ruby, Swift, Kotlin, Scala, and many more via re_highlight
LSP Servers: Compatible with any LSP-compliant language server (Dart Analysis Server, Pyright, TypeScript, etc.)
AI Models: Gemini integration with extensible architecture for other providers
This release establishes CodeForge as a powerful, production-ready code editor for Flutter applications, offering the same level of sophistication found in professional code editors while maintaining Flutter's declarative UI paradigm.
1.0.1 #
- Updated README.md
1.0.2 #
- Updated README.md
1.1.0 #
- Fixed keyboard would not appear in Android.
- Added more public API methods in the controller, such as copy, paste, selectAll, cut, arrow key navigations, etc
1.2.0 #
- FEATURE: Added LSP Code Actions.
- FEATURE: Enhanced AI Completion for large files.
- FEATURE: Added more public method APIs in the controller and the LspConfig class.
- FIX: Completion bug in the first line.
1.2.1 #
- suggestion/code actions persist on screen.
1.3.0 #
- FIX: Editor width had been determined by the width of the longest line, fixed it by using the viewport width.
- FIX: Changed filePath based LSP initialization to workspace based approach to manage multiple files from a single server instance.
- FIX: Tapping the end of the longest line won't focus the editor.
1.3.1 #
- Updated README
1.4.0 #
- FEATURE: Added LSP
completionItem/resolveto show documentation for completion items. - FEATURE: Added LSP auto import.
- FEATURE: Theme based dynamic color for suggestion popup.
1.5.0 #
- FIX: Backspace, delete, undo-redo, etc works on read-only mode.
2.0.0 #
- REFACTOR: Moved the LSP configuration and logic from the
CodeForgeto theCodeForgeController. - FIX: Code action persists on mobile.
2.1.0 #
- FEATURE: Added more public APIs in the
CodeForgeController.
2.2.0 #
- FIX: Asynchronous highlighting.
- FIX: Delayed LSP diagnostic lints.
3.0.0 #
- FEATURE: Find and highlight multiple words with the new
FindWordControllerAPI. Seperate styling is available for both focused word and unfocued words. - FEATURE: Double click to select a word is now available in desktop also.
- FIX: Code reslove for focused suggestion persists on the screen.
- FIX: Removed cut, paste and other writing operations from read only mode.
- FIX: Line wrap wasn't responsive on resizing the screen.
- FIX: Suggestions persists on cursor movement.
4.0.0 #
- ENHANCEMENT: Enhanced
FindWordControllerfor efficient word searching. - FEATURE: Added new
finderBuilderAPI to implement the find-replace serach bar. - FEATURE: Added keyboard shortcuts Ctrl + F and Ctrl + H to show the find-replace search bar.
- FIX: Scroll doesn't work after selecting a word.
4.1.0 #
- FEATURE: Added semantic highlight support for the custom protocol used by the
cclslanguage server.
4.2.0 #
- FEATURE: Added LSP signature help.
- ENHANCEMENT: Improved and responsive selection tool bar for mobile.
4.3.0 #
- FEATURE: BiDi support in
Ropedata structure. - FEATURE: Immutable rope operations - insert and delete.
5.0.0 #
- FEATURE: Added git diff support:
- ENHANCEMENT: Removed built-in AI completion and APi calls, user can use
controller.setGhostText(). - ENHANCEMENT: Enhanced large text handling.
5.0.1 #
- Updated README
5.1.0 #
- FEATURE: Scoll to the desired line using the
controller.scrollToLine(int line)API. - ENHANCEMENT: Removed unused http package.
5.2.0 #
- ENHANCEMENT: Greatly enhanced large text handling.
6.0.0 #
6.1.0 #
- FEATURE: Added more public API methods to the controller.
•duplicateLine()
•moveLineDown()
•moveLineUp()
•callSignatureHelp() - ENHANCEMENT: LSP suggestions color
7.0.0 #
-
FEATURE: Added
LspClientCapabilitiesclass to selectively enable/disable LSP features during initialization.
•semanticHighlighting— Enable/disable semantic token highlighting
•codeCompletion— Enable/disable code completion suggestions
•hoverInfo— Enable/disable hover documentation
•codeAction— Enable/disable code actions and quick fixes
•signatureHelp— Enable/disable signature help
•documentColor— Enable/disable document color detection
•documentHighlight— Enable/disable document highlighting
•codeFolding— Enable/disable code folding
•inlayHint— Enable/disable inlay hints
•goToDefinition— Enable/disable "go to definition"
•rename— Enable/disable symbol renaming -
FEATURE: Added
deleteFoldRangeOnDeletingFirstLineparameter toCodeForgewidget as requested in #24. When set totrue, deleting the entire first line of a folded block will delete the whole folded region. -
ENHANCEMENT: Mobile context menu toolbar now persists after "Select All" action.
-
ENHANCEMENT: Repositioned code action bulb icon on mobile to avoid overlap with fold icons and gutter.
-
ENHANCEMENT: LSP methods now check capability flags before executing, returning early with appropriate empty values when features are disabled.
-
ENHANCEMENT: Dynamic capability building during LSP initialization — only enabled features are advertised to the language server.
-
FEATURE: Inlay hints and color picker:
- Added LSP inlay hints and Colour picker as requested in #22.
Inlay hint demo: https://github.com/user-attachments/assets/658fd76f-5650-4374-b44d-58db69813e66
Color pciker demo: https://github.com/user-attachments/assets/a7e1795c-83ca-411f-9c1d-81c8d4949926
- Added LSP inlay hints and Colour picker as requested in #22.
-
FEATURE: Added doucment highlight as requested in #22.
-
FEATURE: Added arrow key navigation for LSP suggestions in mobile as requested in #21.
-
FIX: #25
-
FIX: Fixed action icon misposition in mobile as requested in #23
8.0.0 #
✨ Major Features #
🌍 RTL (Right-to-Left) Language Support
- FEATURE: Added comprehensive RTL support for right-to-left languages (Arabic, Hebrew, etc.)
- Added
textDirectionparameter toCodeForgewidget to control text layout direction - Gutter automatically positions on the right side for RTL mode
- Text rendering properly aligned for RTL languages with full visual direction support
- Caret positioning and movement follow visual direction (not logical) for intuitive editing
- Selection highlighting works correctly for RTL text
- All UI elements (fold icons, line numbers, indentation guides) properly mirrored for RTL
- Bracket pair highlighting supports RTL
- Scroll behavior adapted for RTL layout
- Added
🔤 RTL Text Input & Navigation
- FEATURE: Arrow keys follow visual direction for RTL
- Left arrow visually moves left (logically moves right in RTL)
- Right arrow visually moves right (logically moves left in RTL)
- Home key moves to visual line start (line end in RTL)
- End key moves to visual line end (line start in RTL)
- Ctrl+Arrow word navigation follows visual direction for RTL
- FEATURE: Arabic and Hebrew word detection for code completion
- Updated word pattern matching to include Arabic (U+0600-U+06FF), Extended Arabic (U+08A0-U+08FF), and Hebrew (U+0590-U+05FF) Unicode ranges
- LSP suggestions now work correctly for RTL languages
- Word cache includes RTL script characters
- Fold icons display correctly for RTL (< for folded, down arrow for unfolded)
🎯 Hover Documentation Improvements #
- ENHANCEMENT: Improved hover popup positioning and visibility
- Hover documentation now positions above cursor if space is limited below
- Better width constraints and viewport-aware positioning
- Added hover content caching for improved performance
- Hover content is fetched asynchronously without blocking rendering
- Diagonal offset adjustment prevents hover from blocking cursor area
- ENHANCEMENT: Hover triggered by tap on mobile/desktop now persists properly
- Added
onHoverSetByTapcallback for better tap-based hover handling - Hover state properly managed to avoid flicker
- Added
🔧 Code Improvements & Fixes #
- FIX: Auto-indentation now only triggers on single Enter key press
- Paste operations no longer re-indent pasted multi-line content incorrectly
- Only the first newline in pasted text triggers auto-indent
- FIX: CCLS semantic highlighting refresh debouncing
- Added
_scheduleCclsRefreshwith 1 second debounce to avoid excessive document saves - CCLS servers that use custom semantic token protocol now work more reliably
- Added
- ENHANCEMENT: Better suggestion popup positioning
- Popup now positions above cursor when limited space below
- Horizontal alignment adjusted to stay within viewport
- Improved mobile responsiveness
📊 Internal Changes #
- Modified paragraph style to respect textDirection property
- Added RTL-aware cache invalidation for paragraph building
- Improved caret info calculation for RTL text positioning
- Enhanced text offset to line/char conversion for RTL
- Selection handle positioning adapted for RTL layout
- Ghost text (AI completion) positioning corrected for RTL
- Inlay hints and document colors properly positioned for RTL
8.0.1 #
- FEATURE: Added
clearAllSuggestions()API on controller to clear all suggestions. - Updated README.
8.1.0 #
- ENHANCEMENT: Enhanced RTL support
8.1.1 #
- FEATURE: added a public API called
acceptSuggestionin the controller to manually accept LSP suggestions.