canopus 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +55 -0
- data/README.md +191 -19
- data/assets/keymaps/emacs.jsonc +5 -0
- data/assets/keymaps/jetbrains.jsonc +5 -0
- data/assets/keymaps/sublime.jsonc +5 -0
- data/assets/keymaps/vscode.jsonc +5 -0
- data/docs/debugging.md +143 -0
- data/docs/distribution.md +40 -9
- data/docs/lsp.md +131 -0
- data/docs/performance.md +18 -0
- data/docs/providers.md +36 -0
- data/docs/release-log.md +12 -0
- data/docs/tasks.md +64 -0
- data/docs/testing.md +49 -0
- data/docs/vim.md +3 -0
- data/exe/canopus +4 -1
- data/lib/canopus/buffer.rb +291 -50
- data/lib/canopus/cli.rb +5 -2
- data/lib/canopus/command.rb +13 -4
- data/lib/canopus/controller.rb +183 -40
- data/lib/canopus/debug/breakpoints.rb +550 -0
- data/lib/canopus/debug/configuration.rb +291 -0
- data/lib/canopus/debug/console.rb +243 -0
- data/lib/canopus/debug/panel.rb +487 -0
- data/lib/canopus/debug/session.rb +354 -0
- data/lib/canopus/decoration.rb +4 -2
- data/lib/canopus/denebola_compat.rb +27 -0
- data/lib/canopus/diagnostics.rb +173 -0
- data/lib/canopus/display_map/overlay_map.rb +6 -2
- data/lib/canopus/editor/snippet_expandable.rb +3 -2
- data/lib/canopus/editor.rb +122 -31
- data/lib/canopus/git/state.rb +100 -0
- data/lib/canopus/language/background_analysis.rb +93 -14
- data/lib/canopus/language/document.rb +70 -34
- data/lib/canopus/language/symbol.rb +1 -0
- data/lib/canopus/language/syntax_worker.rb +61 -9
- data/lib/canopus/language.rb +3 -0
- data/lib/canopus/minimap.rb +201 -0
- data/lib/canopus/patch.rb +3 -1
- data/lib/canopus/plugins/api.rb +4 -2
- data/lib/canopus/plugins/isolated_runtime.rb +64 -7
- data/lib/canopus/plugins/registry.rb +114 -3
- data/lib/canopus/plugins.rb +8 -7
- data/lib/canopus/project.rb +15 -6
- data/lib/canopus/provider.rb +192 -0
- data/lib/canopus/regexp_compat.rb +36 -4
- data/lib/canopus/selection.rb +12 -0
- data/lib/canopus/settings/schema.rb +201 -0
- data/lib/canopus/settings.rb +328 -49
- data/lib/canopus/task/configuration.rb +356 -0
- data/lib/canopus/task/problem_matcher.rb +264 -0
- data/lib/canopus/task/runner.rb +314 -0
- data/lib/canopus/test_runner/bounded_ignore.rb +144 -0
- data/lib/canopus/test_runner/discovery.rb +97 -0
- data/lib/canopus/test_runner/execution.rb +194 -0
- data/lib/canopus/test_runner/minitest.rb +116 -0
- data/lib/canopus/test_runner/rspec.rb +103 -0
- data/lib/canopus/test_runner/safe_walker.rb +37 -0
- data/lib/canopus/test_runner.rb +54 -0
- data/lib/canopus/theme/import.rb +131 -0
- data/lib/canopus/theme.rb +28 -4
- data/lib/canopus/version.rb +1 -1
- data/lib/canopus/vim/motionable.rb +1 -1
- data/lib/canopus/vim.rb +10 -16
- data/lib/canopus/workspace/auto_savable.rb +83 -0
- data/lib/canopus/workspace/debug_aware.rb +600 -0
- data/lib/canopus/workspace/edit/plan.rb +2 -2
- data/lib/canopus/workspace/editor_configurable.rb +113 -0
- data/lib/canopus/workspace/file_change_aware.rb +11 -3
- data/lib/canopus/workspace/git_aware.rb +80 -34
- data/lib/canopus/workspace/git_blame.rb +175 -0
- data/lib/canopus/workspace/git_conflict_resolution.rb +410 -0
- data/lib/canopus/workspace/git_diff_view.rb +641 -0
- data/lib/canopus/workspace/git_history.rb +171 -0
- data/lib/canopus/workspace/git_remote.rb +267 -0
- data/lib/canopus/workspace/git_staging.rb +583 -0
- data/lib/canopus/workspace/hierarchy_aware.rb +477 -0
- data/lib/canopus/workspace/keymap_aware.rb +66 -0
- data/lib/canopus/workspace/language_aware.rb +3721 -135
- data/lib/canopus/workspace/language_server_configurable.rb +287 -71
- data/lib/canopus/workspace/persistent_undo.rb +169 -0
- data/lib/canopus/workspace/problems_aware.rb +131 -0
- data/lib/canopus/workspace/project_searchable.rb +88 -11
- data/lib/canopus/workspace/project_tree_editable.rb +3 -1
- data/lib/canopus/workspace/recoverable.rb +204 -0
- data/lib/canopus/workspace/session_persistable.rb +85 -13
- data/lib/canopus/workspace/settings_aware.rb +76 -2
- data/lib/canopus/workspace/task_aware.rb +194 -0
- data/lib/canopus/workspace/test_aware.rb +394 -0
- data/lib/canopus/workspace/trust.rb +73 -0
- data/lib/canopus/workspace/view/terminal_presentable.rb +298 -47
- data/lib/canopus/workspace/view.rb +399 -74
- data/lib/canopus/workspace.rb +688 -44
- data/lib/canopus.rb +20 -2
- data/sig/canopus.rbs +138 -31
- data/sig/controller.rbs +10 -3
- data/sig/debug.rbs +121 -0
- data/sig/decoration.rbs +12 -2
- data/sig/diagnostics.rbs +26 -0
- data/sig/minimap.rbs +20 -0
- data/sig/provider.rbs +29 -0
- data/sig/services.rbs +1 -16
- data/sig/task.rbs +92 -0
- data/sig/test_runner.rbs +109 -0
- data/sig/trust.rbs +17 -0
- data/sig/workspace_edits.rbs +2 -2
- data/sig/workspace_services.rbs +234 -2
- data/tools/check_dependencies.rb +21 -2
- data/tools/package.rb +172 -14
- data/tools/package_signature_test.rb +33 -0
- data/tools/package_test.rb +29 -0
- data/tools/sign_package.rb +123 -0
- data/tools/update.rb +189 -0
- data/tools/update_test.rb +71 -0
- metadata +206 -31
- data/lib/canopus/lsp/client.rb +0 -307
- data/lib/canopus/lsp/error.rb +0 -7
- data/lib/canopus/lsp/future/subscription.rb +0 -9
- data/lib/canopus/lsp/future.rb +0 -87
- data/lib/canopus/lsp/protocol.rb +0 -83
- data/lib/canopus/lsp/server_error.rb +0 -13
- data/lib/canopus/lsp/timeout.rb +0 -7
- data/lib/canopus/lsp/transport.rb +0 -123
- data/lib/canopus/lsp.rb +0 -19
- data/lib/canopus/project/search.rb +0 -164
- data/lib/canopus/project/search_worker/cancelled.rb +0 -3
- data/lib/canopus/project/search_worker/runner.rb +0 -9
- data/lib/canopus/project/search_worker.rb +0 -108
- data/lib/canopus/terminal/cell.rb +0 -7
- data/lib/canopus/terminal/grid.rb +0 -321
- data/lib/canopus/terminal/pty.rb +0 -178
- data/lib/canopus/terminal/scrollback.rb +0 -38
- data/lib/canopus/terminal/vt.rb +0 -398
- data/lib/canopus/terminal.rb +0 -13
- data/sig/lsp.rbs +0 -99
- data/sig/terminal.rbs +0 -130
data/sig/lsp.rbs
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
module Canopus
|
|
2
|
-
module LSP
|
|
3
|
-
type json = nil | bool | Integer | Float | String | Array[json] | Hash[String | Symbol, json]
|
|
4
|
-
type object = Hash[String | Symbol, json]
|
|
5
|
-
type semantic_token = { line: Integer, character: Integer, length: Integer, type: Integer, modifiers: Integer }
|
|
6
|
-
|
|
7
|
-
class Error < StandardError
|
|
8
|
-
end
|
|
9
|
-
class Timeout < Error
|
|
10
|
-
end
|
|
11
|
-
class ServerError < Error
|
|
12
|
-
attr_reader code: Integer
|
|
13
|
-
attr_reader data: json
|
|
14
|
-
def initialize: (Hash[String, json] error) -> void
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
module Protocol
|
|
18
|
-
def self.uri: (String path) -> String
|
|
19
|
-
def self.path: (String uri) -> String
|
|
20
|
-
def self.position: (Denebola::Rope rope, Integer offset) -> { line: Integer, character: Integer }
|
|
21
|
-
def self.offset: (Denebola::Rope rope, Hash[String, Integer] position) -> Integer
|
|
22
|
-
def self.range: (Denebola::Rope rope, Range[Integer] range) -> object
|
|
23
|
-
def self.uint?: (untyped value) -> bool
|
|
24
|
-
def self.diagnostics: (Array[object] values) -> Array[object]
|
|
25
|
-
def self.semantic_delta: (Array[Integer] data, Array[Hash[String, json]] edits) -> Array[Integer]
|
|
26
|
-
def self.semantic_tokens: (Array[Integer] data, ?legend: Hash[String, Array[String]]?) -> Array[semantic_token]
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
class Future
|
|
30
|
-
class Subscription
|
|
31
|
-
def initialize: () { () -> untyped } -> void
|
|
32
|
-
def detach: () -> untyped
|
|
33
|
-
end
|
|
34
|
-
attr_reader id: Integer | String | nil
|
|
35
|
-
attr_reader callback_errors: Array[Error]
|
|
36
|
-
def initialize: (Integer | String | nil id, ?on_error: ^(Error) -> untyped) ?{ (Integer | String | nil) -> untyped } -> void
|
|
37
|
-
def fulfill: (?untyped value, ?error: Exception?) -> Future?
|
|
38
|
-
def then: () { (untyped, Exception?) -> untyped } -> Future
|
|
39
|
-
def done?: () -> bool
|
|
40
|
-
def on_complete: () { () -> untyped } -> Subscription
|
|
41
|
-
def await: (?timeout: Numeric?) -> untyped
|
|
42
|
-
def cancel: () -> bool
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
class Transport
|
|
46
|
-
MAX_MESSAGE: Integer
|
|
47
|
-
attr_reader stderr_lines: Array[String]
|
|
48
|
-
attr_reader pid: Integer
|
|
49
|
-
def initialize: (Array[String] command, ?cwd: String?, ?env: Hash[String, String?]) { (Hash[String, json]?, Exception?) -> untyped } -> void
|
|
50
|
-
def self.read_message: (IO | StringIO io) -> Hash[String, json]?
|
|
51
|
-
def self.validate_message: (untyped message) -> Hash[String, json]
|
|
52
|
-
def write: (object message) -> untyped
|
|
53
|
-
def alive?: () -> bool
|
|
54
|
-
def close: () -> untyped
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
class Client
|
|
58
|
-
attr_reader capabilities: Hash[String, json]
|
|
59
|
-
attr_reader transport: Transport?
|
|
60
|
-
attr_reader diagnostics: Hash[String, Array[object]]
|
|
61
|
-
attr_reader state: :stopped | :starting | :running | :failed
|
|
62
|
-
attr_reader errors: Array[Error]
|
|
63
|
-
attr_reader server_info: Hash[String, json]?
|
|
64
|
-
attr_reader position_encoding: String?
|
|
65
|
-
def initialize: (command: Array[String], ?root: String, ?dispatch: ^() { () -> untyped } -> untyped, ?restart: bool, ?env: Hash[String, String?], ?initialization_options: json, ?configuration: object) -> void
|
|
66
|
-
def start: (?timeout: Numeric) -> self
|
|
67
|
-
def stop: () -> untyped
|
|
68
|
-
def request: (String | Symbol method, ?json params) -> Future
|
|
69
|
-
def notify: (String | Symbol method, ?json params) -> untyped
|
|
70
|
-
def on: (String | Symbol method) { (untyped) -> untyped } -> Proc
|
|
71
|
-
def supports?: (String | Symbol capability) -> bool
|
|
72
|
-
def workspace_symbols: (String query) -> Future
|
|
73
|
-
def resolve_completion: (object item) -> Future
|
|
74
|
-
def resolve_code_action: (object action) -> Future
|
|
75
|
-
def resolve_code_lens: (object lens) -> Future
|
|
76
|
-
def execute_command: (String command, ?arguments: Array[json]) -> Future
|
|
77
|
-
def open_document: (Buffer buffer, language_id: String) -> String
|
|
78
|
-
def close_document: (String uri) -> untyped
|
|
79
|
-
def save_document: (String uri) -> untyped
|
|
80
|
-
def at: (String method, Buffer buffer, Integer offset, **json params) -> Future
|
|
81
|
-
def completion: (Buffer buffer, Integer offset, **json params) -> Future
|
|
82
|
-
def hover: (Buffer buffer, Integer offset, **json params) -> Future
|
|
83
|
-
def definition: (Buffer buffer, Integer offset, **json params) -> Future
|
|
84
|
-
def typeDefinition: (Buffer buffer, Integer offset, **json params) -> Future
|
|
85
|
-
def implementation: (Buffer buffer, Integer offset, **json params) -> Future
|
|
86
|
-
def references: (Buffer buffer, Integer offset, **json params) -> Future
|
|
87
|
-
def rename: (Buffer buffer, Integer offset, **json params) -> Future
|
|
88
|
-
def signatureHelp: (Buffer buffer, Integer offset, **json params) -> Future
|
|
89
|
-
def documentSymbol: (Buffer buffer, **json params) -> Future
|
|
90
|
-
def formatting: (Buffer buffer, **json params) -> Future
|
|
91
|
-
def codeAction: (Buffer buffer, **json params) -> Future
|
|
92
|
-
def inlayHint: (Buffer buffer, **json params) -> Future
|
|
93
|
-
def codeLens: (Buffer buffer, **json params) -> Future
|
|
94
|
-
def diagnostic: (Buffer buffer, **json params) -> Future
|
|
95
|
-
def semantic_tokens: (Buffer buffer) -> Array[semantic_token]
|
|
96
|
-
def apply_text_edits: (Buffer buffer, Array[object] edits) -> untyped
|
|
97
|
-
end
|
|
98
|
-
end
|
|
99
|
-
end
|
data/sig/terminal.rbs
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
module Canopus
|
|
2
|
-
module Terminal
|
|
3
|
-
type color = Integer | [Integer, Integer, Integer] | nil
|
|
4
|
-
type attributes = Hash[Symbol, bool | Integer | [Integer, Integer, Integer]]
|
|
5
|
-
type mouse_action = :press | :move | :release
|
|
6
|
-
class Cell < Struct[untyped]
|
|
7
|
-
attr_accessor text: String
|
|
8
|
-
attr_accessor width: Integer
|
|
9
|
-
attr_accessor foreground: color
|
|
10
|
-
attr_accessor background: color
|
|
11
|
-
attr_accessor attributes: attributes
|
|
12
|
-
attr_accessor hyperlink: String?
|
|
13
|
-
def self.new: (text: String, width: Integer, ?foreground: color, ?background: color, attributes: attributes, ?hyperlink: String?) -> instance
|
|
14
|
-
end
|
|
15
|
-
class Scrollback
|
|
16
|
-
include Enumerable[Array[Cell]]
|
|
17
|
-
class Count < Struct[untyped]
|
|
18
|
-
attr_accessor lines: Integer
|
|
19
|
-
def self.new: (Integer lines) -> instance
|
|
20
|
-
def self.zero: () -> instance
|
|
21
|
-
def +: (Count other) -> Count
|
|
22
|
-
end
|
|
23
|
-
class Row < Struct[untyped]
|
|
24
|
-
attr_accessor cells: Array[Cell]
|
|
25
|
-
def self.new: (Array[Cell] cells) -> instance
|
|
26
|
-
def summary: () -> Count
|
|
27
|
-
end
|
|
28
|
-
attr_reader tree: Denebola::Tree
|
|
29
|
-
attr_reader limit: Integer
|
|
30
|
-
def initialize: (Integer limit) -> void
|
|
31
|
-
def clear: () -> Denebola::Tree
|
|
32
|
-
def length: () -> Integer
|
|
33
|
-
alias size length
|
|
34
|
-
def []: (Integer index) -> Array[Cell]?
|
|
35
|
-
def each: () -> Enumerator[Array[Cell], Denebola::Tree]
|
|
36
|
-
| () { (Array[Cell]) -> void } -> Denebola::Tree
|
|
37
|
-
def push: (Array[Cell] cells) -> Denebola::Tree?
|
|
38
|
-
end
|
|
39
|
-
class Grid
|
|
40
|
-
attr_reader columns: Integer
|
|
41
|
-
attr_reader rows: Integer
|
|
42
|
-
attr_reader cells: Array[Array[Cell]]
|
|
43
|
-
attr_reader scrollback: Scrollback
|
|
44
|
-
attr_reader cursor_x: Integer
|
|
45
|
-
attr_reader cursor_y: Integer
|
|
46
|
-
attr_reader scroll_top: Integer
|
|
47
|
-
attr_reader scroll_bottom: Integer
|
|
48
|
-
attr_accessor foreground: color
|
|
49
|
-
attr_accessor background: color
|
|
50
|
-
attr_accessor attributes: attributes
|
|
51
|
-
attr_accessor hyperlink: String?
|
|
52
|
-
attr_accessor autowrap: bool
|
|
53
|
-
attr_accessor insert_mode: bool
|
|
54
|
-
attr_accessor origin_mode: bool
|
|
55
|
-
attr_accessor cursor_visible: bool
|
|
56
|
-
def initialize: (?columns: Integer, ?rows: Integer, ?scrollback: Integer) -> void
|
|
57
|
-
def reset: () -> void
|
|
58
|
-
def []: (Integer row, ?nil column) -> Array[Cell]?
|
|
59
|
-
| (Integer row, Integer column) -> Cell?
|
|
60
|
-
def alternate?: () -> bool
|
|
61
|
-
def lines: () -> Array[String]
|
|
62
|
-
def text: () -> String
|
|
63
|
-
def put: (String char) -> void
|
|
64
|
-
def self.width: (String char) -> Integer
|
|
65
|
-
def move: (?x: Integer, ?y: Integer, ?relative: bool) -> void
|
|
66
|
-
def position: (Integer row, Integer column) -> void
|
|
67
|
-
def carriage_return: () -> void
|
|
68
|
-
def backspace: () -> void
|
|
69
|
-
def linefeed: () -> void
|
|
70
|
-
def reverse_index: () -> void
|
|
71
|
-
def tab: (?Integer count, ?backward: bool) -> void
|
|
72
|
-
def tab_set: () -> Array[Integer]
|
|
73
|
-
def tab_clear: (?all: bool) -> void
|
|
74
|
-
def margins: (?Integer top, ?Integer bottom) -> void
|
|
75
|
-
def scroll_up: (?Integer count) -> void
|
|
76
|
-
def scroll_down: (?Integer count) -> void
|
|
77
|
-
def erase_display: (?Integer mode) -> void
|
|
78
|
-
def erase_line: (?Integer mode) -> void
|
|
79
|
-
def erase_characters: (?Integer count) -> void
|
|
80
|
-
def insert_characters: (?Integer count) -> void
|
|
81
|
-
def delete_characters: (?Integer count) -> void
|
|
82
|
-
def insert_lines: (?Integer count) -> void
|
|
83
|
-
def delete_lines: (?Integer count) -> void
|
|
84
|
-
def save_cursor: () -> void
|
|
85
|
-
def restore_cursor: () -> void
|
|
86
|
-
def alternate: (bool enable, ?save: bool) -> void
|
|
87
|
-
def resize: (columns: Integer, rows: Integer) -> void
|
|
88
|
-
def selection: ([Integer, Integer] start, [Integer, Integer] finish, ?history: bool) -> String
|
|
89
|
-
def links: (Integer row) -> Array[{url: String, column: Integer, end_column: Integer}]
|
|
90
|
-
def file_paths: (Integer row, ?cwd: String) -> Array[{path: String, line: Integer, column: Integer}]
|
|
91
|
-
end
|
|
92
|
-
class VT
|
|
93
|
-
DEC_GRAPHICS: Hash[String, String]
|
|
94
|
-
attr_reader grid: Grid
|
|
95
|
-
attr_reader title: String?
|
|
96
|
-
attr_reader cwd: String?
|
|
97
|
-
attr_reader modes: Hash[Integer, bool]
|
|
98
|
-
attr_reader replies: Array[String]
|
|
99
|
-
attr_reader bell_count: Integer
|
|
100
|
-
def initialize: (?Grid grid) ?{ (String) -> void } -> void
|
|
101
|
-
def feed: (String bytes) -> self
|
|
102
|
-
def paste: (String text) -> String
|
|
103
|
-
def mouse: (button: Symbol | Integer | nil, column: Integer, row: Integer, ?action: mouse_action, ?shift: bool, ?alt: bool, ?control: bool) -> String
|
|
104
|
-
def key: (String | Symbol name, ?shift: bool, ?alt: bool, ?control: bool) -> String
|
|
105
|
-
end
|
|
106
|
-
class PTY
|
|
107
|
-
attr_reader reader: IO?
|
|
108
|
-
attr_reader writer: IO?
|
|
109
|
-
attr_reader pid: Integer
|
|
110
|
-
attr_reader grid: Grid
|
|
111
|
-
attr_reader vt: VT
|
|
112
|
-
attr_reader status: Process::Status?
|
|
113
|
-
attr_reader initial_cwd: String
|
|
114
|
-
attr_reader command_name: String
|
|
115
|
-
def initialize: (?command: String | Array[String], ?cwd: String, ?columns: Integer, ?rows: Integer, ?env: Hash[String, String?], ?scrollback: Integer, ?queue_limit_bytes: Integer) -> void
|
|
116
|
-
def read: (?timeout: Numeric?, ?max_bytes: Integer, ?max_seconds: Numeric?) -> String?
|
|
117
|
-
def pending?: () -> bool
|
|
118
|
-
def write: (String bytes) -> Integer
|
|
119
|
-
def paste: (String text) -> Integer
|
|
120
|
-
def key: (String | Symbol name, ?shift: bool, ?alt: bool, ?control: bool) -> Integer
|
|
121
|
-
def mouse: (button: Symbol | Integer | nil, column: Integer, row: Integer, ?action: mouse_action, ?shift: bool, ?alt: bool, ?control: bool) -> Integer
|
|
122
|
-
def resize: (columns: Integer, rows: Integer) -> void
|
|
123
|
-
def signal: (?String | Integer name) -> void
|
|
124
|
-
def alive?: () -> bool
|
|
125
|
-
def busy?: () -> bool
|
|
126
|
-
def foreground_process_name: (?now: Numeric) -> String?
|
|
127
|
-
def close: () -> void
|
|
128
|
-
end
|
|
129
|
-
end
|
|
130
|
-
end
|