pub struct TypeScriptCompletionProvider;Expand description
TypeScript-specific completion provider (fallback)
This is a fallback provider for TypeScript/JavaScript code when external LSP (typescript-language-server) is unavailable.
§Behavior
Generates TypeScript-specific completions including:
- TypeScript keywords (function, const, let, class, interface, type, enum, etc.)
- TypeScript-specific snippets (function templates, class definitions, etc.)
- TypeScript utility types (Record, Partial, Required, Pick, Omit, etc.)
- TypeScript decorators
- Generic type patterns
- Available symbols from code context
§When Used
- External LSP (typescript-language-server) is not configured
- typescript-language-server is not installed or fails to start
- typescript-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 TypeScript completions, install and configure typescript-language-server:
npm install -g typescript-language-server typescriptThen configure it in lsp-servers.yaml:
servers:
typescript:
- language: typescript
executable: typescript-language-server
args: ["--stdio"]
enabled: trueSee https://github.com/moabualruz/ricecoder/wiki/External-LSP-Configuration.md for details.
Trait Implementations§
Source§impl CompletionProvider for TypeScriptCompletionProvider
impl CompletionProvider for TypeScriptCompletionProvider
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 TypeScriptCompletionProvider
impl RefUnwindSafe for TypeScriptCompletionProvider
impl Send for TypeScriptCompletionProvider
impl Sync for TypeScriptCompletionProvider
impl Unpin for TypeScriptCompletionProvider
impl UnwindSafe for TypeScriptCompletionProvider
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