@abelfubu/dv 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/dist/ansi-html.d.ts +42 -0
- package/dist/ansi-html.d.ts.map +1 -0
- package/dist/ansi-html.js +327 -0
- package/dist/ansi-output.d.ts +22 -0
- package/dist/ansi-output.d.ts.map +1 -0
- package/dist/ansi-output.js +154 -0
- package/dist/balance-delimiters.d.ts +25 -0
- package/dist/balance-delimiters.d.ts.map +1 -0
- package/dist/balance-delimiters.js +539 -0
- package/dist/balance-delimiters.test.d.ts +2 -0
- package/dist/balance-delimiters.test.d.ts.map +1 -0
- package/dist/balance-delimiters.test.js +1029 -0
- package/dist/cli-copy-notification.test.d.ts +2 -0
- package/dist/cli-copy-notification.test.d.ts.map +1 -0
- package/dist/cli-copy-notification.test.js +80 -0
- package/dist/cli-scroll.test.d.ts +2 -0
- package/dist/cli-scroll.test.d.ts.map +1 -0
- package/dist/cli-scroll.test.js +283 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +976 -0
- package/dist/clipboard.d.ts +16 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +128 -0
- package/dist/components/diff-view.d.ts +32 -0
- package/dist/components/diff-view.d.ts.map +1 -0
- package/dist/components/diff-view.js +123 -0
- package/dist/components/diff-view.test.d.ts +5 -0
- package/dist/components/diff-view.test.d.ts.map +1 -0
- package/dist/components/diff-view.test.js +312 -0
- package/dist/components/directory-tree-view.d.ts +33 -0
- package/dist/components/directory-tree-view.d.ts.map +1 -0
- package/dist/components/directory-tree-view.js +262 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +5 -0
- package/dist/components/toast.d.ts +21 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +47 -0
- package/dist/diff-cursor-utils.d.ts +20 -0
- package/dist/diff-cursor-utils.d.ts.map +1 -0
- package/dist/diff-cursor-utils.js +105 -0
- package/dist/diff-cursor-utils.test.d.ts +2 -0
- package/dist/diff-cursor-utils.test.d.ts.map +1 -0
- package/dist/diff-cursor-utils.test.js +40 -0
- package/dist/diff-surface-copy.d.ts +23 -0
- package/dist/diff-surface-copy.d.ts.map +1 -0
- package/dist/diff-surface-copy.js +64 -0
- package/dist/diff-surface-copy.test.d.ts +5 -0
- package/dist/diff-surface-copy.test.d.ts.map +1 -0
- package/dist/diff-surface-copy.test.js +142 -0
- package/dist/diff-utils.d.ts +196 -0
- package/dist/diff-utils.d.ts.map +1 -0
- package/dist/diff-utils.js +682 -0
- package/dist/diff-utils.test.d.ts +2 -0
- package/dist/diff-utils.test.d.ts.map +1 -0
- package/dist/diff-utils.test.js +727 -0
- package/dist/directory-tree.d.ts +72 -0
- package/dist/directory-tree.d.ts.map +1 -0
- package/dist/directory-tree.js +161 -0
- package/dist/directory-tree.test.d.ts +2 -0
- package/dist/directory-tree.test.d.ts.map +1 -0
- package/dist/directory-tree.test.js +383 -0
- package/dist/dropdown.d.ts +26 -0
- package/dist/dropdown.d.ts.map +1 -0
- package/dist/dropdown.js +172 -0
- package/dist/dropdown.test.d.ts +2 -0
- package/dist/dropdown.test.d.ts.map +1 -0
- package/dist/dropdown.test.js +106 -0
- package/dist/filter-submodule.e2e.test.d.ts +2 -0
- package/dist/filter-submodule.e2e.test.d.ts.map +1 -0
- package/dist/filter-submodule.e2e.test.js +109 -0
- package/dist/hooks/use-copy-selection.d.ts +29 -0
- package/dist/hooks/use-copy-selection.d.ts.map +1 -0
- package/dist/hooks/use-copy-selection.js +46 -0
- package/dist/kv-codec.d.ts +16 -0
- package/dist/kv-codec.d.ts.map +1 -0
- package/dist/kv-codec.js +36 -0
- package/dist/license.d.ts +14 -0
- package/dist/license.d.ts.map +1 -0
- package/dist/license.js +63 -0
- package/dist/logger.d.ts +9 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +78 -0
- package/dist/monochrome.d.ts +34 -0
- package/dist/monochrome.d.ts.map +1 -0
- package/dist/monochrome.js +613 -0
- package/dist/monotone.d.ts +22 -0
- package/dist/monotone.d.ts.map +1 -0
- package/dist/monotone.js +185 -0
- package/dist/parsers-config.d.ts +19 -0
- package/dist/parsers-config.d.ts.map +1 -0
- package/dist/parsers-config.js +271 -0
- package/dist/patch-terminal-dimensions.d.ts +2 -0
- package/dist/patch-terminal-dimensions.d.ts.map +1 -0
- package/dist/patch-terminal-dimensions.js +45 -0
- package/dist/stdin-pager.test.d.ts +2 -0
- package/dist/stdin-pager.test.d.ts.map +1 -0
- package/dist/stdin-pager.test.js +497 -0
- package/dist/store.d.ts +16 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +48 -0
- package/dist/themes/github.json +247 -0
- package/dist/themes.d.ts +59 -0
- package/dist/themes.d.ts.map +1 -0
- package/dist/themes.js +248 -0
- package/dist/tree-icons.d.ts +4 -0
- package/dist/tree-icons.d.ts.map +1 -0
- package/dist/tree-icons.js +18 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +13 -0
- package/dist/web-utils.d.ts +56 -0
- package/dist/web-utils.d.ts.map +1 -0
- package/dist/web-utils.js +363 -0
- package/package.json +37 -0
- package/public/jetbrains-mono-nerd.ttf +0 -0
- package/public/jetbrains-mono-nerd.woff2 +0 -0
package/dist/monotone.js
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// Monotone theme generator for creating single-hue color schemes.
|
|
2
|
+
// Generates VS Code-compatible themes from a base hue with configurable saturation.
|
|
3
|
+
// Used for creating consistent color palettes across light and dark variants.
|
|
4
|
+
function hslToRgb(h, s, l) {
|
|
5
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
6
|
+
const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
|
|
7
|
+
const m = l - c / 2;
|
|
8
|
+
let r = 0, g = 0, b = 0;
|
|
9
|
+
if (h >= 0 && h < 60) {
|
|
10
|
+
[r, g, b] = [c, x, 0];
|
|
11
|
+
}
|
|
12
|
+
else if (h >= 60 && h < 120) {
|
|
13
|
+
[r, g, b] = [x, c, 0];
|
|
14
|
+
}
|
|
15
|
+
else if (h >= 120 && h < 180) {
|
|
16
|
+
[r, g, b] = [0, c, x];
|
|
17
|
+
}
|
|
18
|
+
else if (h >= 180 && h < 240) {
|
|
19
|
+
[r, g, b] = [0, x, c];
|
|
20
|
+
}
|
|
21
|
+
else if (h >= 240 && h < 300) {
|
|
22
|
+
[r, g, b] = [x, 0, c];
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
[r, g, b] = [c, 0, x];
|
|
26
|
+
}
|
|
27
|
+
return [
|
|
28
|
+
Math.round((r + m) * 255),
|
|
29
|
+
Math.round((g + m) * 255),
|
|
30
|
+
Math.round((b + m) * 255),
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
function rgbToHex(r, g, b) {
|
|
34
|
+
return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
35
|
+
}
|
|
36
|
+
function hslToHex(h, s, l) {
|
|
37
|
+
const [r, g, b] = hslToRgb(h, s, l);
|
|
38
|
+
return rgbToHex(r, g, b);
|
|
39
|
+
}
|
|
40
|
+
function createMonotoneTheme(options) {
|
|
41
|
+
const { name, hue, isDark = true, saturation = 0.20, lightnessAdjust = 0 } = options;
|
|
42
|
+
const s = (factor) => saturation === 0 ? 0 : saturation * factor;
|
|
43
|
+
const bg = isDark
|
|
44
|
+
? hslToHex(hue, s(0.75), 0.08 + lightnessAdjust)
|
|
45
|
+
: hslToHex(hue, s(0.50), 0.95 + lightnessAdjust);
|
|
46
|
+
const fg = isDark
|
|
47
|
+
? hslToHex(hue, s(0.50), 0.85 + lightnessAdjust)
|
|
48
|
+
: hslToHex(hue, s(0.75), 0.15 + lightnessAdjust);
|
|
49
|
+
const shade = (lightness, satFactor = 1.0) => hslToHex(hue, s(satFactor), lightness);
|
|
50
|
+
return {
|
|
51
|
+
name,
|
|
52
|
+
type: isDark ? "dark" : "light",
|
|
53
|
+
colors: {
|
|
54
|
+
"editor.background": bg,
|
|
55
|
+
"editor.foreground": fg,
|
|
56
|
+
"editorLineNumber.foreground": isDark ? shade(0.30, 0.75) : shade(0.60, 0.75),
|
|
57
|
+
"editorLineNumber.activeForeground": isDark ? shade(0.50, 1.25) : shade(0.40, 1.25),
|
|
58
|
+
"editorCursor.foreground": fg,
|
|
59
|
+
"editor.selectionBackground": isDark ? shade(0.18, 1.25) : shade(0.85, 1.0),
|
|
60
|
+
"editor.lineHighlightBackground": isDark ? shade(0.12, 1.0) : shade(0.92, 0.75),
|
|
61
|
+
"editorIndentGuide.background": isDark ? shade(0.15, 0.75) : shade(0.85, 0.75),
|
|
62
|
+
"editorIndentGuide.activeBackground": isDark ? shade(0.30, 1.25) : shade(0.70, 1.25),
|
|
63
|
+
"editorWhitespace.foreground": isDark ? shade(0.20, 0.75) : shade(0.80, 0.75),
|
|
64
|
+
"sideBar.background": isDark ? shade(0.06, 0.75) : shade(0.97, 0.50),
|
|
65
|
+
"sideBar.foreground": isDark ? shade(0.60, 1.0) : shade(0.35, 1.0),
|
|
66
|
+
"sideBar.border": isDark ? shade(0.12, 1.0) : shade(0.90, 0.75),
|
|
67
|
+
"activityBar.background": isDark ? shade(0.06, 0.75) : shade(0.97, 0.50),
|
|
68
|
+
"activityBar.foreground": isDark ? shade(0.70, 1.25) : shade(0.30, 1.25),
|
|
69
|
+
"activityBar.border": isDark ? shade(0.12, 1.0) : shade(0.90, 0.75),
|
|
70
|
+
"statusBar.background": isDark ? shade(0.06, 0.75) : shade(0.97, 0.50),
|
|
71
|
+
"statusBar.foreground": isDark ? shade(0.60, 1.0) : shade(0.35, 1.0),
|
|
72
|
+
"statusBar.border": isDark ? shade(0.12, 1.0) : shade(0.90, 0.75),
|
|
73
|
+
"titleBar.activeBackground": isDark ? shade(0.06, 0.75) : shade(0.97, 0.50),
|
|
74
|
+
"titleBar.activeForeground": isDark ? shade(0.60, 1.0) : shade(0.35, 1.0),
|
|
75
|
+
"titleBar.border": isDark ? shade(0.12, 1.0) : shade(0.90, 0.75),
|
|
76
|
+
"tab.activeBackground": bg,
|
|
77
|
+
"tab.activeForeground": fg,
|
|
78
|
+
"tab.inactiveBackground": isDark ? shade(0.10, 0.75) : shade(0.93, 0.50),
|
|
79
|
+
"tab.inactiveForeground": isDark ? shade(0.45, 1.0) : shade(0.50, 1.0),
|
|
80
|
+
"tab.border": isDark ? shade(0.12, 1.0) : shade(0.90, 0.75),
|
|
81
|
+
"panel.border": isDark ? shade(0.12, 1.0) : shade(0.90, 0.75),
|
|
82
|
+
"input.background": isDark ? shade(0.10, 0.75) : shade(0.98, 0.50),
|
|
83
|
+
"input.foreground": fg,
|
|
84
|
+
"input.border": isDark ? shade(0.20, 1.0) : shade(0.85, 1.0),
|
|
85
|
+
"dropdown.background": isDark ? shade(0.10, 0.75) : shade(0.98, 0.50),
|
|
86
|
+
"dropdown.foreground": fg,
|
|
87
|
+
"list.activeSelectionBackground": isDark ? shade(0.18, 1.25) : shade(0.85, 1.25),
|
|
88
|
+
"list.activeSelectionForeground": fg,
|
|
89
|
+
"list.hoverBackground": isDark ? shade(0.14, 1.0) : shade(0.90, 0.75),
|
|
90
|
+
"list.focusBackground": isDark ? shade(0.18, 1.25) : shade(0.85, 1.25),
|
|
91
|
+
},
|
|
92
|
+
tokenColors: [
|
|
93
|
+
{
|
|
94
|
+
scope: ["comment", "punctuation.definition.comment"],
|
|
95
|
+
settings: {
|
|
96
|
+
foreground: isDark ? shade(0.45, 1.0) : shade(0.50, 1.25),
|
|
97
|
+
fontStyle: "italic",
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
scope: ["keyword", "storage.type", "storage.modifier"],
|
|
102
|
+
settings: {
|
|
103
|
+
foreground: isDark ? shade(0.60, 1.75) : shade(0.35, 2.0),
|
|
104
|
+
fontStyle: "bold",
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
scope: ["string", "punctuation.definition.string"],
|
|
109
|
+
settings: {
|
|
110
|
+
foreground: isDark ? shade(0.65, 1.5) : shade(0.40, 1.75),
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
scope: ["constant.numeric", "constant.language", "constant.character"],
|
|
115
|
+
settings: {
|
|
116
|
+
foreground: isDark ? shade(0.70, 1.5) : shade(0.35, 1.75),
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
scope: ["variable", "entity.name.variable"],
|
|
121
|
+
settings: {
|
|
122
|
+
foreground: isDark ? shade(0.75, 1.0) : shade(0.25, 1.0),
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
scope: ["entity.name.function", "support.function"],
|
|
127
|
+
settings: {
|
|
128
|
+
foreground: isDark ? shade(0.80, 1.25) : shade(0.20, 1.5),
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
scope: [
|
|
133
|
+
"entity.name.type",
|
|
134
|
+
"entity.name.class",
|
|
135
|
+
"support.type",
|
|
136
|
+
"support.class",
|
|
137
|
+
],
|
|
138
|
+
settings: {
|
|
139
|
+
foreground: isDark ? shade(0.75, 1.5) : shade(0.25, 1.75),
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
scope: "punctuation",
|
|
144
|
+
settings: {
|
|
145
|
+
foreground: isDark ? shade(0.55, 1.0) : shade(0.45, 1.0),
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
scope: "operator",
|
|
150
|
+
settings: {
|
|
151
|
+
foreground: isDark ? shade(0.65, 1.25) : shade(0.35, 1.5),
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
scope: "entity.name.tag",
|
|
156
|
+
settings: {
|
|
157
|
+
foreground: isDark ? shade(0.70, 1.75) : shade(0.30, 2.0),
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
scope: "entity.other.attribute-name",
|
|
162
|
+
settings: {
|
|
163
|
+
foreground: isDark ? shade(0.75, 1.25) : shade(0.25, 1.5),
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
export function generateMonotoneThemes() {
|
|
170
|
+
return [
|
|
171
|
+
createMonotoneTheme({ name: "monotone-blue-dark", hue: 210, isDark: true }),
|
|
172
|
+
createMonotoneTheme({ name: "monotone-blue-light", hue: 210, isDark: false }),
|
|
173
|
+
createMonotoneTheme({ name: "monotone-green-dark", hue: 120, isDark: true }),
|
|
174
|
+
createMonotoneTheme({ name: "monotone-green-light", hue: 120, isDark: false }),
|
|
175
|
+
createMonotoneTheme({ name: "monotone-purple-dark", hue: 270, isDark: true }),
|
|
176
|
+
createMonotoneTheme({ name: "monotone-purple-light", hue: 270, isDark: false }),
|
|
177
|
+
createMonotoneTheme({ name: "monotone-red-dark", hue: 0, isDark: true }),
|
|
178
|
+
createMonotoneTheme({ name: "monotone-red-light", hue: 0, isDark: false }),
|
|
179
|
+
createMonotoneTheme({ name: "monotone-orange-dark", hue: 30, isDark: true }),
|
|
180
|
+
createMonotoneTheme({ name: "monotone-orange-light", hue: 30, isDark: false }),
|
|
181
|
+
createMonotoneTheme({ name: "monotone-cyan-dark", hue: 180, isDark: true }),
|
|
182
|
+
createMonotoneTheme({ name: "monotone-cyan-light", hue: 180, isDark: false }),
|
|
183
|
+
];
|
|
184
|
+
}
|
|
185
|
+
export { createMonotoneTheme };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
parsers: ({
|
|
3
|
+
filetype: string;
|
|
4
|
+
wasm: string;
|
|
5
|
+
queries: {
|
|
6
|
+
highlights: string[];
|
|
7
|
+
locals: string[];
|
|
8
|
+
};
|
|
9
|
+
} | {
|
|
10
|
+
filetype: string;
|
|
11
|
+
wasm: string;
|
|
12
|
+
queries: {
|
|
13
|
+
highlights: string[];
|
|
14
|
+
locals?: undefined;
|
|
15
|
+
};
|
|
16
|
+
})[];
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
19
|
+
//# sourceMappingURL=parsers-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parsers-config.d.ts","sourceRoot":"","sources":["../src/parsers-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAcA,wBAmQC"}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
// Tree-sitter parser configuration for syntax highlighting
|
|
2
|
+
// NOTE: For markdown, javascript and typescript, we use the opentui built-in parsers
|
|
3
|
+
// Warn: when taking queries from the nvim-treesitter repo, make sure to include the query dependencies as well
|
|
4
|
+
// marked with for example `; inherits: ecma` at the top of the file. Just put the dependencies before the actual query.
|
|
5
|
+
// ALSO: Some queries use breaking changes in the nvim-treesitter repo, that are not compatible with the (web-)tree-sitter parser.
|
|
6
|
+
import path from "path";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
8
|
+
// Resolve to src/ directory — when built, __dirname is dist/, so ../src/ gets back to source
|
|
9
|
+
const __dirname = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../src");
|
|
10
|
+
// Local query file path for languages where remote queries have incompatible predicates
|
|
11
|
+
const jsonHighlights = path.resolve(__dirname, "queries/json/highlights.scm");
|
|
12
|
+
export default {
|
|
13
|
+
parsers: [
|
|
14
|
+
{
|
|
15
|
+
filetype: "python",
|
|
16
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-python/releases/download/v0.23.6/tree-sitter-python.wasm",
|
|
17
|
+
queries: {
|
|
18
|
+
highlights: [
|
|
19
|
+
// NOTE: This nvim-treesitter query is currently broken, because the parser is not compatible with the query apparently.
|
|
20
|
+
// it is using "except" nodes that the parser is complaining about, but it has been in the query for 3+ years.
|
|
21
|
+
// Unclear.
|
|
22
|
+
// "https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/python/highlights.scm",
|
|
23
|
+
"https://github.com/tree-sitter/tree-sitter-python/raw/refs/heads/master/queries/highlights.scm",
|
|
24
|
+
],
|
|
25
|
+
locals: [
|
|
26
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/python/locals.scm",
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
filetype: "rust",
|
|
32
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-rust/releases/download/v0.24.0/tree-sitter-rust.wasm",
|
|
33
|
+
queries: {
|
|
34
|
+
highlights: [
|
|
35
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/rust/highlights.scm",
|
|
36
|
+
],
|
|
37
|
+
locals: [
|
|
38
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/rust/locals.scm",
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
filetype: "go",
|
|
44
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-go/releases/download/v0.25.0/tree-sitter-go.wasm",
|
|
45
|
+
queries: {
|
|
46
|
+
highlights: [
|
|
47
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/go/highlights.scm",
|
|
48
|
+
],
|
|
49
|
+
locals: [
|
|
50
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/go/locals.scm",
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
filetype: "cpp",
|
|
56
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-cpp/releases/download/v0.23.4/tree-sitter-cpp.wasm",
|
|
57
|
+
queries: {
|
|
58
|
+
highlights: [
|
|
59
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/cpp/highlights.scm",
|
|
60
|
+
],
|
|
61
|
+
locals: [
|
|
62
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/cpp/locals.scm",
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
filetype: "csharp",
|
|
68
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-c-sharp/releases/download/v0.23.1/tree-sitter-c_sharp.wasm",
|
|
69
|
+
queries: {
|
|
70
|
+
highlights: [
|
|
71
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/c_sharp/highlights.scm",
|
|
72
|
+
],
|
|
73
|
+
locals: [
|
|
74
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/c_sharp/locals.scm",
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
filetype: "bash",
|
|
80
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-bash/releases/download/v0.25.0/tree-sitter-bash.wasm",
|
|
81
|
+
queries: {
|
|
82
|
+
highlights: [
|
|
83
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/bash/highlights.scm",
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
filetype: "c",
|
|
89
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-c/releases/download/v0.24.1/tree-sitter-c.wasm",
|
|
90
|
+
queries: {
|
|
91
|
+
highlights: [
|
|
92
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/c/highlights.scm",
|
|
93
|
+
],
|
|
94
|
+
locals: [
|
|
95
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/c/locals.scm",
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
filetype: "java",
|
|
101
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-java/releases/download/v0.23.5/tree-sitter-java.wasm",
|
|
102
|
+
queries: {
|
|
103
|
+
highlights: [
|
|
104
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/java/highlights.scm",
|
|
105
|
+
],
|
|
106
|
+
locals: [
|
|
107
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/java/locals.scm",
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
filetype: "ruby",
|
|
113
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-ruby/releases/download/v0.23.1/tree-sitter-ruby.wasm",
|
|
114
|
+
queries: {
|
|
115
|
+
highlights: [
|
|
116
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/ruby/highlights.scm",
|
|
117
|
+
],
|
|
118
|
+
locals: [
|
|
119
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/ruby/locals.scm",
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
filetype: "php",
|
|
125
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-php/releases/download/v0.24.2/tree-sitter-php.wasm",
|
|
126
|
+
queries: {
|
|
127
|
+
highlights: [
|
|
128
|
+
// NOTE: This nvim-treesitter query is currently broken, because the parser is not compatible with the query apparently.
|
|
129
|
+
// "https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/php/highlights.scm",
|
|
130
|
+
"https://github.com/tree-sitter/tree-sitter-php/raw/refs/heads/master/queries/highlights.scm",
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
filetype: "scala",
|
|
136
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-scala/releases/download/v0.24.0/tree-sitter-scala.wasm",
|
|
137
|
+
queries: {
|
|
138
|
+
highlights: [
|
|
139
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/scala/highlights.scm",
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
filetype: "html",
|
|
145
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-html/releases/download/v0.23.2/tree-sitter-html.wasm",
|
|
146
|
+
queries: {
|
|
147
|
+
highlights: [
|
|
148
|
+
// NOTE: This nvim-treesitter query is currently broken, because the parser is not compatible with the query apparently.
|
|
149
|
+
// "https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/html/highlights.scm",
|
|
150
|
+
"https://github.com/tree-sitter/tree-sitter-html/raw/refs/heads/master/queries/highlights.scm",
|
|
151
|
+
],
|
|
152
|
+
// TODO: Injections not working for some reason
|
|
153
|
+
// injections: [
|
|
154
|
+
// "https://github.com/tree-sitter/tree-sitter-html/raw/refs/heads/master/queries/injections.scm",
|
|
155
|
+
// ],
|
|
156
|
+
},
|
|
157
|
+
// injectionMapping: {
|
|
158
|
+
// nodeTypes: {
|
|
159
|
+
// script_element: "javascript",
|
|
160
|
+
// style_element: "css",
|
|
161
|
+
// },
|
|
162
|
+
// infoStringMap: {
|
|
163
|
+
// javascript: "javascript",
|
|
164
|
+
// css: "css",
|
|
165
|
+
// },
|
|
166
|
+
// },
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
filetype: "json",
|
|
170
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-json/releases/download/v0.24.8/tree-sitter-json.wasm",
|
|
171
|
+
queries: {
|
|
172
|
+
highlights: [
|
|
173
|
+
// Local query file - nvim-treesitter and tree-sitter-json queries use predicates/captures
|
|
174
|
+
// incompatible with web-tree-sitter or themes.ts
|
|
175
|
+
jsonHighlights,
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
filetype: "yaml",
|
|
181
|
+
wasm: "https://github.com/tree-sitter-grammars/tree-sitter-yaml/releases/download/v0.7.2/tree-sitter-yaml.wasm",
|
|
182
|
+
queries: {
|
|
183
|
+
highlights: [
|
|
184
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/yaml/highlights.scm",
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
filetype: "haskell",
|
|
190
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-haskell/releases/download/v0.23.1/tree-sitter-haskell.wasm",
|
|
191
|
+
queries: {
|
|
192
|
+
highlights: [
|
|
193
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/haskell/highlights.scm",
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
filetype: "css",
|
|
199
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-css/releases/download/v0.25.0/tree-sitter-css.wasm",
|
|
200
|
+
queries: {
|
|
201
|
+
highlights: [
|
|
202
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/css/highlights.scm",
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
filetype: "julia",
|
|
208
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-julia/releases/download/v0.23.1/tree-sitter-julia.wasm",
|
|
209
|
+
queries: {
|
|
210
|
+
highlights: [
|
|
211
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/julia/highlights.scm",
|
|
212
|
+
],
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
filetype: "ocaml",
|
|
217
|
+
wasm: "https://github.com/tree-sitter/tree-sitter-ocaml/releases/download/v0.24.2/tree-sitter-ocaml.wasm",
|
|
218
|
+
queries: {
|
|
219
|
+
highlights: [
|
|
220
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/ocaml/highlights.scm",
|
|
221
|
+
],
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
filetype: "clojure",
|
|
226
|
+
wasm: "https://github.com/sogaiu/tree-sitter-clojure/releases/download/v0.0.13/tree-sitter-clojure.wasm",
|
|
227
|
+
queries: {
|
|
228
|
+
highlights: [
|
|
229
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/clojure/highlights.scm",
|
|
230
|
+
],
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
filetype: "swift",
|
|
235
|
+
wasm: "https://github.com/alex-pinkus/tree-sitter-swift/releases/download/0.7.1/tree-sitter-swift.wasm",
|
|
236
|
+
queries: {
|
|
237
|
+
highlights: [
|
|
238
|
+
// NOTE: Using parser repo queries instead of nvim-treesitter due to incompatible #lua-match? predicates
|
|
239
|
+
// "https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/highlights.scm
|
|
240
|
+
"https://raw.githubusercontent.com/alex-pinkus/tree-sitter-swift/main/queries/highlights.scm",
|
|
241
|
+
],
|
|
242
|
+
locals: [
|
|
243
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/swift/locals.scm",
|
|
244
|
+
],
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
filetype: "nix",
|
|
249
|
+
// TODO: Replace with official tree-sitter-nix WASM when published
|
|
250
|
+
// See: https://github.com/nix-community/tree-sitter-nix/issues/66
|
|
251
|
+
wasm: "https://github.com/ast-grep/ast-grep.github.io/raw/40b84530640aa83a0d34a20a2b0623d7b8e5ea97/website/public/parsers/tree-sitter-nix.wasm",
|
|
252
|
+
queries: {
|
|
253
|
+
highlights: [
|
|
254
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/nix/highlights.scm",
|
|
255
|
+
],
|
|
256
|
+
locals: [
|
|
257
|
+
"https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/refs/heads/master/queries/nix/locals.scm",
|
|
258
|
+
],
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
filetype: "prisma",
|
|
263
|
+
wasm: path.resolve(__dirname, "parsers/tree-sitter-prisma.wasm"),
|
|
264
|
+
queries: {
|
|
265
|
+
highlights: [
|
|
266
|
+
"https://raw.githubusercontent.com/victorhqc/tree-sitter-prisma/main/queries/highlights.scm",
|
|
267
|
+
],
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch-terminal-dimensions.d.ts","sourceRoot":"","sources":["../src/patch-terminal-dimensions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Polyfill for terminal dimensions in Bun compiled binaries.
|
|
2
|
+
// Bun's `--compile` produces binaries where process.stdout.columns/rows are 0
|
|
3
|
+
// instead of the actual terminal size (even when isTTY is true).
|
|
4
|
+
// This must be imported before any opentui imports, since opentui reads
|
|
5
|
+
// stdout.columns at init time and uses `?? fallback` which doesn't catch 0.
|
|
6
|
+
import { execSync } from "child_process";
|
|
7
|
+
function getTerminalSize() {
|
|
8
|
+
try {
|
|
9
|
+
const cols = parseInt(execSync("tput cols", {
|
|
10
|
+
encoding: "utf-8",
|
|
11
|
+
stdio: ["inherit", "pipe", "pipe"],
|
|
12
|
+
}).trim());
|
|
13
|
+
const rows = parseInt(execSync("tput lines", {
|
|
14
|
+
encoding: "utf-8",
|
|
15
|
+
stdio: ["inherit", "pipe", "pipe"],
|
|
16
|
+
}).trim());
|
|
17
|
+
if (cols > 0 && rows > 0)
|
|
18
|
+
return { cols, rows };
|
|
19
|
+
}
|
|
20
|
+
catch { }
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
if (process.stdout.isTTY && process.stdout.columns === 0) {
|
|
24
|
+
const size = getTerminalSize();
|
|
25
|
+
if (size) {
|
|
26
|
+
Object.defineProperty(process.stdout, "columns", {
|
|
27
|
+
value: size.cols,
|
|
28
|
+
writable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(process.stdout, "rows", {
|
|
32
|
+
value: size.rows,
|
|
33
|
+
writable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
});
|
|
36
|
+
// Keep patched values updated on terminal resize
|
|
37
|
+
process.on("SIGWINCH", () => {
|
|
38
|
+
const newSize = getTerminalSize();
|
|
39
|
+
if (newSize) {
|
|
40
|
+
process.stdout.columns = newSize.cols;
|
|
41
|
+
process.stdout.rows = newSize.rows;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdin-pager.test.d.ts","sourceRoot":"","sources":["../src/stdin-pager.test.ts"],"names":[],"mappings":""}
|