aft icon indicating copy to clipboard operation
aft copied to clipboard

Feature request: First-class Luau support for Roblox development

Open Sandvich1337 opened this issue 1 month ago • 2 comments

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

  1. 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.

  1. 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.

  1. 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.

  1. 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

  1. Structural support first, with a small representative Roblox project fixture.
  2. LSP and project configuration, with diagnostics and cross-module navigation.
  3. 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

Sandvich1337 avatar Oct 27 '26 23:10 Sandvich1337

Thanks for the request. We're adding support for less common languages through grammars loaded as WebAssembly, pinned to reviewed versions and checked before use. Luau will be the first language on that path. A grammar alone doesn't give outlines or call graphs, so Luau also gets its own symbol and call extraction in AFT. We'll update this issue when it ships.

aft-alfonso[bot] avatar Oct 31 '26 21:10 aft-alfonso[bot]

Luau support shipped in v0.66.0: .luau files now get outlines, navigation, call graphs, search and TODO inspection. The Luau grammar is downloaded on first use and checked against a pinned hash, so nothing extra needs installing. Thanks for the request, @Sandvich1337! If something is missing for your Roblox projects, please open a new issue with an example.

aft-alfonso[bot] avatar Nov 17 '26 09:11 aft-alfonso[bot]