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.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +55 -0
  3. data/README.md +191 -19
  4. data/assets/keymaps/emacs.jsonc +5 -0
  5. data/assets/keymaps/jetbrains.jsonc +5 -0
  6. data/assets/keymaps/sublime.jsonc +5 -0
  7. data/assets/keymaps/vscode.jsonc +5 -0
  8. data/docs/debugging.md +143 -0
  9. data/docs/distribution.md +40 -9
  10. data/docs/lsp.md +131 -0
  11. data/docs/performance.md +18 -0
  12. data/docs/providers.md +36 -0
  13. data/docs/release-log.md +12 -0
  14. data/docs/tasks.md +64 -0
  15. data/docs/testing.md +49 -0
  16. data/docs/vim.md +3 -0
  17. data/exe/canopus +4 -1
  18. data/lib/canopus/buffer.rb +291 -50
  19. data/lib/canopus/cli.rb +5 -2
  20. data/lib/canopus/command.rb +13 -4
  21. data/lib/canopus/controller.rb +183 -40
  22. data/lib/canopus/debug/breakpoints.rb +550 -0
  23. data/lib/canopus/debug/configuration.rb +291 -0
  24. data/lib/canopus/debug/console.rb +243 -0
  25. data/lib/canopus/debug/panel.rb +487 -0
  26. data/lib/canopus/debug/session.rb +354 -0
  27. data/lib/canopus/decoration.rb +4 -2
  28. data/lib/canopus/denebola_compat.rb +27 -0
  29. data/lib/canopus/diagnostics.rb +173 -0
  30. data/lib/canopus/display_map/overlay_map.rb +6 -2
  31. data/lib/canopus/editor/snippet_expandable.rb +3 -2
  32. data/lib/canopus/editor.rb +122 -31
  33. data/lib/canopus/git/state.rb +100 -0
  34. data/lib/canopus/language/background_analysis.rb +93 -14
  35. data/lib/canopus/language/document.rb +70 -34
  36. data/lib/canopus/language/symbol.rb +1 -0
  37. data/lib/canopus/language/syntax_worker.rb +61 -9
  38. data/lib/canopus/language.rb +3 -0
  39. data/lib/canopus/minimap.rb +201 -0
  40. data/lib/canopus/patch.rb +3 -1
  41. data/lib/canopus/plugins/api.rb +4 -2
  42. data/lib/canopus/plugins/isolated_runtime.rb +64 -7
  43. data/lib/canopus/plugins/registry.rb +114 -3
  44. data/lib/canopus/plugins.rb +8 -7
  45. data/lib/canopus/project.rb +15 -6
  46. data/lib/canopus/provider.rb +192 -0
  47. data/lib/canopus/regexp_compat.rb +36 -4
  48. data/lib/canopus/selection.rb +12 -0
  49. data/lib/canopus/settings/schema.rb +201 -0
  50. data/lib/canopus/settings.rb +328 -49
  51. data/lib/canopus/task/configuration.rb +356 -0
  52. data/lib/canopus/task/problem_matcher.rb +264 -0
  53. data/lib/canopus/task/runner.rb +314 -0
  54. data/lib/canopus/test_runner/bounded_ignore.rb +144 -0
  55. data/lib/canopus/test_runner/discovery.rb +97 -0
  56. data/lib/canopus/test_runner/execution.rb +194 -0
  57. data/lib/canopus/test_runner/minitest.rb +116 -0
  58. data/lib/canopus/test_runner/rspec.rb +103 -0
  59. data/lib/canopus/test_runner/safe_walker.rb +37 -0
  60. data/lib/canopus/test_runner.rb +54 -0
  61. data/lib/canopus/theme/import.rb +131 -0
  62. data/lib/canopus/theme.rb +28 -4
  63. data/lib/canopus/version.rb +1 -1
  64. data/lib/canopus/vim/motionable.rb +1 -1
  65. data/lib/canopus/vim.rb +10 -16
  66. data/lib/canopus/workspace/auto_savable.rb +83 -0
  67. data/lib/canopus/workspace/debug_aware.rb +600 -0
  68. data/lib/canopus/workspace/edit/plan.rb +2 -2
  69. data/lib/canopus/workspace/editor_configurable.rb +113 -0
  70. data/lib/canopus/workspace/file_change_aware.rb +11 -3
  71. data/lib/canopus/workspace/git_aware.rb +80 -34
  72. data/lib/canopus/workspace/git_blame.rb +175 -0
  73. data/lib/canopus/workspace/git_conflict_resolution.rb +410 -0
  74. data/lib/canopus/workspace/git_diff_view.rb +641 -0
  75. data/lib/canopus/workspace/git_history.rb +171 -0
  76. data/lib/canopus/workspace/git_remote.rb +267 -0
  77. data/lib/canopus/workspace/git_staging.rb +583 -0
  78. data/lib/canopus/workspace/hierarchy_aware.rb +477 -0
  79. data/lib/canopus/workspace/keymap_aware.rb +66 -0
  80. data/lib/canopus/workspace/language_aware.rb +3721 -135
  81. data/lib/canopus/workspace/language_server_configurable.rb +287 -71
  82. data/lib/canopus/workspace/persistent_undo.rb +169 -0
  83. data/lib/canopus/workspace/problems_aware.rb +131 -0
  84. data/lib/canopus/workspace/project_searchable.rb +88 -11
  85. data/lib/canopus/workspace/project_tree_editable.rb +3 -1
  86. data/lib/canopus/workspace/recoverable.rb +204 -0
  87. data/lib/canopus/workspace/session_persistable.rb +85 -13
  88. data/lib/canopus/workspace/settings_aware.rb +76 -2
  89. data/lib/canopus/workspace/task_aware.rb +194 -0
  90. data/lib/canopus/workspace/test_aware.rb +394 -0
  91. data/lib/canopus/workspace/trust.rb +73 -0
  92. data/lib/canopus/workspace/view/terminal_presentable.rb +298 -47
  93. data/lib/canopus/workspace/view.rb +399 -74
  94. data/lib/canopus/workspace.rb +688 -44
  95. data/lib/canopus.rb +20 -2
  96. data/sig/canopus.rbs +138 -31
  97. data/sig/controller.rbs +10 -3
  98. data/sig/debug.rbs +121 -0
  99. data/sig/decoration.rbs +12 -2
  100. data/sig/diagnostics.rbs +26 -0
  101. data/sig/minimap.rbs +20 -0
  102. data/sig/provider.rbs +29 -0
  103. data/sig/services.rbs +1 -16
  104. data/sig/task.rbs +92 -0
  105. data/sig/test_runner.rbs +109 -0
  106. data/sig/trust.rbs +17 -0
  107. data/sig/workspace_edits.rbs +2 -2
  108. data/sig/workspace_services.rbs +234 -2
  109. data/tools/check_dependencies.rb +21 -2
  110. data/tools/package.rb +172 -14
  111. data/tools/package_signature_test.rb +33 -0
  112. data/tools/package_test.rb +29 -0
  113. data/tools/sign_package.rb +123 -0
  114. data/tools/update.rb +189 -0
  115. data/tools/update_test.rb +71 -0
  116. metadata +206 -31
  117. data/lib/canopus/lsp/client.rb +0 -307
  118. data/lib/canopus/lsp/error.rb +0 -7
  119. data/lib/canopus/lsp/future/subscription.rb +0 -9
  120. data/lib/canopus/lsp/future.rb +0 -87
  121. data/lib/canopus/lsp/protocol.rb +0 -83
  122. data/lib/canopus/lsp/server_error.rb +0 -13
  123. data/lib/canopus/lsp/timeout.rb +0 -7
  124. data/lib/canopus/lsp/transport.rb +0 -123
  125. data/lib/canopus/lsp.rb +0 -19
  126. data/lib/canopus/project/search.rb +0 -164
  127. data/lib/canopus/project/search_worker/cancelled.rb +0 -3
  128. data/lib/canopus/project/search_worker/runner.rb +0 -9
  129. data/lib/canopus/project/search_worker.rb +0 -108
  130. data/lib/canopus/terminal/cell.rb +0 -7
  131. data/lib/canopus/terminal/grid.rb +0 -321
  132. data/lib/canopus/terminal/pty.rb +0 -178
  133. data/lib/canopus/terminal/scrollback.rb +0 -38
  134. data/lib/canopus/terminal/vt.rb +0 -398
  135. data/lib/canopus/terminal.rb +0 -13
  136. data/sig/lsp.rbs +0 -99
  137. 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