Skip to content

Add completion method to LSPManager #15

Description

@amondnet

Summary

Implement the completion() method in LSPManager to support code completion via the LSP textDocument/completion request. This is essential functionality for providing intelligent code suggestions in the AI coding assistant.

Tasks

  • Define completion method signature with proper LSP parameter types (position, context, etc.)
  • Implement LSP request handling for textDocument/completion
  • Support both CompletionList and CompletionItem[] response formats
  • Handle completion item details (label, kind, documentation, insertText, etc.)
  • Add TypeScript types for completion items and list responses
  • Implement proper error handling and edge cases
  • Add unit tests for completion method
  • Update documentation with completion method usage examples
  • Follow LSP 3.17 specification requirements

Acceptance Criteria

  • completion() method is implemented in LSPManager
  • Method correctly sends textDocument/completion requests to language servers
  • Returns properly typed completion items with all relevant fields
  • Handles both CompletionList and CompletionItem[] response formats
  • All unit tests pass
  • Documentation is updated with method signature and examples
  • TypeScript types are properly exported

Additional Context

This follows the pattern established by recent methods like definition() and references() in the LSPManager class. The implementation should integrate seamlessly with the existing LSP client infrastructure.

Related to code completion support for AI-assisted coding in the @pleaseai/code package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lspp1Priority 1 - Hightype:featureNew feature or request

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions