pub struct JavaCompletionProvider;Expand description
Java-specific completion provider (fallback)
This is a fallback provider for Java code when external LSP (jdtls) is unavailable.
§Behavior
Generates Java-specific completions including:
- Java keywords (abstract, class, interface, public, private, static, etc.)
- Java-specific snippets (class declarations, method definitions, etc.)
- Java primitive types (int, long, double, boolean, etc.)
- Available symbols from code context
§When Used
- External LSP (jdtls) is not configured
- jdtls is not installed or fails to start
- jdtls 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 Java completions, install and configure jdtls:
# Download and install Eclipse JDT Language Server
# See: https://github.com/eclipse/eclipse.jdt.lsThen configure it in lsp-servers.yaml:
servers:
java:
- language: java
executable: jdtls
enabled: trueSee https://github.com/moabualruz/ricecoder/wiki/External-LSP-Configuration.md for details.
Trait Implementations§
Source§impl CompletionProvider for JavaCompletionProvider
impl CompletionProvider for JavaCompletionProvider
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 JavaCompletionProvider
impl RefUnwindSafe for JavaCompletionProvider
impl Send for JavaCompletionProvider
impl Sync for JavaCompletionProvider
impl Unpin for JavaCompletionProvider
impl UnwindSafe for JavaCompletionProvider
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