pub struct KotlinCompletionProvider;Expand description
Kotlin-specific completion provider (fallback)
This is a fallback provider for Kotlin code when external LSP (kotlin-language-server) is unavailable.
§Behavior
Generates Kotlin-specific completions including:
- Kotlin keywords (fun, class, interface, object, data, sealed, enum, etc.)
- Kotlin-specific snippets (function declarations, class definitions, etc.)
- Kotlin modifiers (val, var, const, open, override, etc.)
- Available symbols from code context
§When Used
- External LSP (kotlin-language-server) is not configured
- kotlin-language-server is not installed or fails to start
- kotlin-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 Kotlin completions, install and configure kotlin-language-server:
# Download and install Kotlin Language Server
# See: https://github.com/fwcd/kotlin-language-serverThen configure it in lsp-servers.yaml:
servers:
kotlin:
- language: kotlin
executable: kotlin-language-server
enabled: trueSee https://github.com/moabualruz/ricecoder/wiki/External-LSP-Configuration.md for details.
Trait Implementations§
Source§impl CompletionProvider for KotlinCompletionProvider
impl CompletionProvider for KotlinCompletionProvider
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 KotlinCompletionProvider
impl RefUnwindSafe for KotlinCompletionProvider
impl Send for KotlinCompletionProvider
impl Sync for KotlinCompletionProvider
impl Unpin for KotlinCompletionProvider
impl UnwindSafe for KotlinCompletionProvider
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