Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcemaps #2249

Open
lpil opened this issue Jun 29, 2023 · 4 comments · May be fixed by #3675
Open

Sourcemaps #2249

lpil opened this issue Jun 29, 2023 · 4 comments · May be fixed by #3675
Labels
help wanted Contributions encouraged priority:low

Comments

@lpil
Copy link
Member

lpil commented Jun 29, 2023

So that exceptions and debugging tools can show Gleam syntax and line numbers.

@lpil lpil added help wanted Contributions encouraged area:codegen labels Jun 29, 2023
@l1f
Copy link

l1f commented Jul 9, 2024

I am interested in this issue. But it is a year old. Is any planing or research on this subject done?

@lpil
Copy link
Member Author

lpil commented Jul 9, 2024

Not that anyone has shared with me.

@AlisCode
Copy link

Hello there, i've started work on this over at my fork on branch feat/sourcemap-javascript.

It's not in a place where I want to submit it for review, but so far I've managed to produce a basic sourcemap for a test Gleam module. This is it, visualized.

image

I was able to make debugging work through vscode-js-debug on neovim, using the following DAP config :

{
    type = "pwa-node",
    request = "launch",
    name = "Debug gleam program",
    -- NOTE: This wont work if the project's name doesnt match the folder name
    -- This should ideally be the name variable in the Gleam.toml manifest
    program = "${workspaceFolder}/build/dev/javascript/${workspaceFolderBasename}/gleam.main.mjs",
    cwd = "${workspaceFolder}",
    outFiles = {"${workspaceFolder}/**/*.mjs"},
    resolveSourceMapLocations = {"${workspaceFolder}/build/dev/javascript/**/*.map"},
    sourceMaps = true,
    pauseForSourceMap = true,
}

Is anyone actively interested in this, and willing to provide feedback ?

@lpil
Copy link
Member Author

lpil commented Sep 30, 2024

I think people are interested for sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions encouraged priority:low
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants