@plurnk/plurnk-mimetypes-text-vim 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/LICENSE +21 -0
- package/README.md +25 -0
- package/dist/TextVim.d.ts +6 -0
- package/dist/TextVim.d.ts.map +1 -0
- package/dist/TextVim.js +157 -0
- package/dist/TextVim.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PossumTech Laboratories, LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @plurnk/plurnk-mimetypes-text-vim
|
|
2
|
+
|
|
3
|
+
`text/x-vim` (Vimscript) mimetype handler for the [plurnk](https://github.com/plurnk) ecosystem. Tier 4 hand-rolled — no parser dependency.
|
|
4
|
+
|
|
5
|
+
## why hand-rolled
|
|
6
|
+
|
|
7
|
+
The only faithful tree-sitter Vimscript grammar generates a 33,000-line lexer that V8's optimizer **OOM-aborts the host Node process** on any parse — uncatchable, and a portability violation the family won't ship. It also silently drops vim9 `def` functions. A line-oriented scanner has neither problem: it parses both legacy `function` and vim9 `def`, skips embedded-script heredocs (`python3 << EOF`) so their bodies can't leak false symbols, and degrades cleanly on truncated input.
|
|
8
|
+
|
|
9
|
+
## what it emits
|
|
10
|
+
|
|
11
|
+
`extractRaw` → `MimeSymbol[]` with 1-indexed positions:
|
|
12
|
+
|
|
13
|
+
| construct | kind |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `function! [scope:]Name(` / `def Name(` | `function` (span to `endfunction`/`enddef`) |
|
|
16
|
+
| `command! [-flags] Name` | `function` |
|
|
17
|
+
| `augroup Name` … `augroup END` | `module` |
|
|
18
|
+
| `let g:Name` / `let s:Name` / `var Name` | `variable` |
|
|
19
|
+
| `const Name` / `final Name` (vim9) | `constant` |
|
|
20
|
+
|
|
21
|
+
Function-local (`l:`), buffer/window/tab (`b:`/`w:`/`t:`) lets and comment lines are skipped. References are deferred until a non-aborting grammar exists.
|
|
22
|
+
|
|
23
|
+
## license
|
|
24
|
+
|
|
25
|
+
MIT.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseHandler } from "@plurnk/plurnk-mimetypes";
|
|
2
|
+
import type { HandlerContent, MimeSymbol } from "@plurnk/plurnk-mimetypes";
|
|
3
|
+
export default class TextVim extends BaseHandler {
|
|
4
|
+
extractRaw(content: HandlerContent): MimeSymbol[];
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=TextVim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextVim.d.ts","sourceRoot":"","sources":["../src/TextVim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAyB3E,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,WAAW;IACnC,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,UAAU,EAAE;CAM7D"}
|
package/dist/TextVim.js
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { BaseHandler } from "@plurnk/plurnk-mimetypes";
|
|
2
|
+
// text/x-vim handler (Tier 4 hand-roll, symbols only).
|
|
3
|
+
//
|
|
4
|
+
// Vimscript has no usable tree-sitter grammar: the only faithful one
|
|
5
|
+
// (tree-sitter-grammars/tree-sitter-vim) generates a 33k-line lexer that V8
|
|
6
|
+
// OOM-aborts the host process on any parse — uncatchable, and a portability
|
|
7
|
+
// violation we won't ship (plurnk-mimetypes#0 probe, 2026-06-12). It also
|
|
8
|
+
// silently drops vim9 `def` functions. A line-oriented scanner has NEITHER
|
|
9
|
+
// problem and is strictly more robust for the radar/outline use: declarations
|
|
10
|
+
// are keyword-prefixed lines, honestly parseable in well under the family's
|
|
11
|
+
// hand-roll threshold.
|
|
12
|
+
//
|
|
13
|
+
// Emits (with 1-indexed line/endLine/column):
|
|
14
|
+
// function! [scope:]Name( / def Name( → function (span to endfunction/enddef)
|
|
15
|
+
// command! [-flags] Name → function (user commands are callable)
|
|
16
|
+
// augroup Name → module (span to `augroup END`)
|
|
17
|
+
// let g:/s:Name, var Name → variable
|
|
18
|
+
// const/final Name → constant (vim9)
|
|
19
|
+
//
|
|
20
|
+
// Heredocs (`let x =<< END`, `python3 << EOF`) are skipped to their closing
|
|
21
|
+
// marker so embedded script bodies never leak false symbols — the exact case
|
|
22
|
+
// that corrupts the tree-sitter grammar. Comment lines (`"` first) and blanks
|
|
23
|
+
// are ignored. References are deferred with the grammar (the channel stays
|
|
24
|
+
// empty); symbols are what the outline needs.
|
|
25
|
+
export default class TextVim extends BaseHandler {
|
|
26
|
+
extractRaw(content) {
|
|
27
|
+
const text = typeof content === "string"
|
|
28
|
+
? content
|
|
29
|
+
: new TextDecoder("utf-8").decode(content);
|
|
30
|
+
return scan(text);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// Keyword abbreviation patterns — Vim accepts any prefix down to the listed
|
|
34
|
+
// minimum (`fu`, `com`, `aug`, `endf`).
|
|
35
|
+
const RE_FUNCTION = /^\s*fu(?:n(?:c(?:t(?:i(?:o(?:n)?)?)?)?)?)?!?\s+(\S+?)\s*\(/d;
|
|
36
|
+
const RE_DEF = /^\s*def!?\s+(\S+?)\s*\(/d;
|
|
37
|
+
const RE_END_FN = /^\s*(?:endf(?:u(?:n(?:c(?:t(?:i(?:o(?:n)?)?)?)?)?)?)?|enddef)\b/;
|
|
38
|
+
const RE_COMMAND = /^\s*com(?:m(?:a(?:n(?:d)?)?)?)?!?\s+(.+)$/;
|
|
39
|
+
const RE_AUGROUP = /^\s*aug(?:r(?:o(?:u(?:p)?)?)?)?\s+(\S+)/d;
|
|
40
|
+
const RE_LET = /^\s*let\s+([gs]:[A-Za-z_]\w*)/d;
|
|
41
|
+
const RE_VAR = /^\s*(var|const|final)\s+([A-Za-z_]\w*)/d;
|
|
42
|
+
// Heredoc opener: `=<< [trim] [eval] MARKER` (list assignment) or
|
|
43
|
+
// `<< MARKER` (embedded script). MARKER is a bare word ending the line.
|
|
44
|
+
const RE_HEREDOC = /(?:=<<|<<)\s*(?:trim\s+)?(?:eval\s+)?([A-Za-z_]\w*)\s*$/;
|
|
45
|
+
function scan(text) {
|
|
46
|
+
const lines = text.split("\n");
|
|
47
|
+
const out = [];
|
|
48
|
+
let pendingFn = -1; // index in `out` of an open function/def
|
|
49
|
+
let pendingAug = -1; // index in `out` of an open augroup
|
|
50
|
+
let heredoc = null;
|
|
51
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
52
|
+
const line = lines[i];
|
|
53
|
+
const lineNo = i + 1;
|
|
54
|
+
if (heredoc !== null) {
|
|
55
|
+
if (line.trim() === heredoc)
|
|
56
|
+
heredoc = null;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const lead = line.trimStart();
|
|
60
|
+
if (lead.length === 0 || lead.startsWith('"'))
|
|
61
|
+
continue;
|
|
62
|
+
// Close an open function/def first — `endfunction` carries no symbol.
|
|
63
|
+
if (RE_END_FN.test(line)) {
|
|
64
|
+
if (pendingFn >= 0) {
|
|
65
|
+
out[pendingFn].endLine = lineNo;
|
|
66
|
+
pendingFn = -1;
|
|
67
|
+
}
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
let matched = false;
|
|
71
|
+
const aug = RE_AUGROUP.exec(line);
|
|
72
|
+
if (aug) {
|
|
73
|
+
matched = true;
|
|
74
|
+
const name = aug[1];
|
|
75
|
+
if (name.toUpperCase() === "END") {
|
|
76
|
+
if (pendingAug >= 0) {
|
|
77
|
+
out[pendingAug].endLine = lineNo;
|
|
78
|
+
pendingAug = -1;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
out.push(sym("module", name, lineNo, col(aug, 1)));
|
|
83
|
+
pendingAug = out.length - 1;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (!matched) {
|
|
87
|
+
const fn = RE_FUNCTION.exec(line) ?? RE_DEF.exec(line);
|
|
88
|
+
if (fn) {
|
|
89
|
+
matched = true;
|
|
90
|
+
out.push(sym("function", fn[1], lineNo, col(fn, 1)));
|
|
91
|
+
pendingFn = out.length - 1;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (!matched) {
|
|
95
|
+
const cmd = RE_COMMAND.exec(line);
|
|
96
|
+
if (cmd) {
|
|
97
|
+
const named = commandName(cmd[1]);
|
|
98
|
+
if (named) {
|
|
99
|
+
matched = true;
|
|
100
|
+
out.push(sym("function", named.name, lineNo, leadCol(line) + named.offset));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (!matched) {
|
|
105
|
+
const lt = RE_LET.exec(line);
|
|
106
|
+
if (lt) {
|
|
107
|
+
matched = true;
|
|
108
|
+
out.push(sym("variable", lt[1], lineNo, col(lt, 1)));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (!matched) {
|
|
112
|
+
const v = RE_VAR.exec(line);
|
|
113
|
+
if (v) {
|
|
114
|
+
matched = true;
|
|
115
|
+
const kind = v[1] === "var" ? "variable" : "constant";
|
|
116
|
+
out.push(sym(kind, v[2], lineNo, col(v, 2)));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// After emitting any symbol on this line, a trailing heredoc opener
|
|
120
|
+
// (`let g:list =<< END`) starts skipping the body on following lines.
|
|
121
|
+
const hd = RE_HEREDOC.exec(line);
|
|
122
|
+
if (hd)
|
|
123
|
+
heredoc = hd[1];
|
|
124
|
+
}
|
|
125
|
+
// Truncated file: an unclosed function/augroup spans to the last line.
|
|
126
|
+
if (pendingFn >= 0)
|
|
127
|
+
out[pendingFn].endLine = lines.length;
|
|
128
|
+
if (pendingAug >= 0)
|
|
129
|
+
out[pendingAug].endLine = lines.length;
|
|
130
|
+
return out;
|
|
131
|
+
}
|
|
132
|
+
// A command line is `Name args...` after optional `-flag` / `-flag=val`
|
|
133
|
+
// attributes. The name is the first token that doesn't start with `-`.
|
|
134
|
+
function commandName(rest) {
|
|
135
|
+
const re = /\S+/g;
|
|
136
|
+
let m;
|
|
137
|
+
while ((m = re.exec(rest)) !== null) {
|
|
138
|
+
if (!m[0].startsWith("-"))
|
|
139
|
+
return { name: m[0], offset: m.index };
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
function leadCol(line) {
|
|
144
|
+
// 1-indexed column where `rest` (post-`command! `) begins.
|
|
145
|
+
const m = RE_COMMAND.exec(line);
|
|
146
|
+
if (!m)
|
|
147
|
+
return 1;
|
|
148
|
+
return line.length - m[1].length + 1;
|
|
149
|
+
}
|
|
150
|
+
function col(m, group) {
|
|
151
|
+
const idx = m.indices?.[group];
|
|
152
|
+
return idx ? idx[0] + 1 : 1;
|
|
153
|
+
}
|
|
154
|
+
function sym(kind, name, line, column) {
|
|
155
|
+
return { name, kind, line, endLine: line, column, endColumn: column + name.length };
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=TextVim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextVim.js","sourceRoot":"","sources":["../src/TextVim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,uDAAuD;AACvD,EAAE;AACF,qEAAqE;AACrE,4EAA4E;AAC5E,4EAA4E;AAC5E,0EAA0E;AAC1E,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,uBAAuB;AACvB,EAAE;AACF,8CAA8C;AAC9C,mFAAmF;AACnF,oFAAoF;AACpF,+EAA+E;AAC/E,qDAAqD;AACrD,8DAA8D;AAC9D,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,8EAA8E;AAC9E,2EAA2E;AAC3E,8CAA8C;AAC9C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,WAAW;IACnC,UAAU,CAAC,OAAuB;QACvC,MAAM,IAAI,GAAG,OAAO,OAAO,KAAK,QAAQ;YACpC,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;CACJ;AAED,4EAA4E;AAC5E,wCAAwC;AACxC,MAAM,WAAW,GAAG,6DAA6D,CAAC;AAClF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;IAC/B,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,GAAG,CAAC,IAAwB,EAAE,IAAY,EAAE,IAAY,EAAE,MAAc;IAC7E,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;AACxF,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@plurnk/plurnk-mimetypes-text-vim",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "text/x-vim (Vimscript) mimetype handler for plurnk-service. Hand-rolled line scanner; no parser dependency.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=25"
|
|
12
|
+
},
|
|
13
|
+
"plurnk": {
|
|
14
|
+
"kind": "mimetype",
|
|
15
|
+
"handlers": [
|
|
16
|
+
{
|
|
17
|
+
"name": "text/x-vim",
|
|
18
|
+
"glyph": "📗",
|
|
19
|
+
"extensions": [
|
|
20
|
+
".vim",
|
|
21
|
+
".vimrc",
|
|
22
|
+
".gvimrc",
|
|
23
|
+
"vimrc",
|
|
24
|
+
"gvimrc",
|
|
25
|
+
"_vimrc",
|
|
26
|
+
"_gvimrc"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"default": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist/**/*",
|
|
40
|
+
"README.md"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"test:lint": "tsc --noEmit",
|
|
44
|
+
"test:unit": "node --test src/**/*.test.ts",
|
|
45
|
+
"test": "npm run test:lint && npm run test:unit",
|
|
46
|
+
"build:dist": "tsc -p tsconfig.build.json",
|
|
47
|
+
"build": "npm run build:dist",
|
|
48
|
+
"prepare": "npm run build"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^25.8.0",
|
|
52
|
+
"typescript": "^6.0.3",
|
|
53
|
+
"@plurnk/plurnk-mimetypes": "^0.15.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@plurnk/plurnk-mimetypes": "^0.15.0"
|
|
57
|
+
}
|
|
58
|
+
}
|