@lexd/language-server 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/dist/analysis.d.ts +75 -0
- package/dist/analysis.d.ts.map +1 -0
- package/dist/analysis.js +567 -0
- package/dist/analysis.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +159 -0
- package/dist/server.js.map +1 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Harvey Randall
|
|
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.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { CONSTRAINT_ATTRS, ModuleRegistry, PRIMITIVES, PRIMARY_ATTRS, SECTION_NAMES, type Attribute, type ImportDecl, type LexdFile, type SourceSpan, type TypeDecl, type TypeExpr } from '@lexd/core';
|
|
2
|
+
export interface DiagnosticInfo {
|
|
3
|
+
message: string;
|
|
4
|
+
severity: 'error' | 'warning';
|
|
5
|
+
span?: SourceSpan;
|
|
6
|
+
}
|
|
7
|
+
export interface SymbolLocation {
|
|
8
|
+
uri: string;
|
|
9
|
+
span: SourceSpan;
|
|
10
|
+
detail?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AnalyzedDocument {
|
|
13
|
+
uri: string;
|
|
14
|
+
path: string;
|
|
15
|
+
text: string;
|
|
16
|
+
ast: LexdFile | null;
|
|
17
|
+
diagnostics: DiagnosticInfo[];
|
|
18
|
+
/** Local type name → declaration (last wins). */
|
|
19
|
+
localTypes: Map<string, TypeDecl>;
|
|
20
|
+
/** Import local binding → module/imported metadata. */
|
|
21
|
+
imports: Map<string, {
|
|
22
|
+
module: string;
|
|
23
|
+
imported: string;
|
|
24
|
+
decl: ImportDecl;
|
|
25
|
+
}>;
|
|
26
|
+
/** Resolved import local → lexicon ref when registry is available. */
|
|
27
|
+
importRefs: Map<string, string>;
|
|
28
|
+
}
|
|
29
|
+
export interface WorkspaceIndex {
|
|
30
|
+
/** Module NSID → source file path + type decls for defs. */
|
|
31
|
+
modules: Map<string, {
|
|
32
|
+
path: string;
|
|
33
|
+
types: Map<string, TypeDecl>;
|
|
34
|
+
file: LexdFile;
|
|
35
|
+
}>;
|
|
36
|
+
/** Pre-built registry snapshot; clone per analysis request. */
|
|
37
|
+
registry: ModuleRegistry;
|
|
38
|
+
}
|
|
39
|
+
export declare function uriToPath(uri: string): string;
|
|
40
|
+
export declare function pathToUri(path: string): string;
|
|
41
|
+
/** Build NSID → path index from workspace roots + stdlib. */
|
|
42
|
+
export declare function buildWorkspaceIndex(workspaceFolders: string[], options?: {
|
|
43
|
+
stdlibPaths?: string[];
|
|
44
|
+
}): WorkspaceIndex;
|
|
45
|
+
export declare function analyzeDocument(uri: string, text: string, workspace?: WorkspaceIndex, options?: {
|
|
46
|
+
stdlibPaths?: string[];
|
|
47
|
+
}): AnalyzedDocument;
|
|
48
|
+
export declare function formatTypeExpr(type: TypeExpr): string;
|
|
49
|
+
export declare function formatAttributes(attrs: Attribute[]): string;
|
|
50
|
+
export declare function offsetAt(text: string, line: number, character: number): number;
|
|
51
|
+
export declare function positionAt(text: string, offset: number): {
|
|
52
|
+
line: number;
|
|
53
|
+
character: number;
|
|
54
|
+
};
|
|
55
|
+
export declare function spanContains(span: SourceSpan, offset: number): boolean;
|
|
56
|
+
export declare function wordAt(text: string, offset: number): {
|
|
57
|
+
word: string;
|
|
58
|
+
start: number;
|
|
59
|
+
end: number;
|
|
60
|
+
};
|
|
61
|
+
export interface HoverTarget {
|
|
62
|
+
kind: 'field' | 'type' | 'import' | 'attribute';
|
|
63
|
+
markdown: string;
|
|
64
|
+
}
|
|
65
|
+
export declare function hoverAt(doc: AnalyzedDocument, offset: number): HoverTarget | null;
|
|
66
|
+
export declare function definitionAt(doc: AnalyzedDocument, offset: number, workspace?: WorkspaceIndex): SymbolLocation | null;
|
|
67
|
+
export interface CompletionItemInfo {
|
|
68
|
+
label: string;
|
|
69
|
+
kind: 'keyword' | 'type' | 'property' | 'snippet' | 'text';
|
|
70
|
+
detail?: string;
|
|
71
|
+
insertText?: string;
|
|
72
|
+
}
|
|
73
|
+
export declare function completionsAt(doc: AnalyzedDocument, offset: number): CompletionItemInfo[];
|
|
74
|
+
export { CONSTRAINT_ATTRS, PRIMITIVES, PRIMARY_ATTRS, SECTION_NAMES };
|
|
75
|
+
//# sourceMappingURL=analysis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analysis.d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,WAAW;IAC1B,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAA;IAC/C,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAsEjF;AAkDD,wBAAgB,YAAY,CAC1B,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,cAAc,GACzB,cAAc,GAAG,IAAI,CA2CvB;AA6DD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAA;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAmFzF;AAED,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,CAAA"}
|
package/dist/analysis.js
ADDED
|
@@ -0,0 +1,567 @@
|
|
|
1
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { CONSTRAINT_ATTRS, LexdCompileError, LexdSyntaxError, ModuleRegistry, PRIMITIVES, PRIMARY_ATTRS, SECTION_NAMES, buildImportMap, discoverStdlibLexdFiles, lower, parseLexd, } from '@lexd/core';
|
|
5
|
+
function walkLexdFiles(dir, out = []) {
|
|
6
|
+
if (!existsSync(dir))
|
|
7
|
+
return out;
|
|
8
|
+
for (const name of readdirSync(dir)) {
|
|
9
|
+
if (name === 'node_modules' || name === 'dist' || name === '.git')
|
|
10
|
+
continue;
|
|
11
|
+
const p = join(dir, name);
|
|
12
|
+
let st;
|
|
13
|
+
try {
|
|
14
|
+
st = statSync(p);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (st.isDirectory())
|
|
20
|
+
walkLexdFiles(p, out);
|
|
21
|
+
else if (name.endsWith('.lexd'))
|
|
22
|
+
out.push(p);
|
|
23
|
+
}
|
|
24
|
+
return out;
|
|
25
|
+
}
|
|
26
|
+
export function uriToPath(uri) {
|
|
27
|
+
if (uri.startsWith('file://')) {
|
|
28
|
+
return fileURLToPath(uri);
|
|
29
|
+
}
|
|
30
|
+
return uri;
|
|
31
|
+
}
|
|
32
|
+
export function pathToUri(path) {
|
|
33
|
+
if (path.startsWith('file://'))
|
|
34
|
+
return path;
|
|
35
|
+
// Ensure absolute file URI
|
|
36
|
+
const abs = path.startsWith('/') ? path : join(process.cwd(), path);
|
|
37
|
+
return `file://${abs}`;
|
|
38
|
+
}
|
|
39
|
+
function registerModulesFromFile(file, path, modules) {
|
|
40
|
+
for (const ns of file.namespaces) {
|
|
41
|
+
const primaries = ns.types.filter((t) => t.primary);
|
|
42
|
+
if (primaries.length === 0) {
|
|
43
|
+
const types = new Map(ns.types.map((t) => [t.name, t]));
|
|
44
|
+
modules.set(ns.name, { path, types, file });
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
let currentId;
|
|
48
|
+
let currentTypes = new Map();
|
|
49
|
+
for (const t of ns.types) {
|
|
50
|
+
if (t.primary) {
|
|
51
|
+
currentId = `${ns.name}.${t.name}`;
|
|
52
|
+
currentTypes = new Map([['main', t]]);
|
|
53
|
+
modules.set(currentId, { path, types: currentTypes, file });
|
|
54
|
+
}
|
|
55
|
+
else if (currentId) {
|
|
56
|
+
currentTypes.set(t.name, t);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** Build NSID → path index from workspace roots + stdlib. */
|
|
62
|
+
export function buildWorkspaceIndex(workspaceFolders, options = {}) {
|
|
63
|
+
const stdlibPaths = options.stdlibPaths ?? [];
|
|
64
|
+
const modules = new Map();
|
|
65
|
+
const registry = new ModuleRegistry();
|
|
66
|
+
const roots = workspaceFolders.length > 0 ? workspaceFolders : [process.cwd()];
|
|
67
|
+
const paths = new Set();
|
|
68
|
+
for (const root of roots) {
|
|
69
|
+
for (const p of discoverStdlibLexdFiles(root, stdlibPaths))
|
|
70
|
+
paths.add(p);
|
|
71
|
+
for (const rel of ['examples', 'packages', 'src', 'lexd']) {
|
|
72
|
+
const dir = join(root, rel);
|
|
73
|
+
if (existsSync(dir)) {
|
|
74
|
+
for (const p of walkLexdFiles(dir))
|
|
75
|
+
paths.add(p);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
for (const path of [...paths].sort()) {
|
|
80
|
+
try {
|
|
81
|
+
const source = readFileSync(path, 'utf8');
|
|
82
|
+
const file = parseLexd(source, path);
|
|
83
|
+
registry.registerFile(file);
|
|
84
|
+
registerModulesFromFile(file, path, modules);
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// skip unparseable files in the index
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return { modules, registry };
|
|
91
|
+
}
|
|
92
|
+
function registryForAnalysis(ast, workspace, stdlibPaths = []) {
|
|
93
|
+
const registry = workspace ? workspace.registry.clone() : new ModuleRegistry();
|
|
94
|
+
if (!workspace) {
|
|
95
|
+
try {
|
|
96
|
+
const cwd = ast.filename ? dirname(ast.filename) : process.cwd();
|
|
97
|
+
for (const p of discoverStdlibLexdFiles(cwd, stdlibPaths)) {
|
|
98
|
+
try {
|
|
99
|
+
registry.registerFile(parseLexd(readFileSync(p, 'utf8'), p));
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
/* skip */
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
/* skip */
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
registry.registerFile(ast);
|
|
111
|
+
return registry;
|
|
112
|
+
}
|
|
113
|
+
export function analyzeDocument(uri, text, workspace, options = {}) {
|
|
114
|
+
const path = uriToPath(uri);
|
|
115
|
+
const diagnostics = [];
|
|
116
|
+
let ast = null;
|
|
117
|
+
const localTypes = new Map();
|
|
118
|
+
const imports = new Map();
|
|
119
|
+
const importRefs = new Map();
|
|
120
|
+
try {
|
|
121
|
+
ast = parseLexd(text, path);
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
if (err instanceof LexdSyntaxError) {
|
|
125
|
+
diagnostics.push({
|
|
126
|
+
message: err.message,
|
|
127
|
+
severity: 'error',
|
|
128
|
+
span: err.span,
|
|
129
|
+
});
|
|
130
|
+
return { uri, path, text, ast: null, diagnostics, localTypes, imports, importRefs };
|
|
131
|
+
}
|
|
132
|
+
diagnostics.push({
|
|
133
|
+
message: err instanceof Error ? err.message : String(err),
|
|
134
|
+
severity: 'error',
|
|
135
|
+
});
|
|
136
|
+
return { uri, path, text, ast: null, diagnostics, localTypes, imports, importRefs };
|
|
137
|
+
}
|
|
138
|
+
for (const ns of ast.namespaces) {
|
|
139
|
+
for (const t of ns.types)
|
|
140
|
+
localTypes.set(t.name, t);
|
|
141
|
+
}
|
|
142
|
+
for (const imp of ast.imports) {
|
|
143
|
+
for (const b of imp.bindings) {
|
|
144
|
+
imports.set(b.local, {
|
|
145
|
+
module: imp.module,
|
|
146
|
+
imported: imp.kind === 'whole' ? 'main' : b.imported,
|
|
147
|
+
decl: imp,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const registry = registryForAnalysis(ast, workspace, options.stdlibPaths);
|
|
152
|
+
try {
|
|
153
|
+
const refs = buildImportMap(ast, registry);
|
|
154
|
+
for (const [k, v] of refs)
|
|
155
|
+
importRefs.set(k, v);
|
|
156
|
+
lower(ast, registry);
|
|
157
|
+
}
|
|
158
|
+
catch (err) {
|
|
159
|
+
if (err instanceof LexdCompileError || err instanceof LexdSyntaxError) {
|
|
160
|
+
diagnostics.push({
|
|
161
|
+
message: err.message,
|
|
162
|
+
severity: 'error',
|
|
163
|
+
span: err instanceof LexdSyntaxError ? err.span : undefined,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
diagnostics.push({
|
|
168
|
+
message: err instanceof Error ? err.message : String(err),
|
|
169
|
+
severity: 'error',
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return { uri, path, text, ast, diagnostics, localTypes, imports, importRefs };
|
|
174
|
+
}
|
|
175
|
+
export function formatTypeExpr(type) {
|
|
176
|
+
switch (type.kind) {
|
|
177
|
+
case 'primitive':
|
|
178
|
+
return type.name;
|
|
179
|
+
case 'array':
|
|
180
|
+
return `${formatTypeExpr(type.element)}[]`;
|
|
181
|
+
case 'ref':
|
|
182
|
+
return type.name;
|
|
183
|
+
case 'union': {
|
|
184
|
+
const closed = type.closed ? 'closed ' : '';
|
|
185
|
+
return `${closed}union(${type.refs.map(formatTypeExpr).join(', ')})`;
|
|
186
|
+
}
|
|
187
|
+
case 'inline': {
|
|
188
|
+
const inner = type.fields
|
|
189
|
+
.map((f) => {
|
|
190
|
+
const attrs = formatAttributes(f.attributes);
|
|
191
|
+
const prefix = attrs ? `${attrs} ` : '';
|
|
192
|
+
return `${prefix}${f.name}${f.optional ? '?' : ''}: ${formatTypeExpr(f.type)}`;
|
|
193
|
+
})
|
|
194
|
+
.join(', ');
|
|
195
|
+
return `{ ${inner} }`;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
export function formatAttributes(attrs) {
|
|
200
|
+
if (attrs.length === 0)
|
|
201
|
+
return '';
|
|
202
|
+
return attrs
|
|
203
|
+
.map((a) => {
|
|
204
|
+
if (a.args.length === 0)
|
|
205
|
+
return `@${a.name}`;
|
|
206
|
+
const args = a.args.map((v) => JSON.stringify(v)).join(', ');
|
|
207
|
+
return `@${a.name}(${args})`;
|
|
208
|
+
})
|
|
209
|
+
.join(' ');
|
|
210
|
+
}
|
|
211
|
+
export function offsetAt(text, line, character) {
|
|
212
|
+
const lines = text.split('\n');
|
|
213
|
+
let offset = 0;
|
|
214
|
+
for (let i = 0; i < line && i < lines.length; i++) {
|
|
215
|
+
offset += (lines[i]?.length ?? 0) + 1;
|
|
216
|
+
}
|
|
217
|
+
return offset + character;
|
|
218
|
+
}
|
|
219
|
+
export function positionAt(text, offset) {
|
|
220
|
+
let line = 0;
|
|
221
|
+
let character = 0;
|
|
222
|
+
for (let i = 0; i < offset && i < text.length; i++) {
|
|
223
|
+
if (text[i] === '\n') {
|
|
224
|
+
line++;
|
|
225
|
+
character = 0;
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
character++;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return { line, character };
|
|
232
|
+
}
|
|
233
|
+
export function spanContains(span, offset) {
|
|
234
|
+
return offset >= span.startOffset && offset <= span.endOffset;
|
|
235
|
+
}
|
|
236
|
+
export function wordAt(text, offset) {
|
|
237
|
+
let start = offset;
|
|
238
|
+
let end = offset;
|
|
239
|
+
while (start > 0 && /[A-Za-z0-9_#.-]/.test(text[start - 1]))
|
|
240
|
+
start--;
|
|
241
|
+
while (end < text.length && /[A-Za-z0-9_#.-]/.test(text[end]))
|
|
242
|
+
end++;
|
|
243
|
+
return { word: text.slice(start, end), start, end };
|
|
244
|
+
}
|
|
245
|
+
function findTypeExprAt(type, offset) {
|
|
246
|
+
if (type.span && spanContains(type.span, offset)) {
|
|
247
|
+
if (type.kind === 'array') {
|
|
248
|
+
const inner = findTypeExprAt(type.element, offset);
|
|
249
|
+
return inner ?? type;
|
|
250
|
+
}
|
|
251
|
+
if (type.kind === 'union') {
|
|
252
|
+
for (const r of type.refs) {
|
|
253
|
+
const hit = findTypeExprAt(r, offset);
|
|
254
|
+
if (hit)
|
|
255
|
+
return hit;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return type;
|
|
259
|
+
}
|
|
260
|
+
if (type.kind === 'array')
|
|
261
|
+
return findTypeExprAt(type.element, offset);
|
|
262
|
+
if (type.kind === 'union') {
|
|
263
|
+
for (const r of type.refs) {
|
|
264
|
+
const hit = findTypeExprAt(r, offset);
|
|
265
|
+
if (hit)
|
|
266
|
+
return hit;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
export function hoverAt(doc, offset) {
|
|
272
|
+
if (!doc.ast)
|
|
273
|
+
return null;
|
|
274
|
+
for (const ns of doc.ast.namespaces) {
|
|
275
|
+
for (const t of ns.types) {
|
|
276
|
+
if (t.span && spanContains(t.span, offset)) {
|
|
277
|
+
const attrs = formatAttributes(t.attributes);
|
|
278
|
+
const kind = t.primary
|
|
279
|
+
? t.attributes.find((a) => PRIMARY_ATTRS.has(a.name))?.name ?? 'primary'
|
|
280
|
+
: t.isToken
|
|
281
|
+
? 'token'
|
|
282
|
+
: 'def';
|
|
283
|
+
return {
|
|
284
|
+
kind: 'type',
|
|
285
|
+
markdown: [
|
|
286
|
+
`\`\`\`lexd\ntype ${t.name}\n\`\`\``,
|
|
287
|
+
`**${kind}** in \`${ns.name}\`${attrs ? `\n\n${attrs}` : ''}`,
|
|
288
|
+
].join('\n\n'),
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
for (const f of t.fields) {
|
|
292
|
+
if (f.span && spanContains(f.span, offset)) {
|
|
293
|
+
return {
|
|
294
|
+
kind: 'field',
|
|
295
|
+
markdown: fieldHover(f, doc),
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
const te = findTypeExprAt(f.type, offset);
|
|
299
|
+
if (te)
|
|
300
|
+
return typeExprHover(te, doc);
|
|
301
|
+
for (const a of f.attributes) {
|
|
302
|
+
if (a.span && spanContains(a.span, offset)) {
|
|
303
|
+
return {
|
|
304
|
+
kind: 'attribute',
|
|
305
|
+
markdown: `\`\`\`lexd\n@${a.name}\n\`\`\`\n\nConstraint / meta attribute.`,
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
for (const a of t.attributes) {
|
|
311
|
+
if (a.span && spanContains(a.span, offset)) {
|
|
312
|
+
return {
|
|
313
|
+
kind: 'attribute',
|
|
314
|
+
markdown: `\`\`\`lexd\n@${a.name}\n\`\`\`\n\n${PRIMARY_ATTRS.has(a.name) ? 'Primary type attribute.' : 'Type attribute.'}`,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
const { word } = wordAt(doc.text, offset);
|
|
321
|
+
if (!word)
|
|
322
|
+
return null;
|
|
323
|
+
if (doc.localTypes.has(word)) {
|
|
324
|
+
const t = doc.localTypes.get(word);
|
|
325
|
+
return {
|
|
326
|
+
kind: 'type',
|
|
327
|
+
markdown: `\`\`\`lexd\ntype ${t.name}\n\`\`\`\n\nLocal type definition.`,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
if (doc.imports.has(word)) {
|
|
331
|
+
const imp = doc.imports.get(word);
|
|
332
|
+
const ref = doc.importRefs.get(word);
|
|
333
|
+
return {
|
|
334
|
+
kind: 'import',
|
|
335
|
+
markdown: [
|
|
336
|
+
`\`\`\`lexd\nimport { ${word} } from "${imp.module}"\n\`\`\``,
|
|
337
|
+
ref ? `Resolved as \`${ref}\`.` : `Imported from \`${imp.module}\`.`,
|
|
338
|
+
].join('\n\n'),
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
return null;
|
|
342
|
+
}
|
|
343
|
+
function fieldHover(f, doc) {
|
|
344
|
+
const attrs = formatAttributes(f.attributes);
|
|
345
|
+
const typeStr = formatTypeExpr(f.type);
|
|
346
|
+
const opt = f.optional ? '?' : '';
|
|
347
|
+
let extra = '';
|
|
348
|
+
if (f.type.kind === 'ref') {
|
|
349
|
+
const name = f.type.name;
|
|
350
|
+
if (doc.localTypes.has(name))
|
|
351
|
+
extra = `\n\nLocal def \`#${name}\`.`;
|
|
352
|
+
else if (doc.importRefs.has(name))
|
|
353
|
+
extra = `\n\nImport → \`${doc.importRefs.get(name)}\`.`;
|
|
354
|
+
}
|
|
355
|
+
return [`\`\`\`lexd\n${attrs ? attrs + ' ' : ''}${f.name}${opt}: ${typeStr}\n\`\`\``, extra]
|
|
356
|
+
.filter(Boolean)
|
|
357
|
+
.join('');
|
|
358
|
+
}
|
|
359
|
+
function typeExprHover(te, doc) {
|
|
360
|
+
if (te.kind === 'primitive') {
|
|
361
|
+
return {
|
|
362
|
+
kind: 'type',
|
|
363
|
+
markdown: `\`\`\`lexd\n${te.name}\n\`\`\`\n\nPrimitive type.`,
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
if (te.kind === 'ref') {
|
|
367
|
+
const name = te.name;
|
|
368
|
+
if (doc.localTypes.has(name)) {
|
|
369
|
+
return {
|
|
370
|
+
kind: 'type',
|
|
371
|
+
markdown: `\`\`\`lexd\ntype ${name}\n\`\`\`\n\nLocal type reference (\`#${name}\`).`,
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
if (doc.imports.has(name)) {
|
|
375
|
+
const ref = doc.importRefs.get(name);
|
|
376
|
+
return {
|
|
377
|
+
kind: 'import',
|
|
378
|
+
markdown: `\`\`\`lexd\n${name}\n\`\`\`\n\nImported symbol${ref ? ` → \`${ref}\`` : ''}.`,
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
return {
|
|
382
|
+
kind: 'type',
|
|
383
|
+
markdown: `\`\`\`lexd\n${name}\n\`\`\`\n\nType reference.`,
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
return {
|
|
387
|
+
kind: 'type',
|
|
388
|
+
markdown: `\`\`\`lexd\n${formatTypeExpr(te)}\n\`\`\``,
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
export function definitionAt(doc, offset, workspace) {
|
|
392
|
+
if (!doc.ast)
|
|
393
|
+
return null;
|
|
394
|
+
// Prefer type-expr refs under the cursor
|
|
395
|
+
for (const ns of doc.ast.namespaces) {
|
|
396
|
+
for (const t of ns.types) {
|
|
397
|
+
for (const f of t.fields) {
|
|
398
|
+
const te = findTypeExprAt(f.type, offset);
|
|
399
|
+
if (te?.kind === 'ref') {
|
|
400
|
+
return resolveRefDefinition(te.name, doc, workspace);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
// Also walk schema type exprs in blocks
|
|
404
|
+
for (const block of t.blocks) {
|
|
405
|
+
if (block.kind === 'input' || block.kind === 'output') {
|
|
406
|
+
if (block.schema?.kind === 'type') {
|
|
407
|
+
const te = findTypeExprAt(block.schema.type, offset);
|
|
408
|
+
if (te?.kind === 'ref')
|
|
409
|
+
return resolveRefDefinition(te.name, doc, workspace);
|
|
410
|
+
}
|
|
411
|
+
if (block.schema?.kind === 'inline') {
|
|
412
|
+
for (const f of block.schema.fields) {
|
|
413
|
+
const te = findTypeExprAt(f.type, offset);
|
|
414
|
+
if (te?.kind === 'ref')
|
|
415
|
+
return resolveRefDefinition(te.name, doc, workspace);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
if (block.kind === 'message') {
|
|
420
|
+
const te = findTypeExprAt(block.schema, offset);
|
|
421
|
+
if (te?.kind === 'ref')
|
|
422
|
+
return resolveRefDefinition(te.name, doc, workspace);
|
|
423
|
+
}
|
|
424
|
+
if (block.kind === 'params') {
|
|
425
|
+
for (const f of block.fields) {
|
|
426
|
+
const te = findTypeExprAt(f.type, offset);
|
|
427
|
+
if (te?.kind === 'ref')
|
|
428
|
+
return resolveRefDefinition(te.name, doc, workspace);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
const { word } = wordAt(doc.text, offset);
|
|
435
|
+
if (!word)
|
|
436
|
+
return null;
|
|
437
|
+
return resolveRefDefinition(word, doc, workspace);
|
|
438
|
+
}
|
|
439
|
+
function resolveRefDefinition(name, doc, workspace) {
|
|
440
|
+
const bare = name.startsWith('#') ? name.slice(1) : name;
|
|
441
|
+
// Local type
|
|
442
|
+
const local = doc.localTypes.get(bare) ?? doc.localTypes.get(name);
|
|
443
|
+
if (local?.span) {
|
|
444
|
+
return {
|
|
445
|
+
uri: doc.uri,
|
|
446
|
+
span: local.span,
|
|
447
|
+
detail: `Local type ${local.name}`,
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
// Import binding → module
|
|
451
|
+
const imp = doc.imports.get(bare) ?? doc.imports.get(name);
|
|
452
|
+
if (imp && workspace) {
|
|
453
|
+
const mod = workspace.modules.get(imp.module);
|
|
454
|
+
if (mod) {
|
|
455
|
+
const key = imp.imported === 'main' ? 'main' : imp.imported;
|
|
456
|
+
const type = mod.types.get(key) ??
|
|
457
|
+
(imp.imported === 'main'
|
|
458
|
+
? [...mod.types.values()].find((t) => t.primary)
|
|
459
|
+
: mod.types.get(imp.imported));
|
|
460
|
+
if (type?.span) {
|
|
461
|
+
return {
|
|
462
|
+
uri: pathToUri(mod.path),
|
|
463
|
+
span: type.span,
|
|
464
|
+
detail: `${imp.module}${key === 'main' ? '' : '#' + key}`,
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
// Fall back to file start / namespace
|
|
468
|
+
for (const ns of mod.file.namespaces) {
|
|
469
|
+
if (ns.span) {
|
|
470
|
+
return { uri: pathToUri(mod.path), span: ns.span, detail: imp.module };
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
// Absolute NSID#frag
|
|
476
|
+
if (name.includes('.')) {
|
|
477
|
+
const [modId, frag] = name.split('#');
|
|
478
|
+
const mod = workspace?.modules.get(modId);
|
|
479
|
+
if (mod) {
|
|
480
|
+
const type = frag ? mod.types.get(frag) : mod.types.get('main');
|
|
481
|
+
if (type?.span) {
|
|
482
|
+
return { uri: pathToUri(mod.path), span: type.span, detail: name };
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
return null;
|
|
487
|
+
}
|
|
488
|
+
export function completionsAt(doc, offset) {
|
|
489
|
+
const before = doc.text.slice(Math.max(0, offset - 80), offset);
|
|
490
|
+
const items = [];
|
|
491
|
+
// Attribute completion after @
|
|
492
|
+
const atMatch = /@([A-Za-z0-9_]*)$/.exec(before);
|
|
493
|
+
if (atMatch) {
|
|
494
|
+
for (const name of PRIMARY_ATTRS) {
|
|
495
|
+
items.push({
|
|
496
|
+
label: `@${name}`,
|
|
497
|
+
kind: 'keyword',
|
|
498
|
+
detail: 'Primary type attribute',
|
|
499
|
+
insertText: name,
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
for (const name of CONSTRAINT_ATTRS) {
|
|
503
|
+
items.push({
|
|
504
|
+
label: `@${name}`,
|
|
505
|
+
kind: 'property',
|
|
506
|
+
detail: 'Constraint / meta attribute',
|
|
507
|
+
insertText: name,
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
return items;
|
|
511
|
+
}
|
|
512
|
+
// Type position: after ':' (with optional whitespace)
|
|
513
|
+
const typePos = /:\s*([A-Za-z0-9_#.-]*)$/.exec(before);
|
|
514
|
+
// Also after union( or array-ish contexts
|
|
515
|
+
const unionPos = /(?:union\s*\(|\[\s*)([A-Za-z0-9_#.-]*)$/.exec(before);
|
|
516
|
+
if (typePos || unionPos) {
|
|
517
|
+
for (const p of PRIMITIVES) {
|
|
518
|
+
items.push({ label: p, kind: 'type', detail: 'Primitive' });
|
|
519
|
+
}
|
|
520
|
+
for (const name of doc.localTypes.keys()) {
|
|
521
|
+
items.push({ label: name, kind: 'type', detail: 'Local type' });
|
|
522
|
+
}
|
|
523
|
+
for (const name of doc.imports.keys()) {
|
|
524
|
+
items.push({
|
|
525
|
+
label: name,
|
|
526
|
+
kind: 'type',
|
|
527
|
+
detail: doc.importRefs.get(name) ?? 'Import',
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
items.push({ label: 'union', kind: 'keyword', detail: 'Union type', insertText: 'union($0)' });
|
|
531
|
+
return items;
|
|
532
|
+
}
|
|
533
|
+
// Section keywords inside type bodies (heuristic: after newline / brace)
|
|
534
|
+
const sectionPos = /(?:^|[\n{])\s*([a-z]*)$/m.exec(before);
|
|
535
|
+
if (sectionPos) {
|
|
536
|
+
for (const name of SECTION_NAMES) {
|
|
537
|
+
items.push({
|
|
538
|
+
label: name,
|
|
539
|
+
kind: 'keyword',
|
|
540
|
+
detail: 'Section',
|
|
541
|
+
insertText: `${name} {\n\t$0\n}`,
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
// Top-level keywords
|
|
546
|
+
if (/(?:^|\n)\s*([a-z]*)$/.test(before)) {
|
|
547
|
+
for (const kw of ['namespace', 'import', 'type', 'from', 'as']) {
|
|
548
|
+
items.push({ label: kw, kind: 'keyword' });
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
// Always offer in-scope symbols as a fallback when prefix looks like an identifier
|
|
552
|
+
const idPrefix = /([A-Za-z_][A-Za-z0-9_]*)$/.exec(before);
|
|
553
|
+
if (idPrefix && items.length === 0) {
|
|
554
|
+
for (const name of doc.localTypes.keys()) {
|
|
555
|
+
items.push({ label: name, kind: 'type', detail: 'Local type' });
|
|
556
|
+
}
|
|
557
|
+
for (const name of doc.imports.keys()) {
|
|
558
|
+
items.push({ label: name, kind: 'type', detail: 'Import' });
|
|
559
|
+
}
|
|
560
|
+
for (const p of PRIMITIVES) {
|
|
561
|
+
items.push({ label: p, kind: 'type', detail: 'Primitive' });
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
return items;
|
|
565
|
+
}
|
|
566
|
+
export { CONSTRAINT_ATTRS, PRIMITIVES, PRIMARY_ATTRS, SECTION_NAMES };
|
|
567
|
+
//# sourceMappingURL=analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analys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nF,MAAM,QAAQ,GAAG,2BAA2B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACzD,IAAI,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC;YACzC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAA;QACjE,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;YACtC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC7D,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAA;QAC7D,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { analyzeDocument, buildWorkspaceIndex, completionsAt, definitionAt, hoverAt, offsetAt, positionAt, pathToUri, uriToPath, formatTypeExpr, formatAttributes, CONSTRAINT_ATTRS, PRIMITIVES, PRIMARY_ATTRS, SECTION_NAMES, type AnalyzedDocument, type WorkspaceIndex, type DiagnosticInfo, type SymbolLocation, type CompletionItemInfo, type HoverTarget, } from './analysis.js';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,UAAU,EACV,SAAS,EACT,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,WAAW,GACjB,MAAM,eAAe,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { analyzeDocument, buildWorkspaceIndex, completionsAt, definitionAt, hoverAt, offsetAt, positionAt, pathToUri, uriToPath, formatTypeExpr, formatAttributes, CONSTRAINT_ATTRS, PRIMITIVES, PRIMARY_ATTRS, SECTION_NAMES, } from './analysis.js';
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,UAAU,EACV,SAAS,EACT,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,aAAa,GAOd,MAAM,eAAe,CAAA"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":""}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createConnection, TextDocuments, ProposedFeatures, CompletionItemKind, DiagnosticSeverity, MarkupKind, TextDocumentSyncKind, } from 'vscode-languageserver/node.js';
|
|
3
|
+
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
4
|
+
import { analyzeDocument, buildWorkspaceIndex, completionsAt, definitionAt, hoverAt, offsetAt, pathToUri, uriToPath, } from './analysis.js';
|
|
5
|
+
const connection = createConnection(ProposedFeatures.all);
|
|
6
|
+
const documents = new TextDocuments(TextDocument);
|
|
7
|
+
let workspace;
|
|
8
|
+
let workspaceFolders = [];
|
|
9
|
+
let bundledStdlibPaths = [];
|
|
10
|
+
const cache = new Map();
|
|
11
|
+
function spanToRange(span) {
|
|
12
|
+
return {
|
|
13
|
+
start: { line: span.startLine - 1, character: span.startColumn - 1 },
|
|
14
|
+
end: { line: span.endLine - 1, character: span.endColumn - 1 },
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function refreshWorkspace(folders) {
|
|
18
|
+
workspace = buildWorkspaceIndex(folders, { stdlibPaths: bundledStdlibPaths });
|
|
19
|
+
}
|
|
20
|
+
function analyze(doc) {
|
|
21
|
+
const result = analyzeDocument(doc.uri, doc.getText(), workspace, {
|
|
22
|
+
stdlibPaths: bundledStdlibPaths,
|
|
23
|
+
});
|
|
24
|
+
cache.set(doc.uri, result);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
function publishDiagnostics(doc, analyzed) {
|
|
28
|
+
const diagnostics = analyzed.diagnostics.map((d) => {
|
|
29
|
+
const range = d.span
|
|
30
|
+
? spanToRange(d.span)
|
|
31
|
+
: {
|
|
32
|
+
start: { line: 0, character: 0 },
|
|
33
|
+
end: { line: 0, character: 1 },
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
severity: d.severity === 'warning' ? DiagnosticSeverity.Warning : DiagnosticSeverity.Error,
|
|
37
|
+
range,
|
|
38
|
+
message: d.message,
|
|
39
|
+
source: 'lexd',
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
connection.sendDiagnostics({ uri: doc.uri, diagnostics });
|
|
43
|
+
}
|
|
44
|
+
connection.onInitialize((params) => {
|
|
45
|
+
const init = params.initializationOptions;
|
|
46
|
+
bundledStdlibPaths = init?.stdlibPaths ?? [];
|
|
47
|
+
workspaceFolders =
|
|
48
|
+
params.workspaceFolders?.map((f) => uriToPath(f.uri)) ??
|
|
49
|
+
(params.rootUri ? [uriToPath(params.rootUri)] : []);
|
|
50
|
+
refreshWorkspace(workspaceFolders);
|
|
51
|
+
return {
|
|
52
|
+
capabilities: {
|
|
53
|
+
textDocumentSync: TextDocumentSyncKind.Incremental,
|
|
54
|
+
hoverProvider: true,
|
|
55
|
+
definitionProvider: true,
|
|
56
|
+
completionProvider: {
|
|
57
|
+
resolveProvider: false,
|
|
58
|
+
triggerCharacters: ['@', ':', ' ', '.', '#'],
|
|
59
|
+
},
|
|
60
|
+
workspace: {
|
|
61
|
+
workspaceFolders: {
|
|
62
|
+
supported: true,
|
|
63
|
+
changeNotifications: true,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
connection.onInitialized(() => {
|
|
70
|
+
connection.workspace?.onDidChangeWorkspaceFolders?.((event) => {
|
|
71
|
+
try {
|
|
72
|
+
for (const folder of event.removed) {
|
|
73
|
+
const path = uriToPath(folder.uri);
|
|
74
|
+
workspaceFolders = workspaceFolders.filter((f) => f !== path);
|
|
75
|
+
}
|
|
76
|
+
for (const folder of event.added) {
|
|
77
|
+
workspaceFolders.push(uriToPath(folder.uri));
|
|
78
|
+
}
|
|
79
|
+
refreshWorkspace(workspaceFolders);
|
|
80
|
+
cache.clear();
|
|
81
|
+
for (const doc of documents.all()) {
|
|
82
|
+
const analyzed = analyze(doc);
|
|
83
|
+
publishDiagnostics(doc, analyzed);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
connection.console.error(`Workspace refresh failed: ${err instanceof Error ? err.message : err}`);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
documents.onDidChangeContent((change) => {
|
|
92
|
+
const analyzed = analyze(change.document);
|
|
93
|
+
publishDiagnostics(change.document, analyzed);
|
|
94
|
+
});
|
|
95
|
+
documents.onDidClose((event) => {
|
|
96
|
+
cache.delete(event.document.uri);
|
|
97
|
+
connection.sendDiagnostics({ uri: event.document.uri, diagnostics: [] });
|
|
98
|
+
});
|
|
99
|
+
connection.onHover((params) => {
|
|
100
|
+
const doc = documents.get(params.textDocument.uri);
|
|
101
|
+
if (!doc)
|
|
102
|
+
return null;
|
|
103
|
+
const analyzed = cache.get(doc.uri) ?? analyze(doc);
|
|
104
|
+
const offset = offsetAt(doc.getText(), params.position.line, params.position.character);
|
|
105
|
+
const hover = hoverAt(analyzed, offset);
|
|
106
|
+
if (!hover)
|
|
107
|
+
return null;
|
|
108
|
+
return {
|
|
109
|
+
contents: {
|
|
110
|
+
kind: MarkupKind.Markdown,
|
|
111
|
+
value: hover.markdown,
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
connection.onDefinition((params) => {
|
|
116
|
+
const doc = documents.get(params.textDocument.uri);
|
|
117
|
+
if (!doc)
|
|
118
|
+
return null;
|
|
119
|
+
const analyzed = cache.get(doc.uri) ?? analyze(doc);
|
|
120
|
+
const offset = offsetAt(doc.getText(), params.position.line, params.position.character);
|
|
121
|
+
const loc = definitionAt(analyzed, offset, workspace);
|
|
122
|
+
if (!loc)
|
|
123
|
+
return null;
|
|
124
|
+
return {
|
|
125
|
+
uri: loc.uri.startsWith('file:') ? loc.uri : pathToUri(loc.uri),
|
|
126
|
+
range: spanToRange(loc.span),
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
connection.onCompletion((params) => {
|
|
130
|
+
const doc = documents.get(params.textDocument.uri);
|
|
131
|
+
if (!doc)
|
|
132
|
+
return [];
|
|
133
|
+
const analyzed = cache.get(doc.uri) ?? analyze(doc);
|
|
134
|
+
const offset = offsetAt(doc.getText(), params.position.line, params.position.character);
|
|
135
|
+
const kindMap = {
|
|
136
|
+
keyword: CompletionItemKind.Keyword,
|
|
137
|
+
type: CompletionItemKind.TypeParameter,
|
|
138
|
+
property: CompletionItemKind.Property,
|
|
139
|
+
snippet: CompletionItemKind.Snippet,
|
|
140
|
+
text: CompletionItemKind.Text,
|
|
141
|
+
};
|
|
142
|
+
return completionsAt(analyzed, offset).map((item) => {
|
|
143
|
+
const result = {
|
|
144
|
+
label: item.label,
|
|
145
|
+
kind: kindMap[item.kind],
|
|
146
|
+
detail: item.detail,
|
|
147
|
+
};
|
|
148
|
+
if (item.insertText) {
|
|
149
|
+
result.insertText = item.insertText;
|
|
150
|
+
if (item.insertText.includes('$0') || item.insertText.includes('\n')) {
|
|
151
|
+
result.insertTextFormat = 2; // Snippet
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return result;
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
documents.listen(connection);
|
|
158
|
+
connection.listen();
|
|
159
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAEhB,kBAAkB,EAElB,kBAAkB,EAKlB,UAAU,EACV,oBAAoB,GACrB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AACjE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,SAAS,EAGT,SAAS,GACV,MAAM,eAAe,CAAA;AAGtB,MAAM,UAAU,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAA;AACzD,MAAM,SAAS,GAAG,IAAI,aAAa,CAAC,YAAY,CAAC,CAAA;AAEjD,IAAI,SAAqC,CAAA;AACzC,IAAI,gBAAgB,GAAa,EAAE,CAAA;AACnC,IAAI,kBAAkB,G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AAC,IAAI;KACrB,CAAA;IAEV,OAAO,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAClD,MAAM,MAAM,GAAmB;YAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YACxB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAA;QACD,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;YACnC,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrE,MAAM,CAAC,gBAAgB,GAAG,CAAC,CAAA,CAAC,UAAU;YACxC,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;AAC5B,UAAU,CAAC,MAAM,EAAE,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lexd/language-server",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Language server for the AT Proto Lexicon DSL (.lexd)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/harveyrandall/lexd.git",
|
|
9
|
+
"directory": "packages/language-server"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"bin": {
|
|
16
|
+
"lexd-lsp": "./dist/server.js"
|
|
17
|
+
},
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"vscode-languageserver": "^9.0.1",
|
|
31
|
+
"vscode-languageserver-textdocument": "^1.0.12",
|
|
32
|
+
"@lexd/core": "0.1.0",
|
|
33
|
+
"@lexd/stdlib-atproto": "0.1.0",
|
|
34
|
+
"@lexd/stdlib-standard": "0.1.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^22.15.21",
|
|
38
|
+
"tsx": "^4.19.4",
|
|
39
|
+
"typescript": "^5.8.3"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc -p tsconfig.json && chmod +x dist/server.js",
|
|
43
|
+
"test": "node --import tsx --test src/**/*.test.ts",
|
|
44
|
+
"dev": "tsc -p tsconfig.json --watch"
|
|
45
|
+
}
|
|
46
|
+
}
|