pub struct DartCompletionProvider;Expand description
Dart-specific completion provider (fallback)
This is a fallback provider for Dart code when external LSP (dart-language-server) is unavailable.
§Behavior
Generates Dart-specific completions including:
- Dart keywords (class, abstract, interface, mixin, enum, extension, etc.)
- Dart-specific snippets (class declarations, method definitions, etc.)
- Dart modifiers (var, final, const, late, required, etc.)
- Available symbols from code context
§When Used
- External LSP (dart-language-server) is not configured
- dart-language-server is not installed or fails to start
- dart-language-server times out or becomes unresponsive
§Limitations
- No type inference or semantic analysis
- Cannot resolve imports or dependencies
- No project-aware completions
- Cannot determine variable scope or type information
- Limited to hardcoded keywords and patterns
§Recommended Configuration
For production-quality Dart completions, install and configure dart-language-server:
# Dart SDK includes the language server
dart pub global activate dart_language_serverThen configure it in lsp-servers.yaml:
servers:
dart:
- language: dart
executable: dart
args: ["language-server"]
enabled: trueSee https://github.com/moabualruz/ricecoder/wiki/External-LSP-Configuration.md for details.
Trait Implementations§
Source§impl CompletionProvider for DartCompletionProvider
impl CompletionProvider for DartCompletionProvider
Source§fn generate_completions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_code: &'life1 str,
_position: Position,
context: &'life2 CompletionContext,
) -> Pin<Box<dyn Future<Output = CompletionResult<Vec<CompletionItem>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn generate_completions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_code: &'life1 str,
_position: Position,
context: &'life2 CompletionContext,
) -> Pin<Box<dyn Future<Output = CompletionResult<Vec<CompletionItem>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Generate completions for this language Read more
Auto Trait Implementations§
impl Freeze for DartCompletionProvider
impl RefUnwindSafe for DartCompletionProvider
impl Send for DartCompletionProvider
impl Sync for DartCompletionProvider
impl Unpin for DartCompletionProvider
impl UnwindSafe for DartCompletionProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more