Skip to content

Fix sort_requires not recognizing const imports in luau#1123

Open
ddashdev wants to merge 2 commits into
JohnnyMorganz:mainfrom
ddashdev:const_sort_requires
Open

Fix sort_requires not recognizing const imports in luau#1123
ddashdev wants to merge 2 commits into
JohnnyMorganz:mainfrom
ddashdev:const_sort_requires

Conversation

@ddashdev
Copy link
Copy Markdown

Problem

sort_requires only recognized imports parsed as Stmt::LocalAssignment, so Luau imports declared with the new const keyword were ignored.

For example, this stayed unsorted:

const Zebra = require("Zebra")
const Apple = require("Apple")

Summary

  • Adds Luau-only handling for Stmt::ConstAssignment in sort-requires
  • Reuses the same require-matching logic for local and const assignments
  • Preserves existing grouping, blank-line splitting, ignored-node behavior, and game:GetService sorting
  • Adds tests for const requires, mixed local/const blocks, type assertions, and services
  • Updates docs and changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant