Remove unused debugging aids - #8698
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8698 |
| process ~pos:0 [] [(0, Flat, doc)]; | ||
| Mini_buffer.contents buffer | ||
|
|
||
| let debug t = |
There was a problem hiding this comment.
Hmm maybe it would be good to keep actually, one might indeed need it for debug printing purposes?
There was a problem hiding this comment.
That requires making it actually used somewhere. Or else, it should go.
There was a problem hiding this comment.
It would only be used when adding debug printing temporarily while working on some printer issues.
There was a problem hiding this comment.
then it has to be integrated in a command line, rather than dead code
There was a problem hiding this comment.
Done in 8566df8: res_parser -print doc file.res prints the document tree with Res_doc.debug, which stays. Res_printer exposes implementation_doc and interface_doc for it, and the syntax README lists the command.
|
Could you resolve the conflicts? |
Scope.item_to_string in analysis/src/scope.ml was kept only by its [@@LiVe] annotation. git grep over the whole repository (sources, tests, docs, scripts) finds no reference to Scope.item_to_string, no open or include of Scope that would expose it, and no other caller. The debug printing of scope items in completions.ml uses Shared_types.Scope_types.item_to_string, which stays. To restore it, git revert this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
…_ident Both were exported with [@@LiVe] and have no consumer: - Res_doc.debug printed a document tree to stdout. Its only mention was the commented-out "(* Doc.debug doc; *)" in Res_printer.print_implementation, deleted here with it. - Res_outcome_printer.parenthesized_ident always returned true and has no call site, inside the outcome printer or elsewhere, so no call site simplifies. Oprint.parenthesized_ident in compiler/ml is a separate function and stays. git grep over the whole repository (sources, tests, docs, scripts) finds no other reference; the matches in tests/syntax_benchmarks/data and tests/syntax_tests/data/idempotency are ReScript copies of old sources used as parser input, not callers. To restore them, git revert this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
add_annotations_to_fields was kept only by its [@@LiVe] annotation; its only caller was itself. git grep over the whole repository (sources, tests, docs, scripts) finds no other reference; the matches in tests/syntax_tests/data/idempotency/genType are ReScript copies of old sources used as parser input, not callers. Its removal leaves Translate_type_declarations.rename_record_field with no caller, so that goes too. The comment on declared_field_name referred to it, and now describes declared_field_name itself. To restore them, git revert this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
Res_doc.debug stays and becomes the -print doc engine of res_parser, which prints the document Res_printer builds for a file. Res_printer exposes implementation_doc and interface_doc for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
8566df8 to
f349d7f
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8698 +/- ##
==========================================
+ Coverage 79.86% 79.88% +0.01%
==========================================
Files 470 470
Lines 63443 63429 -14
==========================================
+ Hits 50671 50672 +1
+ Misses 12772 12757 -15
🚀 New features to boost your workflow:
|
Part of #8712.
These definitions were kept on purpose (marked
[@@live]), but nothing in the repository uses them:Scope.item_to_string(analysis)Res_outcome_printer.parenthesized_ident(syntax)Translate_structure.add_annotations_to_fields, andTranslate_type_declarations.rename_record_field, whose only caller it was (genType)Please confirm they can go; each is a separate commit, so any of them can be dropped.
Summary
res_parser -print doc. It prints the document tree that Res_printer builds for a file, usingRes_doc.debug, which stays. Res_printer exposesimplementation_docandinterface_docfor it.Test plan
dune builddune build @fmtdune build --profile browser @checkmakemake liblib/outputsmake testmake test-analysismake test-toolsmake test-gentypemake test-syntaxmake checkformatnpm run checkThe
-print doccommit was checked withdune build,dune build @fmt, andres_parser -print docon a.resand a.resifile; the suites above ran before it.🤖 Generated with Claude Code