CompletionContext
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| Generic typing Abstract base class for generic types. |
⋔ Inheritance diagram¶
graph TD
3154893150["completion.CompletionContext"]
3481597255["typing.Generic"]
2751680898["builtins.object"]
3481597255 --> 3154893150
2751680898 --> 3481597255
🛈 DocStrings¶
Context for completion operations.
Class Type Parameters:
| Name | Bound or Constraints | Description | Default |
|---|---|---|---|
TCommandData
|
Type of the data in the associated CommandContext. Used when completions need to access the command context data. |
required |
Source code in src/slashed/completion.py
command_context
property
¶
command_context: CommandContext[TCommandData]
Get command execution context.
Returns:
| Type | Description |
|---|---|
CommandContext[TCommandData]
|
Command context |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If command context is not set |
__init__
¶
__init__(document: Document, command_context: CommandContext[TCommandData] | None = None) -> None
Initialize completion context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
document
|
Document
|
Current document being completed |
required |
command_context
|
CommandContext[TCommandData] | None
|
Optional command execution context |
None
|