Skip to content

Experimental command to format code blocks embedded in docstrings #7598

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

Merged
merged 25 commits into from
Jul 9, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
just output the filename without the full path for now
  • Loading branch information
zth committed Jul 9, 2025
commit 803aae5ab73e4ecc0e81cc17d788b24dd8d7438e
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Syntax error in code block in docstring
/Users/zth/OSS/rescript-compiler/tests/tools_tests/src/docstrings-format/FormatDocstringsTestError.res:5:10-6:3
FormatDocstringsTestError.res:5:10-6:3

3 │
4 │
Expand Down
2 changes: 1 addition & 1 deletion tools/src/tools.ml
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ module FormatDocstrings = struct
let {Res_driver.parsetree = structure; comments; source; filename} =
parser ~filename:path
in

let filename = Filename.basename filename in
let mapper = makeMapper ~displayFilename:filename in
let astMapped = mapper.structure mapper structure in
( Res_printer.print_implementation
Expand Down