sourcemap.json for custom(none rojo based) projects #320
-
So I am using luau and trying to add definition files for the objects added to my runtime with my native code. It is said in the repo readme that we can use sourcemap.json files in these situations. The issue I am having is I can't seem to actually make them work with luau-lsp. I based my sourcemap.json format on this And mine looks like this: {
"name": "luau-project",
"tree": {
"Project": {
"$className": "Project",
"$path": "../project.d.luau" // I also tried .. so that it resolves the files by itself, but no cigar
}
}
} The behavior I am getting is , the lsp server looks for default.project.json and fails because I am not using rojo. It never seems to look for the sourcemap.json or if it finds it, it doesn't seem to update with my definitions. I tested my definitions with the extension and they work(by specifying their path in vscode directly) Did anyone test this or got it to work ? Does anyone have any clue what I am doing wrong ? Thank you and great work on luau-lsp, when it works it's greaaat ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I assume this is for a non-Roblox project when you say "added to my runtime with my native code"? If so, ignore the Rojo, default.project.json, and sourcemap part. They are only for Roblox projects (to allow resolving stuff like For standalone Luau projects, you should just load the definitions files directly in VSCode through the setting, like you have already done so. Requires are then done by string (and can be configured to either be relative to current file or workspace root). Is there a reason you are looking at sourcemap rather than the VSCode setting? |
Beta Was this translation helpful? Give feedback.
I assume this is for a non-Roblox project when you say "added to my runtime with my native code"?
If so, ignore the Rojo, default.project.json, and sourcemap part. They are only for Roblox projects (to allow resolving stuff like
require(game.ReplicatedStorage.Module)
.For standalone Luau projects, you should just load the definitions files directly in VSCode through the setting, like you have already done so. Requires are then done by string (and can be configured to either be relative to current file or workspace root).
Is there a reason you are looking at sourcemap rather than the VSCode setting?