Skip to content

Commit 7aac00d

Browse files
committed
Fix definitions parsing
1 parent 5e5983d commit 7aac00d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1010

1111
- Definitions files must now provide a name for the file in settings and command line: i.e.
1212
`--definitions:@roblox=path/to/globalTypes.d.luau`. This is to support mapping global types back to their original
13-
definitions file for documentation features. Please update your LSP settings and command line arguments.
13+
definitions file for documentation features. Please update your LSP settings (`luau-lsp.types.definitionFiles`) and command line arguments.
1414
Backwards compatibility has been temporarily preserved, with random names generated.
1515

1616
## [1.38.0] - 2024-12-28

editors/code/src/roblox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,11 +436,11 @@ export const preLanguageServerStart = async (
436436
typesConfig.get<string>("robloxSecurityLevel") ?? "PluginSecurity";
437437
await updateApiInfo(context);
438438
addArg(
439-
`--definitions=${globalTypesUri(context, securityLevel, "Prod").fsPath}`,
439+
`--definitions:@roblox=${globalTypesUri(context, securityLevel, "Prod").fsPath}`,
440440
"Prod",
441441
);
442442
addArg(
443-
`--definitions=${globalTypesUri(context, securityLevel, "Debug").fsPath}`,
443+
`--definitions:@roblox=${globalTypesUri(context, securityLevel, "Debug").fsPath}`,
444444
"Debug",
445445
);
446446
addArg(`--docs=${apiDocsUri(context).fsPath}`);

src/main.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ int main(int argc, char** argv)
163163

164164
// Analyze arguments
165165
argparse::ArgumentParser analyze_command("analyze");
166+
analyze_command.set_assign_chars(":=");
166167
analyze_command.add_description("Run luau-analyze type checking and linting");
167168
analyze_command.add_parents(parent_parser);
168169
analyze_command.add_argument("--annotate")
@@ -189,7 +190,7 @@ int main(int argc, char** argv)
189190
.help("A path to a Luau definitions file to load into the global namespace")
190191
.default_value<std::vector<std::string>>({})
191192
.append()
192-
.metavar("PATH");
193+
.metavar("@NAME=PATH");
193194
analyze_command.add_argument("--ignore")
194195
.help("file glob pattern for ignoring error outputs")
195196
.default_value<std::vector<std::string>>({})
@@ -205,14 +206,15 @@ int main(int argc, char** argv)
205206

206207
// Language server arguments
207208
argparse::ArgumentParser lsp_command("lsp");
209+
lsp_command.set_assign_chars(":=");
208210
lsp_command.add_description("Start the language server");
209211
lsp_command.add_epilog("This will start up a server which listens to LSP messages on stdin, and responds on stdout");
210212
lsp_command.add_parents(parent_parser);
211213
lsp_command.add_argument("--definitions")
212214
.help("path to a Luau definitions file to load into the global namespace")
213215
.default_value<std::vector<std::string>>({})
214216
.append()
215-
.metavar("PATH");
217+
.metavar("@NAME=PATH");
216218
lsp_command.add_argument("--docs", "--documentation")
217219
.help("path to a Luau documentation database for loaded definitions")
218220
.action(file_path_parser)

0 commit comments

Comments
 (0)