luaut-language-server 1.0.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 +100 -0
- package/dist/chunk-RHII344O.js +733 -0
- package/dist/chunk-RHII344O.js.map +1 -0
- package/dist/cli.cjs +691 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +774 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +183 -0
- package/dist/index.d.ts +183 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -0
package/dist/cli.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server.ts","../src/analysis.ts","../src/features/diagnostics.ts","../src/ast-utils.ts","../src/features/hover.ts","../src/features/navigation.ts","../src/features/completion.ts","../src/features/members.ts","../src/features/signatureHelp.ts","../src/features/symbols.ts","../src/cli.ts"],"sourcesContent":["/**\r\n * The language server: LSP wiring only.\r\n *\r\n * Every handler is the same three steps — get the cached analysis for the\r\n * document, ask one feature module a question, hand back the answer. The\r\n * thinking lives in `features/`; nothing here knows about luaut.\r\n */\r\nimport {\r\n createConnection, ProposedFeatures, TextDocuments, TextDocumentSyncKind,\r\n type Connection, type InitializeParams, type InitializeResult,\r\n} from \"vscode-languageserver/node\"\r\nimport { TextDocument } from \"vscode-languageserver-textdocument\"\r\nimport { Analyzer, type AnalyzerOptions } from \"./analysis.js\"\r\nimport { diagnostics } from \"./features/diagnostics.js\"\r\nimport { hover } from \"./features/hover.js\"\r\nimport { definition, references, highlights, prepareRename, rename } from \"./features/navigation.js\"\r\nimport { completion } from \"./features/completion.js\"\r\nimport { signatureHelp } from \"./features/signatureHelp.js\"\r\nimport { documentSymbols } from \"./features/symbols.js\"\r\n\r\nexport interface ServerOptions extends AnalyzerOptions {}\r\n\r\n/** Attach the luaut language server to a connection. Exported separately from\r\n * `startServer` so an editor extension can run it in-process over its own\r\n * transport, and so the tests can drive it without spawning anything. */\r\nexport function createServer(connection: Connection, options: ServerOptions = {}): void {\r\n const analyzer = new Analyzer(options)\r\n const documents = new TextDocuments(TextDocument)\r\n\r\n connection.onInitialize((_params: InitializeParams): InitializeResult => ({\r\n capabilities: {\r\n textDocumentSync: TextDocumentSyncKind.Incremental,\r\n hoverProvider: true,\r\n definitionProvider: true,\r\n referencesProvider: true,\r\n documentHighlightProvider: true,\r\n documentSymbolProvider: true,\r\n renameProvider: { prepareProvider: true },\r\n completionProvider: {\r\n // `.` and `:` open a member list; the rest of the time\r\n // completion is asked for as you type a word.\r\n triggerCharacters: [\".\", \":\"],\r\n resolveProvider: false,\r\n },\r\n signatureHelpProvider: { triggerCharacters: [\"(\", \",\"], retriggerCharacters: [\",\"] },\r\n },\r\n serverInfo: { name: \"luaut-language-server\" },\r\n }))\r\n\r\n // --- diagnostics -------------------------------------------------------\r\n const publish = (document: TextDocument): void => {\r\n void connection.sendDiagnostics({\r\n uri: document.uri,\r\n version: document.version,\r\n diagnostics: diagnostics(analyzer.get(document)),\r\n })\r\n }\r\n\r\n documents.onDidOpen(e => publish(e.document))\r\n documents.onDidChangeContent(e => publish(e.document))\r\n documents.onDidClose(e => {\r\n analyzer.forget(e.document.uri)\r\n void connection.sendDiagnostics({ uri: e.document.uri, diagnostics: [] })\r\n })\r\n\r\n // --- language features -------------------------------------------------\r\n const withDocument = <T>(uri: string, f: (document: TextDocument) => T, fallback: T): T => {\r\n const document = documents.get(uri)\r\n return document ? f(document) : fallback\r\n }\r\n\r\n connection.onHover(p => withDocument(\r\n p.textDocument.uri, d => hover(analyzer.get(d), p.position), null,\r\n ))\r\n\r\n connection.onDefinition(p => withDocument(\r\n p.textDocument.uri, d => definition(analyzer.get(d), p.position), null,\r\n ))\r\n\r\n connection.onReferences(p => withDocument(\r\n p.textDocument.uri,\r\n d => references(analyzer.get(d), p.position, p.context.includeDeclaration),\r\n [],\r\n ))\r\n\r\n connection.onDocumentHighlight(p => withDocument(\r\n p.textDocument.uri, d => highlights(analyzer.get(d), p.position), [],\r\n ))\r\n\r\n connection.onDocumentSymbol(p => withDocument(\r\n p.textDocument.uri, d => documentSymbols(analyzer.get(d)), [],\r\n ))\r\n\r\n connection.onPrepareRename(p => withDocument(\r\n p.textDocument.uri,\r\n d => {\r\n const prepared = prepareRename(analyzer.get(d), p.position)\r\n return prepared ? { range: prepared.range, placeholder: prepared.placeholder } : null\r\n },\r\n null,\r\n ))\r\n\r\n connection.onRenameRequest(p => withDocument(\r\n p.textDocument.uri, d => rename(analyzer.get(d), p.position, p.newName), null,\r\n ))\r\n\r\n connection.onCompletion(p => withDocument(\r\n p.textDocument.uri, d => completion(analyzer, d, p.position), [],\r\n ))\r\n\r\n connection.onSignatureHelp(p => withDocument(\r\n p.textDocument.uri, d => signatureHelp(analyzer, d, p.position), null,\r\n ))\r\n\r\n documents.listen(connection)\r\n connection.listen()\r\n}\r\n\r\n/** Run the server over stdio — the transport editors launch it with. */\r\nexport function startServer(options: ServerOptions = {}): void {\r\n createServer(createConnection(ProposedFeatures.all), options)\r\n}\r\n","/**\r\n * Analysis cache.\r\n *\r\n * The three parser passes are cheap (single-digit milliseconds for a normal\r\n * file) but not free, and every LSP request wants the same result for the same\r\n * document version — so each document is analyzed once per version and the\r\n * result is reused by hover, definition, completion and the rest.\r\n */\r\nimport {\r\n parseWithRecovery, analyzeScopes, analyzeTypes, defaultLibs,\r\n type Program, type ScopeAnalysis, type TypeAnalysis, type ParseError,\r\n type DeclareStatement, type Statement,\r\n} from \"luaut-parser\"\r\nimport type { TextDocument } from \"vscode-languageserver-textdocument\"\r\n\r\nexport interface Analysis {\r\n readonly uri: string\r\n readonly version: number\r\n readonly source: string\r\n readonly program: Program\r\n readonly parseErrors: readonly ParseError[]\r\n readonly scopes: ScopeAnalysis\r\n readonly types: TypeAnalysis\r\n}\r\n\r\nexport interface AnalyzerOptions {\r\n /** Definitions to analyze against. Defaults to core Luau + Roblox. */\r\n libs?: readonly Program[]\r\n}\r\n\r\n/** Names every file may use undeclared: whatever the definitions declare.\r\n * Derived rather than hard-coded, so adding a `declare` to a `.d.luaut` is\r\n * all it takes for the name to stop looking undefined. */\r\nfunction globalsOf(libs: readonly Program[]): string[] {\r\n const names = new Set<string>()\r\n for (const lib of libs) collect(lib.body.statements, names)\r\n return [...names]\r\n}\r\n\r\nfunction collect(statements: readonly Statement[], into: Set<string>): void {\r\n for (const statement of statements) {\r\n if (statement.type === \"DeclareStatement\") into.add((statement as DeclareStatement).name)\r\n }\r\n}\r\n\r\nexport class Analyzer {\r\n private readonly libs: readonly Program[]\r\n private readonly builtinGlobals: string[]\r\n private readonly cache = new Map<string, Analysis>()\r\n\r\n constructor(options: AnalyzerOptions = {}) {\r\n this.libs = options.libs ?? defaultLibs\r\n this.builtinGlobals = globalsOf(this.libs)\r\n }\r\n\r\n /** Analyze `document`, reusing the previous result if its version is\r\n * unchanged. */\r\n get(document: TextDocument): Analysis {\r\n const cached = this.cache.get(document.uri)\r\n const source = document.getText()\r\n // The version alone would do for a real editor, where it only ever\r\n // increases — comparing the text too costs nothing next to an\r\n // analysis and makes the cache safe for any caller.\r\n if (cached && cached.version === document.version && cached.source === source) return cached\r\n const analysis = this.analyze(document.uri, document.version, source)\r\n this.cache.set(document.uri, analysis)\r\n return analysis\r\n }\r\n\r\n /** Analyze source text that is not a tracked document — used by\r\n * completion, which analyzes a speculatively edited copy of the file. */\r\n analyze(uri: string, version: number, source: string): Analysis {\r\n const { program, errors } = parseWithRecovery(source)\r\n const scopes = analyzeScopes(program, { builtinGlobals: this.builtinGlobals })\r\n const types = analyzeTypes(program, scopes, { libs: this.libs })\r\n return { uri, version, source, program, parseErrors: errors, scopes, types }\r\n }\r\n\r\n forget(uri: string): void {\r\n this.cache.delete(uri)\r\n }\r\n}\r\n","/** Syntax errors, scope errors and type errors, as one list. */\nimport { DiagnosticSeverity, type Diagnostic } from \"vscode-languageserver\"\nimport type { Analysis } from \"../analysis.js\"\nimport { toRange, toPosition } from \"../ast-utils.js\"\n\nexport function diagnostics(analysis: Analysis): Diagnostic[] {\n const out: Diagnostic[] = []\n\n for (const error of analysis.parseErrors) {\n // A parse error points at a token, not a span; highlight to the end of\n // the word under it so the squiggle is visible.\n const start = toPosition(error.line, error.column)\n out.push({\n range: { start, end: { line: start.line, character: start.character + 1 } },\n severity: DiagnosticSeverity.Error,\n source: \"luaut\",\n code: \"syntax\",\n // The parser appends `(line:column)`; the range already says that.\n message: error.message.replace(/\\s*\\(\\d+:\\d+\\)$/, \"\"),\n })\n }\n\n for (const d of analysis.scopes.diagnostics) {\n out.push({\n range: toRange(d.node),\n severity: DiagnosticSeverity.Error,\n source: \"luaut\",\n code: d.kind,\n message: d.message,\n })\n }\n\n for (const d of analysis.types.diagnostics) {\n out.push({\n range: toRange(d.node),\n severity: DiagnosticSeverity.Error,\n source: \"luaut\",\n code: \"type\",\n message: d.message,\n })\n }\n\n return out\n}\n","/**\r\n * Position mapping and AST lookup.\r\n *\r\n * luaut spans are 1-based with an exclusive end column; LSP positions are\r\n * 0-based. Every conversion between the two lives here so the features never\r\n * do the arithmetic themselves.\r\n */\r\nimport type { Position, Range } from \"vscode-languageserver\"\r\n\r\n/** The shape every luaut AST node shares. */\r\nexport interface Spanned {\r\n type?: string\r\n line: { start: number; end: number }\r\n column: { start: number; end: number }\r\n}\r\n\r\nexport function isSpanned(v: unknown): v is Spanned {\r\n if (!v || typeof v !== \"object\") return false\r\n const n = v as Record<string, unknown>\r\n return typeof n.line === \"object\" && n.line !== null && typeof n.column === \"object\" && n.column !== null\r\n}\r\n\r\nexport function toRange(node: Spanned): Range {\r\n return {\r\n start: { line: node.line.start - 1, character: node.column.start - 1 },\r\n end: { line: node.line.end - 1, character: node.column.end - 1 },\r\n }\r\n}\r\n\r\n/** A one-character range, for a diagnostic on a node with a collapsed span. */\r\nexport function toPosition(line: number, column: number): Position {\r\n return { line: line - 1, character: column - 1 }\r\n}\r\n\r\n/** Is `pos` inside `node`'s span? The end is exclusive, except that `inclusive`\r\n * admits a cursor sitting immediately after the node — which is where it is\r\n * while you are still typing the identifier under it. */\r\nexport function containsPosition(node: Spanned, pos: Position, inclusive = false): boolean {\r\n const startLine = node.line.start - 1\r\n const endLine = node.line.end - 1\r\n if (pos.line < startLine || pos.line > endLine) return false\r\n if (pos.line === startLine && pos.character < node.column.start - 1) return false\r\n if (pos.line === endLine) {\r\n const end = node.column.end - 1\r\n if (inclusive ? pos.character > end : pos.character >= end) return false\r\n }\r\n return true\r\n}\r\n\r\n/** Every child node of `node`, in source order-ish (declaration order of the\r\n * fields). Generic on purpose: it walks the object graph rather than knowing\r\n * the node types, so a new node kind in the parser needs no change here. */\r\nexport function children(node: Spanned): Spanned[] {\r\n const out: Spanned[] = []\r\n for (const key of Object.keys(node)) {\r\n if (key === \"line\" || key === \"column\") continue\r\n const value = (node as unknown as Record<string, unknown>)[key]\r\n if (Array.isArray(value)) {\r\n for (const item of value) if (isSpanned(item)) out.push(item)\r\n } else if (isSpanned(value)) {\r\n out.push(value)\r\n }\r\n }\r\n return out\r\n}\r\n\r\n/** The chain of nodes containing `pos`, outermost first — the last entry is\r\n * the innermost node at the cursor and the ones before it are its ancestors.\r\n *\r\n * It descends through every child rather than only children that contain\r\n * `pos`, because a parent's span does not always cover its child's: a\r\n * binding's span is the name alone, while its type annotation sits after it.\r\n * So an ancestor in this path is a real ancestor, but not necessarily one\r\n * whose own span contains the cursor. */\r\nexport function pathAt(root: Spanned, pos: Position, inclusive = false): Spanned[] {\r\n let best: Spanned[] | undefined\r\n\r\n const descend = (node: Spanned, ancestors: Spanned[]): void => {\r\n const here = [...ancestors, node]\r\n if (containsPosition(node, pos, inclusive)) {\r\n // Prefer the narrowest hit, and among equals the deepest — that is\r\n // the node the cursor is really \"on\".\r\n const incumbent = best?.[best.length - 1]\r\n if (!incumbent\r\n || spanLength(node) < spanLength(incumbent)\r\n || (spanLength(node) === spanLength(incumbent) && here.length > best!.length)) {\r\n best = here\r\n }\r\n }\r\n for (const child of children(node)) descend(child, here)\r\n }\r\n\r\n descend(root, [])\r\n return best ?? []\r\n}\r\n\r\n/** The innermost node containing `pos`. */\r\nexport function nodeAt(root: Spanned, pos: Position, inclusive = false): Spanned | undefined {\r\n const path = pathAt(root, pos, inclusive)\r\n return path[path.length - 1]\r\n}\r\n\r\n/** The innermost node of one of `types` containing `pos`. */\r\nexport function enclosing<T extends Spanned>(\r\n root: Spanned,\r\n pos: Position,\r\n types: readonly string[],\r\n inclusive = false,\r\n): T | undefined {\r\n const path = pathAt(root, pos, inclusive)\r\n for (let i = path.length - 1; i >= 0; i--) {\r\n if (path[i].type && types.includes(path[i].type as string)) return path[i] as T\r\n }\r\n return undefined\r\n}\r\n\r\nfunction spanLength(node: Spanned): number {\r\n // Line count dominates: a node spanning fewer lines is nested deeper.\r\n return (node.line.end - node.line.start) * 10000 + (node.column.end - node.column.start)\r\n}\r\n\r\n/** Walk every node under `root`, depth first. */\r\nexport function walk(root: Spanned, visit: (node: Spanned, parent?: Spanned) => void, parent?: Spanned): void {\r\n visit(root, parent)\r\n for (const child of children(root)) walk(child, visit, root)\r\n}\r\n","/** Hover: the type of the thing under the cursor, as luaut would write it. */\nimport type { Hover, Position } from \"vscode-languageserver\"\nimport { formatType, getBinding, type Identifier, type Expression, type Type } from \"luaut-parser\"\nimport type { Analysis } from \"../analysis.js\"\nimport { pathAt, toRange, type Spanned } from \"../ast-utils.js\"\n\nexport function hover(analysis: Analysis, position: Position): Hover | null {\n const path = pathAt(analysis.program, position, true)\n for (let i = path.length - 1; i >= 0; i--) {\n const node = path[i]\n const found = describe(analysis, node, path[i - 1])\n if (found) return { contents: { kind: \"markdown\", value: code(found) }, range: toRange(node) }\n }\n return null\n}\n\nfunction describe(analysis: Analysis, node: Spanned, parent?: Spanned): string | undefined {\n const { types, scopes } = analysis\n\n // A type alias reads as its definition rather than as a value.\n if (node.type === \"TypeAliasStatement\" || node.type === \"ExportTypeAliasStatement\") {\n const name = (node as unknown as { name: string }).name\n const alias = types.aliases.get(name)\n if (alias) return `type ${name} = ${formatType(alias)}`\n }\n\n if (node.type === \"Identifier\") {\n const identifier = node as unknown as Identifier\n // A reference: prefer the narrowed type — that is what the code sees\n // at this point, and the difference is the whole reason for narrowing.\n const narrowed = types.narrowedTypeOf.get(identifier)\n if (narrowed) return `${identifier.name}: ${formatType(narrowed)}`\n const binding = getBinding(scopes, identifier)\n if (binding) {\n const type = types.bindingType.get(binding.id)\n if (type) return `${keyword(binding)} ${binding.name}: ${formatType(type)}`\n }\n // A property name: `x.foo` has no binding, but the member expression\n // it belongs to has a type.\n if (parent && (parent.type === \"MemberExpression\" || parent.type === \"MethodCallExpression\")) {\n const type = types.typeOf.get(parent as unknown as Expression)\n if (type) return `${identifier.name}: ${formatType(type)}`\n }\n }\n\n if (node.type === \"IdentifierPattern\") {\n const binding = getBinding(scopes, node as never)\n if (binding) {\n const type = types.bindingType.get(binding.id)\n if (type) return `${keyword(binding)} ${binding.name}: ${formatType(type)}`\n }\n }\n\n const type: Type | undefined = types.typeOf.get(node as unknown as Expression)\n return type ? formatType(type) : undefined\n}\n\nfunction keyword(binding: { kind: string; isConst?: boolean }): string {\n if (binding.kind === \"param\" || binding.kind === \"self\") return \"(parameter)\"\n if (binding.kind === \"global\") return \"(global)\"\n if (binding.kind.startsWith(\"for-\")) return \"(loop variable)\"\n return binding.isConst ? \"const\" : \"let\"\n}\n\nfunction code(text: string): string {\n return \"```luaut\\n\" + text + \"\\n```\"\n}\n","/**\n * Go-to-definition, find-references, rename and document highlight — all four\n * are the same question (\"which binding is this, and where else does it\n * appear?\") asked with different answers.\n */\nimport {\n DocumentHighlightKind,\n type DocumentHighlight, type Location, type Position, type Range,\n type TextEdit, type WorkspaceEdit,\n} from \"vscode-languageserver\"\nimport { getBinding, type Binding, type Identifier } from \"luaut-parser\"\nimport type { Analysis } from \"../analysis.js\"\nimport { pathAt, toRange, type Spanned } from \"../ast-utils.js\"\n\n/** The binding referred to at `position`, if the cursor is on a variable. */\nexport function bindingAt(analysis: Analysis, position: Position): Binding | undefined {\n const path = pathAt(analysis.program, position, true)\n for (let i = path.length - 1; i >= 0; i--) {\n const node = path[i]\n if (node.type !== \"Identifier\" && node.type !== \"IdentifierPattern\") continue\n const binding = getBinding(analysis.scopes, node as unknown as Identifier)\n if (binding) return binding\n }\n return undefined\n}\n\n/** Every place the binding appears: its declaration plus every reference. */\nfunction sites(binding: Binding): Spanned[] {\n const out: Spanned[] = []\n if (binding.declarationNode) out.push(binding.declarationNode as unknown as Spanned)\n out.push(...(binding.references as unknown as Spanned[]))\n return out\n}\n\nexport function definition(analysis: Analysis, position: Position): Location | null {\n const binding = bindingAt(analysis, position)\n if (!binding?.declarationNode) return null\n return { uri: analysis.uri, range: toRange(binding.declarationNode as unknown as Spanned) }\n}\n\nexport function references(\n analysis: Analysis,\n position: Position,\n includeDeclaration: boolean,\n): Location[] {\n const binding = bindingAt(analysis, position)\n if (!binding) return []\n const nodes = includeDeclaration ? sites(binding) : (binding.references as unknown as Spanned[])\n return nodes.map(node => ({ uri: analysis.uri, range: toRange(node) }))\n}\n\nexport function highlights(analysis: Analysis, position: Position): DocumentHighlight[] {\n const binding = bindingAt(analysis, position)\n if (!binding) return []\n return sites(binding).map(node => ({\n range: toRange(node),\n kind: node === binding.declarationNode\n ? DocumentHighlightKind.Write\n : DocumentHighlightKind.Read,\n }))\n}\n\n/** The range rename would replace, and the current name — so the editor can\n * refuse before it asks for a new one. */\nexport function prepareRename(\n analysis: Analysis,\n position: Position,\n): { range: Range; placeholder: string } | null {\n const binding = bindingAt(analysis, position)\n if (!binding) return null\n // A builtin lives in a definitions file; renaming it here would rename the\n // uses and leave the declaration behind.\n if (binding.isBuiltin || !binding.declarationNode) return null\n const path = pathAt(analysis.program, position, true)\n const identifier = [...path].reverse().find(n => n.type === \"Identifier\" || n.type === \"IdentifierPattern\")\n if (!identifier) return null\n return { range: toRange(identifier), placeholder: binding.name }\n}\n\nexport function rename(analysis: Analysis, position: Position, newName: string): WorkspaceEdit | null {\n if (!isIdentifier(newName)) return null\n const binding = bindingAt(analysis, position)\n if (!binding || binding.isBuiltin || !binding.declarationNode) return null\n const edits: TextEdit[] = sites(binding).map(node => ({ range: toRange(node), newText: newName }))\n return { changes: { [analysis.uri]: edits } }\n}\n\nconst IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/\nfunction isIdentifier(name: string): boolean {\n return IDENTIFIER.test(name)\n}\n","/**\r\n * Completion.\r\n *\r\n * `x.` and `x:` are syntax errors, so the file as typed cannot answer \"what\r\n * are `x`'s members?\". The trick every language server of this shape uses:\r\n * substitute a placeholder identifier at the cursor, analyze *that* text, and\r\n * read the answer off the AST it produces. The user's document is untouched —\r\n * only the speculative copy is analyzed, and it is never cached.\r\n */\r\nimport {\r\n CompletionItemKind, InsertTextFormat,\r\n type CompletionItem, type Position,\r\n} from \"vscode-languageserver\"\r\nimport type { TextDocument } from \"vscode-languageserver-textdocument\"\r\nimport { formatType, type Expression, type Type } from \"luaut-parser\"\r\nimport type { Analyzer } from \"../analysis.js\"\r\nimport { pathAt, type Spanned } from \"../ast-utils.js\"\r\nimport { membersOf, signaturesOf, signatureLabel } from \"./members.js\"\r\n\r\nconst PLACEHOLDER = \"__luautCompletion__\"\r\nconst IDENTIFIER_CHAR = /[A-Za-z0-9_]/\r\n\r\nexport function completion(\r\n analyzer: Analyzer,\r\n document: TextDocument,\r\n position: Position,\r\n): CompletionItem[] {\r\n const source = document.getText()\r\n const offset = document.offsetAt(position)\r\n\r\n // The word being typed, if any — replaced wholesale so a half-written\r\n // name cannot break the speculative parse.\r\n let start = offset\r\n while (start > 0 && IDENTIFIER_CHAR.test(source[start - 1])) start--\r\n let end = offset\r\n while (end < source.length && IDENTIFIER_CHAR.test(source[end])) end++\r\n\r\n // A method name has to be called to parse (`part:foo` alone is not a\r\n // statement), so the placeholder brings its own argument list unless the\r\n // source already has one.\r\n const afterColon = source[start - 1] === \":\"\r\n const alreadyCalled = /^\\s*\\(/.test(source.slice(end))\r\n const stand_in = afterColon && !alreadyCalled ? `${PLACEHOLDER}()` : PLACEHOLDER\r\n const patched = source.slice(0, start) + stand_in + source.slice(end)\r\n const analysis = analyzer.analyze(document.uri, -1, patched)\r\n\r\n // Where the placeholder sits, in the patched document's coordinates —\r\n // the same line, since the patch never spans one.\r\n const at: Position = { line: position.line, character: position.character - (offset - start) }\r\n const path = pathAt(analysis.program, at, true)\r\n const placeholder = [...path].reverse().find(\r\n n => n.type === \"Identifier\" && (n as unknown as { name: string }).name === PLACEHOLDER,\r\n )\r\n const parent = placeholder ? path[path.indexOf(placeholder) - 1] : path[path.length - 1]\r\n\r\n // Member access: `x.foo` / `x:foo`.\r\n if (parent && (parent.type === \"MemberExpression\" || parent.type === \"MethodCallExpression\")) {\r\n const object = (parent as unknown as { object: Expression }).object\r\n const type = analysis.types.typeOf.get(object)\r\n const wantMethods = parent.type === \"MethodCallExpression\"\r\n return membersOf(type, analysis.types.aliases)\r\n .filter(member => (wantMethods ? member.isMethod : true))\r\n .map(member => memberItem(member.name, member.property.type, member.property.readonly))\r\n }\r\n\r\n // A type position wants type names, not values.\r\n if (inTypePosition(path)) {\r\n const named: CompletionItem[] = [...analysis.types.aliases.keys()].map(name => ({\r\n label: name,\r\n kind: CompletionItemKind.Interface,\r\n detail: \"type\",\r\n }))\r\n const primitives: CompletionItem[] = PRIMITIVES.map(name => ({\r\n label: name,\r\n kind: CompletionItemKind.Keyword,\r\n detail: \"type\",\r\n }))\r\n return [...named, ...primitives]\r\n }\r\n\r\n return valueItems(analysis, at)\r\n}\r\n\r\n/** Names in scope at `at`. Scope analysis records where each binding is\r\n * declared but not the extent of its scope, so this approximates: everything\r\n * declared earlier in the file, plus the globals, which are visible\r\n * everywhere. Over-offering is the right failure — a name the editor lists\r\n * and the file rejects is a diagnostic away from being obvious. */\r\nfunction valueItems(analysis: ReturnType<Analyzer[\"analyze\"]>, at: Position): CompletionItem[] {\r\n const items: CompletionItem[] = []\r\n const seen = new Set<string>()\r\n for (const binding of analysis.scopes.bindings.values()) {\r\n if (binding.name === PLACEHOLDER || seen.has(binding.name)) continue\r\n const declaration = binding.declarationNode as unknown as Spanned | undefined\r\n if (declaration && declaration.line.start - 1 > at.line) continue\r\n seen.add(binding.name)\r\n const type = analysis.types.bindingType.get(binding.id)\r\n items.push({\r\n label: binding.name,\r\n kind: kindOf(type, binding.kind),\r\n detail: type ? formatType(type) : undefined,\r\n // Locals before globals, and globals before library names.\r\n sortText: `${binding.isBuiltin ? 2 : binding.kind === \"global\" ? 1 : 0}${binding.name}`,\r\n })\r\n }\r\n for (const keyword of KEYWORDS) {\r\n items.push({ label: keyword, kind: CompletionItemKind.Keyword, sortText: `3${keyword}` })\r\n }\r\n return items\r\n}\r\n\r\nfunction memberItem(name: string, type: Type, readonly?: boolean): CompletionItem {\r\n const signatures = signaturesOf(type)\r\n if (signatures.length) {\r\n return {\r\n label: name,\r\n kind: CompletionItemKind.Method,\r\n detail: signatureLabel(signatures[0]).label,\r\n insertText: `${name}($0)`,\r\n insertTextFormat: InsertTextFormat.Snippet,\r\n }\r\n }\r\n return {\r\n label: name,\r\n kind: CompletionItemKind.Field,\r\n detail: `${readonly ? \"readonly \" : \"\"}${formatType(type)}`,\r\n }\r\n}\r\n\r\nfunction kindOf(type: Type | undefined, bindingKind: string): CompletionItemKind {\r\n if (type && signaturesOf(type).length) return CompletionItemKind.Function\r\n if (bindingKind === \"param\" || bindingKind === \"self\") return CompletionItemKind.Variable\r\n return CompletionItemKind.Variable\r\n}\r\n\r\n/** Is the cursor inside a type annotation? Every type node's name ends in\r\n * `TypeNode`, plus the couple that do not. */\r\nfunction inTypePosition(path: readonly Spanned[]): boolean {\r\n return path.some(n =>\r\n !!n.type && (n.type.endsWith(\"TypeNode\") || n.type === \"TypeReference\"\r\n || n.type === \"TypeAliasStatement\" || n.type === \"ExportTypeAliasStatement\"),\r\n )\r\n}\r\n\r\nconst PRIMITIVES = [\r\n \"any\", \"unknown\", \"never\", \"nil\", \"boolean\", \"number\", \"string\", \"thread\", \"buffer\",\r\n]\r\n\r\nconst KEYWORDS = [\r\n \"const\", \"let\", \"function\", \"return\", \"if\", \"then\", \"elseif\", \"else\", \"end\",\r\n \"for\", \"in\", \"while\", \"do\", \"repeat\", \"until\", \"break\", \"continue\",\r\n \"type\", \"declare\", \"export\", \"import\", \"and\", \"or\", \"not\", \"true\", \"false\", \"nil\",\r\n]\r\n","/** What members a type has — shared by completion and signature help. */\nimport { formatType, type FunctionType, type ObjectProperty, type Type } from \"luaut-parser\"\n\nexport interface Member {\n name: string\n property: ObjectProperty\n /** True when the member is a function whose first parameter is `self` —\n * i.e. it is meant to be called with `:`. */\n isMethod: boolean\n}\n\n/** The members of `type`, following aliases, merging intersections and keeping\n * only what every member of a union has (you can only reach a property that\n * is there whichever way the union went). */\nexport function membersOf(\n type: Type | undefined,\n aliases: ReadonlyMap<string, Type>,\n seen = new Set<Type>(),\n): Member[] {\n if (!type || seen.has(type)) return []\n seen.add(type)\n\n switch (type.kind) {\n case \"object\": {\n const out: Member[] = []\n for (const [name, property] of type.properties) {\n out.push({ name, property, isMethod: takesSelf(property.type) })\n }\n return out\n }\n case \"intersection\": {\n // Overload sets are intersections of functions and have no\n // members of their own; a `A & B` object contributes both sides.\n const merged = new Map<string, Member>()\n for (const part of type.types) {\n for (const member of membersOf(part, aliases, seen)) merged.set(member.name, member)\n }\n return [...merged.values()]\n }\n case \"union\": {\n const perBranch = type.types.map(part => membersOf(part, aliases, seen))\n if (!perBranch.length) return []\n const [first, ...rest] = perBranch\n return first.filter(member => rest.every(other => other.some(m => m.name === member.name)))\n }\n case \"genericRef\": {\n const alias = aliases.get(type.name)\n return alias ? membersOf(alias, aliases, seen) : []\n }\n case \"typeParam\":\n return membersOf(type.constraint, aliases, seen)\n default:\n return []\n }\n}\n\nexport function takesSelf(type: Type): boolean {\n for (const signature of signaturesOf(type)) {\n if (signature.params[0]?.name === \"self\") return true\n }\n return false\n}\n\n/** Every call signature of `type` — one for a function, several for an\n * overload set (which is an intersection of function types). */\nexport function signaturesOf(type: Type | undefined, aliases?: ReadonlyMap<string, Type>): FunctionType[] {\n if (!type) return []\n if (type.kind === \"function\") return [type]\n if (type.kind === \"intersection\") return type.types.flatMap(t => signaturesOf(t, aliases))\n if (type.kind === \"genericRef\" && aliases) {\n const alias = aliases.get(type.name)\n return alias ? signaturesOf(alias, aliases) : []\n }\n return []\n}\n\n/** `(a: number, b?: string) -> boolean`, and the pieces of it, for signature\n * help — which needs each parameter's own label to highlight the active one. */\nexport function signatureLabel(signature: FunctionType): { label: string; parameters: string[] } {\n const parameters = signature.params.map((p, i) => {\n const name = p.name ?? `arg${i + 1}`\n return `${name}${p.optional ? \"?\" : \"\"}: ${formatType(p.type)}`\n })\n const generics = signature.typeParams?.length ? `<${signature.typeParams.join(\", \")}>` : \"\"\n const varargs = signature.varargs ? [`...: ${formatType(signature.varargs)}`] : []\n const label = `${generics}(${[...parameters, ...varargs].join(\", \")}) -> ${formatType(signature.returns)}`\n return { label, parameters }\n}\n","/**\r\n * Signature help: the parameter list of the call the cursor sits inside.\r\n *\r\n * A call being typed is usually not yet a call — `add(1, ` has no argument\r\n * after the comma and no closing paren, and the parser drops the statement.\r\n * So, like completion, this analyzes a repaired copy of the text: the fewest\r\n * characters that make the call parse, tried in order.\r\n */\r\nimport type { Position, SignatureHelp, SignatureInformation } from \"vscode-languageserver\"\r\nimport type { TextDocument } from \"vscode-languageserver-textdocument\"\r\nimport type { Expression } from \"luaut-parser\"\r\nimport type { Analyzer, Analysis } from \"../analysis.js\"\r\nimport { containsPosition, pathAt, type Spanned } from \"../ast-utils.js\"\r\nimport { signaturesOf, signatureLabel } from \"./members.js\"\r\n\r\ninterface CallLike extends Spanned {\r\n type: \"CallExpression\" | \"MethodCallExpression\"\r\n arguments: Expression[]\r\n}\r\n\r\nexport function signatureHelp(\r\n analyzer: Analyzer,\r\n document: TextDocument,\r\n position: Position,\r\n): SignatureHelp | null {\r\n const source = document.getText()\r\n const offset = document.offsetAt(position)\r\n for (const repair of [\"\", \"nil\", \"nil)\", \")\"]) {\r\n const text = source.slice(0, offset) + repair + source.slice(offset)\r\n const analysis = analyzer.analyze(document.uri, -1, text)\r\n const found = helpAt(analysis, position)\r\n if (found) return found\r\n }\r\n return null\r\n}\r\n\r\nfunction helpAt(analysis: Analysis, position: Position): SignatureHelp | null {\r\n const path = pathAt(analysis.program, position, true)\r\n const call = [...path].reverse().find(\r\n n => n.type === \"CallExpression\" || n.type === \"MethodCallExpression\",\r\n ) as CallLike | undefined\r\n if (!call) return null\r\n\r\n const callee = call.type === \"CallExpression\"\r\n ? (call as unknown as { callee: Expression }).callee\r\n : (call as unknown as Expression)\r\n // For a method call the callee has no node of its own, so read the type of\r\n // the whole `obj:m` receiver path from the object plus the method name.\r\n const calleeType = call.type === \"CallExpression\"\r\n ? analysis.types.typeOf.get(callee)\r\n : methodType(analysis, call)\r\n\r\n const signatures = signaturesOf(calleeType, analysis.types.aliases)\r\n if (!signatures.length) return null\r\n\r\n // `:` supplies `self`, so the first written argument is the second param.\r\n const selfOffset = call.type === \"MethodCallExpression\" ? 1 : 0\r\n const written = activeArgument(call, position)\r\n\r\n const infos: SignatureInformation[] = signatures.map(signature => {\r\n const { label, parameters } = signatureLabel(signature)\r\n return { label, parameters: parameters.map(p => ({ label: p })) }\r\n })\r\n\r\n // Pick the overload that could still accept this many arguments.\r\n const wanted = written + selfOffset + 1\r\n let active = signatures.findIndex(s => s.params.length >= wanted || s.varargs)\r\n if (active < 0) active = 0\r\n\r\n return {\r\n signatures: infos,\r\n activeSignature: active,\r\n activeParameter: Math.min(\r\n written + selfOffset,\r\n Math.max(0, signatures[active].params.length - 1),\r\n ),\r\n }\r\n}\r\n\r\nfunction methodType(analysis: Analysis, call: CallLike): undefined | ReturnType<Analysis[\"types\"][\"typeOf\"][\"get\"]> {\r\n const object = (call as unknown as { object: Expression }).object\r\n const method = (call as unknown as { method: { name: string } }).method\r\n const objectType = analysis.types.typeOf.get(object)\r\n if (!objectType) return undefined\r\n return memberType(objectType, method.name, analysis)\r\n}\r\n\r\nfunction memberType(\r\n type: NonNullable<ReturnType<Analysis[\"types\"][\"typeOf\"][\"get\"]>>,\r\n name: string,\r\n analysis: Analysis,\r\n): ReturnType<Analysis[\"types\"][\"typeOf\"][\"get\"]> {\r\n if (type.kind === \"object\") return type.properties.get(name)?.type\r\n if (type.kind === \"intersection\") {\r\n for (const part of type.types) {\r\n const found = memberType(part, name, analysis)\r\n if (found) return found\r\n }\r\n }\r\n if (type.kind === \"genericRef\") {\r\n const alias = analysis.types.aliases.get(type.name)\r\n if (alias) return memberType(alias, name, analysis)\r\n }\r\n return undefined\r\n}\r\n\r\n/** Which argument the cursor is in — counted by which argument spans it, or\r\n * by how many end before it when the cursor is in the gap after a comma. */\r\nfunction activeArgument(call: CallLike, position: Position): number {\r\n const args = call.arguments\r\n for (let i = 0; i < args.length; i++) {\r\n if (containsPosition(args[i] as unknown as Spanned, position, true)) return i\r\n }\r\n let count = 0\r\n for (const arg of args as unknown as Spanned[]) {\r\n const before = arg.line.end - 1 < position.line\r\n || (arg.line.end - 1 === position.line && arg.column.end - 1 <= position.character)\r\n if (before) count++\r\n }\r\n return count\r\n}\r\n","/** Document symbols: the outline of a file. */\r\nimport { SymbolKind, type DocumentSymbol } from \"vscode-languageserver\"\r\nimport { formatType, getBinding, type Identifier } from \"luaut-parser\"\r\nimport type { Analysis } from \"../analysis.js\"\r\nimport { toRange, walk, type Spanned } from \"../ast-utils.js\"\r\n\r\nexport function documentSymbols(analysis: Analysis): DocumentSymbol[] {\r\n const out: DocumentSymbol[] = []\r\n\r\n walk(analysis.program, node => {\r\n switch (node.type) {\r\n case \"FunctionDeclaration\":\r\n case \"FunctionDeclarationStatement\": {\r\n const name = functionName(node)\r\n if (name) out.push(symbol(name, SymbolKind.Function, node, detailOf(analysis, node)))\r\n break\r\n }\r\n case \"TypeAliasStatement\":\r\n case \"ExportTypeAliasStatement\": {\r\n // The alias name is an Identifier node here, a bare string on\r\n // a `declare` — take either.\r\n const named = (node as unknown as { name?: string | { name?: string } }).name\r\n const name = typeof named === \"string\" ? named : named?.name\r\n if (name) {\r\n const alias = analysis.types.aliases.get(name)\r\n out.push(symbol(name, SymbolKind.Interface, node, alias ? formatType(alias) : undefined))\r\n }\r\n break\r\n }\r\n case \"VariableDeclaration\": {\r\n for (const target of (node as unknown as { names?: Spanned[] }).names ?? []) {\r\n const name = (target as unknown as { name?: string }).name\r\n if (name) out.push(symbol(name, SymbolKind.Variable, target))\r\n }\r\n break\r\n }\r\n }\r\n })\r\n\r\n return out\r\n}\r\n\r\nfunction functionName(node: Spanned): string | undefined {\r\n const named = node as unknown as {\r\n name?: string | { name?: string }\r\n target?: { base?: { name?: string }; path?: { name?: string }[]; method?: { name: string } }\r\n }\r\n if (typeof named.name === \"string\") return named.name\r\n if (named.name && typeof named.name === \"object\") return named.name.name\r\n if (named.target?.base?.name) {\r\n const path = (named.target.path ?? []).map(p => p.name).filter(Boolean)\r\n const dotted = [named.target.base.name, ...path].join(\".\")\r\n return named.target.method ? `${dotted}:${named.target.method.name}` : dotted\r\n }\r\n return undefined\r\n}\r\n\r\n/** A function declaration is a statement, not an expression, so its type\r\n * comes from the binding it creates rather than from `typeOf`. */\r\nfunction detailOf(analysis: Analysis, node: Spanned): string | undefined {\r\n const name = (node as unknown as { name?: Identifier }).name\r\n if (name && typeof name === \"object\") {\r\n const binding = getBinding(analysis.scopes, name)\r\n const type = binding && analysis.types.bindingType.get(binding.id)\r\n if (type) return formatType(type)\r\n }\r\n return undefined\r\n}\r\n\r\nfunction symbol(name: string, kind: SymbolKind, node: Spanned, detail?: string): DocumentSymbol {\r\n const range = toRange(node)\r\n return { name, kind, detail, range, selectionRange: range }\r\n}\r\n","#!/usr/bin/env node\n/** Entry point editors launch: `luaut-language-server --stdio`. */\nimport { startServer } from \"./server.js\"\n\nstartServer()\n"],"mappings":";;;;AAOA,kBAGO;AACP,gDAA6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AAC3D,mBAAa,8BAAiB,6BAAiB,GAAG,GAAG,OAAO;AAChE;;;AUrHA,YAAY;","names":["import_luaut_parser","type","import_vscode_languageserver","import_luaut_parser","import_vscode_languageserver","import_luaut_parser","import_luaut_parser","keyword","import_vscode_languageserver","import_luaut_parser"]}
|
package/dist/cli.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/cli.js
ADDED
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n/** Entry point editors launch: `luaut-language-server --stdio`. */\nimport { startServer } from \"./server.js\"\n\nstartServer()\n"],"mappings":";;;;;;AAIA,YAAY;","names":[]}
|