Repository navigation
Feature request: First-class Luau support for Roblox development #1063
Description
Description
Description
Could AFT add first-class Luau support, including structural tools and integration with luau-lsp?
Currently, aft_outline rejects .luau files with unsupported file extension: luau. This prevents agents working on Roblox projects from using AFT’s structural navigation, despite existing Lua support.
Inspired by #843, the proposal is to extend existing AFT tools incrementally rather than introduce a separate Roblox tool suite.
Architecture
Source structure: use a Luau-aware tree-sitter grammar for parsing, symbol extraction, structural search/editing and syntax validation. These features should work without Roblox Studio, a language server or a fully configured project.
Semantic analysis: integrate luau-lsp through AFT’s existing LSP infrastructure for diagnostics and resolved navigation. Reuse the server’s project configuration rather than embed the Luau compiler or create a parallel Roblox analysis engine.
Requested capabilities
- Structural support
• Recognise .luau throughout outlines, zoom, indexing, search and file watching.
• Support Luau syntax—not simply route .luau through the Lua parser—including type annotations, exported types, generics, casts, interpolated strings and compound assignments.
• Extract local/exported functions, nested functions, table/module methods and type aliases, preserving qualified names, scopes, signatures and accurate source ranges.
• Enable structural search/replace and symbol edits with syntax validation.
• Preserve existing ordinary Lua behaviour; allow projects using Luau in .lua files to select it explicitly.
- Language-server integration
• Discover/configure luau-lsp, including executable arguments, initialization options and workspace settings.
• Surface type/lint diagnostics through aft_inspect and existing edit-validation paths.
• Support definitions, type definitions, references and reference-aware rename through the applicable AFT tools.
• Report unavailable or incomplete diagnostics honestly when the server or project configuration is missing.
- Roblox project awareness
Respect the configuration already understood by luau-lsp:
• .luaurc, including strictness and require aliases.
• Rojo-style sourcemaps, including custom sourcemap paths.
• Configured Roblox/global type-definition files.
• Server, client and shared ModuleScript layouts.
• Separate project roots in repositories containing multiple games.
Resolve supported require expressions through the configured server, including Roblox instance paths and relative/aliased string paths. Missing sourcemaps should degrade gracefully rather than prevent structural tools from working.
Existing sourcemaps should be sufficient; automatic Rojo generation could remain optional.
- Relationship analysis and safe editing
As a follow-up, extend callgraph/caller/impact queries using resolved module and symbol identities where available. Distinguish resolved edges from name-only guesses or unresolved dynamic calls.
Callbacks, dynamic requires and RemoteEvent/RemoteFunction communication should not be presented as fully resolved ordinary calls.
Preserve AFT’s existing preview, backup, undo and path-policy behaviour. Any future require organization should avoid changing side-effectful initialization order.
Suggested delivery and acceptance
- Structural support first, with a small representative Roblox project fixture.
- LSP and project configuration, with diagnostics and cross-module navigation.
- Relationship analysis and additional refactoring, incrementally.
Useful tests would cover typed modules, Module:method declarations, exported generic types, cross-module references, duplicate function names in different modules, an intentional type error, sourcemap changes and multiple project roots.
Structural support should require neither Studio nor network access. Studio integration, place-file extraction and runtime/gameplay validation are outside this request.
Would this scope fit AFT’s direction, with structural support as the initial milestone?
Use case
No response
Activity