@akonwi/kit 0.1.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.
- package/README.md +71 -0
- package/dist/kit +0 -0
- package/dist/plugin.d.ts +196 -0
- package/dist/plugin.js +3 -0
- package/dist/runtime/assets/javascript/highlights.scm +205 -0
- package/dist/runtime/assets/javascript/tree-sitter-javascript.wasm +0 -0
- package/dist/runtime/assets/markdown/highlights.scm +150 -0
- package/dist/runtime/assets/markdown/injections.scm +27 -0
- package/dist/runtime/assets/markdown/tree-sitter-markdown.wasm +0 -0
- package/dist/runtime/assets/markdown_inline/highlights.scm +115 -0
- package/dist/runtime/assets/markdown_inline/tree-sitter-markdown_inline.wasm +0 -0
- package/dist/runtime/assets/typescript/highlights.scm +604 -0
- package/dist/runtime/assets/typescript/tree-sitter-typescript.wasm +0 -0
- package/dist/runtime/assets/zig/highlights.scm +284 -0
- package/dist/runtime/assets/zig/tree-sitter-zig.wasm +0 -0
- package/dist/runtime/parser.worker.js +4124 -0
- package/dist/runtime/tree-sitter-3jzf13jk.wasm +0 -0
- package/dist/toasts.d.ts +12 -0
- package/docs/README.md +14 -0
- package/docs/features/plugins.md +70 -0
- package/package.json +72 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# kit
|
|
2
|
+
|
|
3
|
+
Kit is a TUI coding agent heavily inspired by [Pi](https://pi.dev) and built on top of [`pi-agent-core`](https://github.com/badlogic/pi-mono/tree/main/packages/agent) with [OpenTUI](https://opentui.com/).
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- [Bun](https://bun.sh) `>= 1.3.0`
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
From npm:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
bun install --global @akonwi/kit
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
From a checkout:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bun install
|
|
21
|
+
bun run build
|
|
22
|
+
bun link
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The packaged CLI uses the compiled binary as its non-development entry point.
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
kit # resumes the most recent session for the current directory or starts a new one
|
|
31
|
+
kit -s abc123 # opens a specific session by ID (long or short id)
|
|
32
|
+
kit threads # launches a session picker
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## What Kit includes
|
|
36
|
+
|
|
37
|
+
- terminal-first coding agent workflow
|
|
38
|
+
- session restore and persistence
|
|
39
|
+
- slash commands, prompt commands, and skills
|
|
40
|
+
- settings UI and app-owned settings
|
|
41
|
+
- code review tools and diff browser
|
|
42
|
+
|
|
43
|
+
For feature details, see [`docs/features/`](docs/features/).
|
|
44
|
+
|
|
45
|
+
## Development
|
|
46
|
+
|
|
47
|
+
Commit messages in this repo should use [Conventional Commits](https://www.conventionalcommits.org/), preferably in the form `type(scope): summary`.
|
|
48
|
+
|
|
49
|
+
Run from source:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
bun run dev
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Build the distributed binary:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
bun run build
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Preview the npm package contents:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
bun run pack:dry
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## More documentation
|
|
68
|
+
|
|
69
|
+
- feature docs: [`docs/features/`](docs/features/)
|
|
70
|
+
- ADRs: [`docs/adrs/`](docs/adrs/)
|
|
71
|
+
- project guidance: [`AGENTS.md`](AGENTS.md)
|
package/dist/kit
ADDED
|
Binary file
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import type { AgentMessage } from "@mariozechner/pi-agent-core";
|
|
2
|
+
import type { Api, Model, Static, TSchema } from "@mariozechner/pi-ai";
|
|
3
|
+
import type { JSX } from "solid-js";
|
|
4
|
+
import type { ToastInput } from "./toasts";
|
|
5
|
+
|
|
6
|
+
export type PluginSubscription = () => void;
|
|
7
|
+
export type PluginDispose = () => void;
|
|
8
|
+
|
|
9
|
+
export type PluginOverlaySurfaceProps = {
|
|
10
|
+
zIndex?: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type PluginOverlayComponentProps<T> = {
|
|
14
|
+
done: (result: T) => void;
|
|
15
|
+
surfaceProps: PluginOverlaySurfaceProps;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type PluginUI = {
|
|
19
|
+
toast: (toast: ToastInput) => void;
|
|
20
|
+
custom: <T>(
|
|
21
|
+
component: (props: PluginOverlayComponentProps<T>) => JSX.Element,
|
|
22
|
+
) => Promise<T>;
|
|
23
|
+
getTranscriptViewport: () => { width: number; height: number } | null;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type PluginToolExecutionMode = "sequential" | "parallel";
|
|
27
|
+
|
|
28
|
+
export type PluginToolResultContentBlock =
|
|
29
|
+
| { type: "text"; text: string }
|
|
30
|
+
| { type: "image"; data: string; mimeType: string };
|
|
31
|
+
|
|
32
|
+
export type PluginToolResult<TDetails = unknown> = {
|
|
33
|
+
content: PluginToolResultContentBlock[];
|
|
34
|
+
details: TDetails;
|
|
35
|
+
terminate?: boolean;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type PluginToolUpdateCallback<TDetails = unknown> = (
|
|
39
|
+
partialResult: PluginToolResult<TDetails>,
|
|
40
|
+
) => void;
|
|
41
|
+
|
|
42
|
+
export type PluginToolDefinition<
|
|
43
|
+
TParameters extends TSchema = TSchema,
|
|
44
|
+
TDetails = unknown,
|
|
45
|
+
> = {
|
|
46
|
+
name: string;
|
|
47
|
+
label?: string;
|
|
48
|
+
description: string;
|
|
49
|
+
promptSnippet?: string;
|
|
50
|
+
promptGuidelines?: string[];
|
|
51
|
+
parameters: TParameters;
|
|
52
|
+
prepareArguments?: (args: unknown) => Static<TParameters>;
|
|
53
|
+
execute: (
|
|
54
|
+
toolCallId: string,
|
|
55
|
+
params: Static<TParameters>,
|
|
56
|
+
signal?: AbortSignal,
|
|
57
|
+
onUpdate?: PluginToolUpdateCallback<TDetails>,
|
|
58
|
+
) => Promise<PluginToolResult<TDetails>>;
|
|
59
|
+
executionMode?: PluginToolExecutionMode;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type PluginLogger = {
|
|
63
|
+
log: (...args: unknown[]) => void;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type PluginMessagePart = {
|
|
67
|
+
type: string;
|
|
68
|
+
[key: string]: unknown;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type PluginSession = {
|
|
72
|
+
id: string;
|
|
73
|
+
cwd: string;
|
|
74
|
+
name?: string;
|
|
75
|
+
model?: string;
|
|
76
|
+
thinkingLevel?: string;
|
|
77
|
+
parentSessionId?: string;
|
|
78
|
+
forkedFromTurnId?: string;
|
|
79
|
+
createdAt?: string;
|
|
80
|
+
updatedAt?: string;
|
|
81
|
+
turns?: unknown[];
|
|
82
|
+
[key: string]: unknown;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type PluginSessionAPI = {
|
|
86
|
+
get: () => PluginSession;
|
|
87
|
+
getMessages: () => AgentMessage[];
|
|
88
|
+
setName: (name: string) => Promise<void>;
|
|
89
|
+
submitMessage: (input: string | PluginMessagePart[]) => Promise<void>;
|
|
90
|
+
submitPromptCommandMessage: (
|
|
91
|
+
command: string,
|
|
92
|
+
args: string,
|
|
93
|
+
expandedPrompt: string,
|
|
94
|
+
) => Promise<void>;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export type PluginReviewDiffView = "unified" | "split";
|
|
98
|
+
|
|
99
|
+
export type PluginSettings = {
|
|
100
|
+
theme?: string;
|
|
101
|
+
bells?: boolean;
|
|
102
|
+
speech?:
|
|
103
|
+
| boolean
|
|
104
|
+
| {
|
|
105
|
+
enabled?: boolean;
|
|
106
|
+
maxChars?: number;
|
|
107
|
+
voice?: string;
|
|
108
|
+
};
|
|
109
|
+
pager?: boolean;
|
|
110
|
+
guidedQuestions?: boolean;
|
|
111
|
+
sessionNaming?: boolean;
|
|
112
|
+
diffs?: {
|
|
113
|
+
view?: PluginReviewDiffView;
|
|
114
|
+
};
|
|
115
|
+
retry?: {
|
|
116
|
+
enabled?: boolean;
|
|
117
|
+
maxRetries?: number;
|
|
118
|
+
baseDelayMs?: number;
|
|
119
|
+
maxDelayMs?: number;
|
|
120
|
+
};
|
|
121
|
+
[key: string]: unknown;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export type PluginSettingsAPI = {
|
|
125
|
+
get: () => PluginSettings;
|
|
126
|
+
update: (patch: Partial<PluginSettings>) => Promise<void>;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export type PluginModelAPI = {
|
|
130
|
+
getCurrent: () => Model<Api> | undefined;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export type PluginSystemAPI = {
|
|
134
|
+
readonly cwd: string;
|
|
135
|
+
open: (url: string | URL) => Promise<void>;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export type PluginEventContext = {
|
|
139
|
+
logger: PluginLogger;
|
|
140
|
+
ui: PluginUI;
|
|
141
|
+
session: PluginSessionAPI;
|
|
142
|
+
settings: PluginSettingsAPI;
|
|
143
|
+
model: PluginModelAPI;
|
|
144
|
+
system: PluginSystemAPI;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export type PluginCommandContext = PluginEventContext & {
|
|
148
|
+
args: string;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export type PluginCommandOptions = {
|
|
152
|
+
title?: string;
|
|
153
|
+
description?: string;
|
|
154
|
+
argName?: string;
|
|
155
|
+
category?: string;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export type PluginRuntimeEvent<Type extends string = string> = {
|
|
159
|
+
type: Type;
|
|
160
|
+
} & Record<string, unknown>;
|
|
161
|
+
|
|
162
|
+
export type PluginEventHandler<Type extends string = string> = (
|
|
163
|
+
event: PluginRuntimeEvent<Type>,
|
|
164
|
+
ctx: PluginEventContext,
|
|
165
|
+
) => void | Promise<void>;
|
|
166
|
+
|
|
167
|
+
export interface PluginAPI {
|
|
168
|
+
logger: PluginLogger;
|
|
169
|
+
ui: PluginUI;
|
|
170
|
+
session: PluginSessionAPI;
|
|
171
|
+
settings: PluginSettingsAPI;
|
|
172
|
+
model: PluginModelAPI;
|
|
173
|
+
system: PluginSystemAPI;
|
|
174
|
+
on(handler: PluginEventHandler): PluginSubscription;
|
|
175
|
+
on<Type extends string>(
|
|
176
|
+
type: Type,
|
|
177
|
+
handler: PluginEventHandler<Type>,
|
|
178
|
+
): PluginSubscription;
|
|
179
|
+
on<Prefix extends string>(
|
|
180
|
+
options: { prefix: Prefix },
|
|
181
|
+
handler: PluginEventHandler<`${Prefix}${string}`>,
|
|
182
|
+
): PluginSubscription;
|
|
183
|
+
registerCommand: (
|
|
184
|
+
id: string,
|
|
185
|
+
options: PluginCommandOptions,
|
|
186
|
+
handler: (ctx: PluginCommandContext) => void | Promise<void>,
|
|
187
|
+
) => PluginSubscription;
|
|
188
|
+
registerTool: <TParameters extends TSchema, TDetails>(
|
|
189
|
+
tool: PluginToolDefinition<TParameters, TDetails>,
|
|
190
|
+
) => PluginSubscription;
|
|
191
|
+
addSystemPrompt: (text: string) => PluginSubscription;
|
|
192
|
+
addDebugSection: (key: string, lines: string[]) => PluginSubscription;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// biome-ignore lint/suspicious/noConfusingVoidType: plugin definitions may omit a return value or return a disposer.
|
|
196
|
+
export type PluginDefinition = (kit: PluginAPI) => void | PluginDispose;
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
; Query from: https://raw.githubusercontent.com/tree-sitter/tree-sitter-javascript/refs/heads/master/queries/highlights.scm
|
|
2
|
+
; Variables
|
|
3
|
+
;----------
|
|
4
|
+
|
|
5
|
+
(identifier) @variable
|
|
6
|
+
|
|
7
|
+
; Properties
|
|
8
|
+
;-----------
|
|
9
|
+
|
|
10
|
+
(property_identifier) @property
|
|
11
|
+
|
|
12
|
+
; Function and method definitions
|
|
13
|
+
;--------------------------------
|
|
14
|
+
|
|
15
|
+
(function_expression
|
|
16
|
+
name: (identifier) @function)
|
|
17
|
+
(function_declaration
|
|
18
|
+
name: (identifier) @function)
|
|
19
|
+
(method_definition
|
|
20
|
+
name: (property_identifier) @function.method)
|
|
21
|
+
|
|
22
|
+
(pair
|
|
23
|
+
key: (property_identifier) @function.method
|
|
24
|
+
value: [(function_expression) (arrow_function)])
|
|
25
|
+
|
|
26
|
+
(assignment_expression
|
|
27
|
+
left: (member_expression
|
|
28
|
+
property: (property_identifier) @function.method)
|
|
29
|
+
right: [(function_expression) (arrow_function)])
|
|
30
|
+
|
|
31
|
+
(variable_declarator
|
|
32
|
+
name: (identifier) @function
|
|
33
|
+
value: [(function_expression) (arrow_function)])
|
|
34
|
+
|
|
35
|
+
(assignment_expression
|
|
36
|
+
left: (identifier) @function
|
|
37
|
+
right: [(function_expression) (arrow_function)])
|
|
38
|
+
|
|
39
|
+
; Function and method calls
|
|
40
|
+
;--------------------------
|
|
41
|
+
|
|
42
|
+
(call_expression
|
|
43
|
+
function: (identifier) @function)
|
|
44
|
+
|
|
45
|
+
(call_expression
|
|
46
|
+
function: (member_expression
|
|
47
|
+
property: (property_identifier) @function.method))
|
|
48
|
+
|
|
49
|
+
; Special identifiers
|
|
50
|
+
;--------------------
|
|
51
|
+
|
|
52
|
+
((identifier) @constructor
|
|
53
|
+
(#match? @constructor "^[A-Z]"))
|
|
54
|
+
|
|
55
|
+
([
|
|
56
|
+
(identifier)
|
|
57
|
+
(shorthand_property_identifier)
|
|
58
|
+
(shorthand_property_identifier_pattern)
|
|
59
|
+
] @constant
|
|
60
|
+
(#match? @constant "^[A-Z_][A-Z\\d_]+$"))
|
|
61
|
+
|
|
62
|
+
((identifier) @variable.builtin
|
|
63
|
+
(#match? @variable.builtin "^(arguments|module|console|window|document)$")
|
|
64
|
+
(#is-not? local))
|
|
65
|
+
|
|
66
|
+
((identifier) @function.builtin
|
|
67
|
+
(#eq? @function.builtin "require")
|
|
68
|
+
(#is-not? local))
|
|
69
|
+
|
|
70
|
+
; Literals
|
|
71
|
+
;---------
|
|
72
|
+
|
|
73
|
+
(this) @variable.builtin
|
|
74
|
+
(super) @variable.builtin
|
|
75
|
+
|
|
76
|
+
[
|
|
77
|
+
(true)
|
|
78
|
+
(false)
|
|
79
|
+
(null)
|
|
80
|
+
(undefined)
|
|
81
|
+
] @constant.builtin
|
|
82
|
+
|
|
83
|
+
(comment) @comment
|
|
84
|
+
|
|
85
|
+
[
|
|
86
|
+
(string)
|
|
87
|
+
(template_string)
|
|
88
|
+
] @string
|
|
89
|
+
|
|
90
|
+
(regex) @string.special
|
|
91
|
+
(number) @number
|
|
92
|
+
|
|
93
|
+
; Tokens
|
|
94
|
+
;-------
|
|
95
|
+
|
|
96
|
+
[
|
|
97
|
+
";"
|
|
98
|
+
(optional_chain)
|
|
99
|
+
"."
|
|
100
|
+
","
|
|
101
|
+
] @punctuation.delimiter
|
|
102
|
+
|
|
103
|
+
[
|
|
104
|
+
"-"
|
|
105
|
+
"--"
|
|
106
|
+
"-="
|
|
107
|
+
"+"
|
|
108
|
+
"++"
|
|
109
|
+
"+="
|
|
110
|
+
"*"
|
|
111
|
+
"*="
|
|
112
|
+
"**"
|
|
113
|
+
"**="
|
|
114
|
+
"/"
|
|
115
|
+
"/="
|
|
116
|
+
"%"
|
|
117
|
+
"%="
|
|
118
|
+
"<"
|
|
119
|
+
"<="
|
|
120
|
+
"<<"
|
|
121
|
+
"<<="
|
|
122
|
+
"="
|
|
123
|
+
"=="
|
|
124
|
+
"==="
|
|
125
|
+
"!"
|
|
126
|
+
"!="
|
|
127
|
+
"!=="
|
|
128
|
+
"=>"
|
|
129
|
+
">"
|
|
130
|
+
">="
|
|
131
|
+
">>"
|
|
132
|
+
">>="
|
|
133
|
+
">>>"
|
|
134
|
+
">>>="
|
|
135
|
+
"~"
|
|
136
|
+
"^"
|
|
137
|
+
"&"
|
|
138
|
+
"|"
|
|
139
|
+
"^="
|
|
140
|
+
"&="
|
|
141
|
+
"|="
|
|
142
|
+
"&&"
|
|
143
|
+
"||"
|
|
144
|
+
"??"
|
|
145
|
+
"&&="
|
|
146
|
+
"||="
|
|
147
|
+
"??="
|
|
148
|
+
] @operator
|
|
149
|
+
|
|
150
|
+
[
|
|
151
|
+
"("
|
|
152
|
+
")"
|
|
153
|
+
"["
|
|
154
|
+
"]"
|
|
155
|
+
"{"
|
|
156
|
+
"}"
|
|
157
|
+
] @punctuation.bracket
|
|
158
|
+
|
|
159
|
+
(template_substitution
|
|
160
|
+
"${" @punctuation.special
|
|
161
|
+
"}" @punctuation.special) @embedded
|
|
162
|
+
|
|
163
|
+
[
|
|
164
|
+
"as"
|
|
165
|
+
"async"
|
|
166
|
+
"await"
|
|
167
|
+
"break"
|
|
168
|
+
"case"
|
|
169
|
+
"catch"
|
|
170
|
+
"class"
|
|
171
|
+
"const"
|
|
172
|
+
"continue"
|
|
173
|
+
"debugger"
|
|
174
|
+
"default"
|
|
175
|
+
"delete"
|
|
176
|
+
"do"
|
|
177
|
+
"else"
|
|
178
|
+
"export"
|
|
179
|
+
"extends"
|
|
180
|
+
"finally"
|
|
181
|
+
"for"
|
|
182
|
+
"from"
|
|
183
|
+
"function"
|
|
184
|
+
"get"
|
|
185
|
+
"if"
|
|
186
|
+
"import"
|
|
187
|
+
"in"
|
|
188
|
+
"instanceof"
|
|
189
|
+
"let"
|
|
190
|
+
"new"
|
|
191
|
+
"of"
|
|
192
|
+
"return"
|
|
193
|
+
"set"
|
|
194
|
+
"static"
|
|
195
|
+
"switch"
|
|
196
|
+
"target"
|
|
197
|
+
"throw"
|
|
198
|
+
"try"
|
|
199
|
+
"typeof"
|
|
200
|
+
"var"
|
|
201
|
+
"void"
|
|
202
|
+
"while"
|
|
203
|
+
"with"
|
|
204
|
+
"yield"
|
|
205
|
+
] @keyword
|
|
Binary file
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
; Query from: https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/markdown/highlights.scm
|
|
2
|
+
;From MDeiml/tree-sitter-markdown & Helix
|
|
3
|
+
(setext_heading
|
|
4
|
+
(paragraph) @markup.heading.1
|
|
5
|
+
(setext_h1_underline) @markup.heading.1)
|
|
6
|
+
|
|
7
|
+
(setext_heading
|
|
8
|
+
(paragraph) @markup.heading.2
|
|
9
|
+
(setext_h2_underline) @markup.heading.2)
|
|
10
|
+
|
|
11
|
+
; Capture the entire heading node first based on the marker it contains
|
|
12
|
+
((atx_heading (atx_h1_marker)) @markup.heading.1
|
|
13
|
+
(#set! priority 90))
|
|
14
|
+
|
|
15
|
+
((atx_heading (atx_h2_marker)) @markup.heading.2
|
|
16
|
+
(#set! priority 90))
|
|
17
|
+
|
|
18
|
+
((atx_heading (atx_h3_marker)) @markup.heading.3
|
|
19
|
+
(#set! priority 90))
|
|
20
|
+
|
|
21
|
+
((atx_heading (atx_h4_marker)) @markup.heading.4
|
|
22
|
+
(#set! priority 90))
|
|
23
|
+
|
|
24
|
+
((atx_heading (atx_h5_marker)) @markup.heading.5
|
|
25
|
+
(#set! priority 90))
|
|
26
|
+
|
|
27
|
+
((atx_heading (atx_h6_marker)) @markup.heading.6
|
|
28
|
+
(#set! priority 90))
|
|
29
|
+
|
|
30
|
+
; Then capture and conceal just the markers (they don't need special styling)
|
|
31
|
+
(atx_heading
|
|
32
|
+
(atx_h1_marker) @conceal
|
|
33
|
+
(#set! conceal ""))
|
|
34
|
+
|
|
35
|
+
(atx_heading
|
|
36
|
+
(atx_h2_marker) @conceal
|
|
37
|
+
(#set! conceal ""))
|
|
38
|
+
|
|
39
|
+
(atx_heading
|
|
40
|
+
(atx_h3_marker) @conceal
|
|
41
|
+
(#set! conceal ""))
|
|
42
|
+
|
|
43
|
+
(atx_heading
|
|
44
|
+
(atx_h4_marker) @conceal
|
|
45
|
+
(#set! conceal ""))
|
|
46
|
+
|
|
47
|
+
(atx_heading
|
|
48
|
+
(atx_h5_marker) @conceal
|
|
49
|
+
(#set! conceal ""))
|
|
50
|
+
|
|
51
|
+
(atx_heading
|
|
52
|
+
(atx_h6_marker) @conceal
|
|
53
|
+
(#set! conceal ""))
|
|
54
|
+
|
|
55
|
+
(info_string) @label
|
|
56
|
+
|
|
57
|
+
(pipe_table_header
|
|
58
|
+
(pipe_table_cell) @markup.heading)
|
|
59
|
+
|
|
60
|
+
(pipe_table_header
|
|
61
|
+
"|" @punctuation.special)
|
|
62
|
+
|
|
63
|
+
(pipe_table_row
|
|
64
|
+
"|" @punctuation.special)
|
|
65
|
+
|
|
66
|
+
(pipe_table_delimiter_row
|
|
67
|
+
"|" @punctuation.special)
|
|
68
|
+
|
|
69
|
+
(pipe_table_delimiter_cell) @punctuation.special
|
|
70
|
+
|
|
71
|
+
; Code blocks (conceal backticks and language annotation)
|
|
72
|
+
(indented_code_block) @markup.raw.block
|
|
73
|
+
|
|
74
|
+
((fenced_code_block) @markup.raw.block
|
|
75
|
+
(#set! priority 90))
|
|
76
|
+
|
|
77
|
+
(fenced_code_block
|
|
78
|
+
(fenced_code_block_delimiter) @markup.raw.block
|
|
79
|
+
(#set! conceal "")
|
|
80
|
+
(#set! conceal_lines ""))
|
|
81
|
+
|
|
82
|
+
(fenced_code_block
|
|
83
|
+
(info_string
|
|
84
|
+
(language) @label
|
|
85
|
+
(#set! conceal "")
|
|
86
|
+
(#set! conceal_lines "")))
|
|
87
|
+
|
|
88
|
+
(link_destination) @markup.link.url
|
|
89
|
+
|
|
90
|
+
[
|
|
91
|
+
(link_title)
|
|
92
|
+
(link_label)
|
|
93
|
+
] @markup.link.label
|
|
94
|
+
|
|
95
|
+
((link_label)
|
|
96
|
+
.
|
|
97
|
+
":" @punctuation.delimiter)
|
|
98
|
+
|
|
99
|
+
[
|
|
100
|
+
(list_marker_plus)
|
|
101
|
+
(list_marker_minus)
|
|
102
|
+
(list_marker_star)
|
|
103
|
+
(list_marker_dot)
|
|
104
|
+
(list_marker_parenthesis)
|
|
105
|
+
] @markup.list
|
|
106
|
+
|
|
107
|
+
; NOTE: The following has been commented out due to issues with spaces in the
|
|
108
|
+
; list marker nodes generated by the parser. If those spaces ever get captured
|
|
109
|
+
; by a different node (e.g. block_continuation) we can safely re-add these
|
|
110
|
+
; conceals.
|
|
111
|
+
; ;; Conceal bullet points
|
|
112
|
+
; ([(list_marker_plus) (list_marker_star)]
|
|
113
|
+
; @punctuation.special
|
|
114
|
+
; (#offset! @punctuation.special 0 0 0 -1)
|
|
115
|
+
; (#set! conceal "•"))
|
|
116
|
+
; ([(list_marker_plus) (list_marker_star)]
|
|
117
|
+
; @punctuation.special
|
|
118
|
+
; (#any-of? @punctuation.special "+" "*")
|
|
119
|
+
; (#set! conceal "•"))
|
|
120
|
+
; ((list_marker_minus)
|
|
121
|
+
; @punctuation.special
|
|
122
|
+
; (#offset! @punctuation.special 0 0 0 -1)
|
|
123
|
+
; (#set! conceal "—"))
|
|
124
|
+
; ((list_marker_minus)
|
|
125
|
+
; @punctuation.special
|
|
126
|
+
; (#eq? @punctuation.special "-")
|
|
127
|
+
; (#set! conceal "—"))
|
|
128
|
+
(thematic_break) @punctuation.special
|
|
129
|
+
|
|
130
|
+
(task_list_marker_unchecked) @markup.list.unchecked
|
|
131
|
+
|
|
132
|
+
(task_list_marker_checked) @markup.list.checked
|
|
133
|
+
|
|
134
|
+
((block_quote) @markup.quote
|
|
135
|
+
(#set! priority 90))
|
|
136
|
+
|
|
137
|
+
([
|
|
138
|
+
(plus_metadata)
|
|
139
|
+
(minus_metadata)
|
|
140
|
+
] @keyword.directive
|
|
141
|
+
(#set! priority 90))
|
|
142
|
+
|
|
143
|
+
[
|
|
144
|
+
(block_continuation)
|
|
145
|
+
(block_quote_marker)
|
|
146
|
+
] @punctuation.special
|
|
147
|
+
|
|
148
|
+
(backslash_escape) @string.escape
|
|
149
|
+
|
|
150
|
+
(inline) @spell
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
; Query from: https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/markdown/injections.scm
|
|
2
|
+
(fenced_code_block
|
|
3
|
+
(info_string
|
|
4
|
+
(language) @_lang)
|
|
5
|
+
(code_fence_content) @injection.content
|
|
6
|
+
(#set-lang-from-info-string! @_lang))
|
|
7
|
+
|
|
8
|
+
((html_block) @injection.content
|
|
9
|
+
(#set! injection.language "html")
|
|
10
|
+
(#set! injection.combined)
|
|
11
|
+
(#set! injection.include-children))
|
|
12
|
+
|
|
13
|
+
((minus_metadata) @injection.content
|
|
14
|
+
(#set! injection.language "yaml")
|
|
15
|
+
(#offset! @injection.content 1 0 -1 0)
|
|
16
|
+
(#set! injection.include-children))
|
|
17
|
+
|
|
18
|
+
((plus_metadata) @injection.content
|
|
19
|
+
(#set! injection.language "toml")
|
|
20
|
+
(#offset! @injection.content 1 0 -1 0)
|
|
21
|
+
(#set! injection.include-children))
|
|
22
|
+
|
|
23
|
+
([
|
|
24
|
+
(inline)
|
|
25
|
+
(pipe_table_cell)
|
|
26
|
+
] @injection.content
|
|
27
|
+
(#set! injection.language "markdown_inline"))
|
|
Binary file
|