Skip to content

Syntax errors incorrectly reported in definition files (*.d.luau) + types not defined when directory containing multiple projects is opened #1223

@deviaze

Description

@deviaze

Usually Luau definition files get ignored for syntax errors since they don't follow regular Luau syntax... But when you open a directory that contains multiple projects, and each project has its own definition file/vscode settings/.luaurc, Luau Language Server doesn't realize it has to ignore definition files in those projects.

Types from those definitions files aren't loaded at all for files within those projects, thereby causing a bunch more incorrect TypeErrors.

Directory structure:

scripts
  | fixkcolor
  | | .seal
  | | | typedefs
  | | | | globals.d.luau
  | otherproject
  | | .seal
  | | | typedefs
  | | | | globals.d.luau

If I open scripts/fixkcolor where and cwd is inside the fixkcolor directory everything works perfectly (since the definitions file is linked properly in fixkcolor/.vscode/settings.json), but if I open its parent directory it all goes haywire.

scripts doesn't have a .vscode folder or any definition files of its own since it just stores other projects

Image

Additionally, Luau Language Server doesn't recognize any types from those definitions files within those directories:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions