build: match dasImgui's ImWchar width, then comment hygiene sweep - #27
Merged
Conversation
dasImgui compiles imgui with IMGUI_USE_WCHAR32=1, so ImWchar is unsigned int there. This module did not set it, so ImWchar was unsigned short here and every ImWchar-taking imgui symbol mangled differently on the two sides. It surfaced as a single unresolved external, which reads like an imgui version skew but is not: wanted ?FindGlyph@ImFontBaked@@QEAAPEAUImFontGlyph@@g@Z (G = unsigned short) exported ?FindGlyph@ImFontBaked@@QEAAPEAUImFontGlyph@@i@Z (I = unsigned int) The symbol was in dasModuleImgui.lib the whole time. This module already mirrors IMGUI_DISABLE_OBSOLETE_FUNCTIONS and IMGUI_API from dasImgui; IMGUI_USE_WCHAR32 was simply missed. With this, dasModuleImplot builds and the module loads -- lint goes from 43 of 44 files skipped to 1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gkkfmcb1RhM3vNR3M35Avh
…/015 caps daslang PR #3504 turned STYLE014/STYLE015 on by default for any path containing /daslib/. External module repos are moving to comment hygiene across the board, so this opts in explicitly rather than relying on where a file happens to sit. All 44 .das files gain options _comment_hygiene = true, and 22 flagged blocks are trimmed. Load-bearing facts survive: the implot-after- dasImgui load-order constraint, the gen2 trailing-block-sugar reason the fps overload exists, the screen-px vs plot-data-coords split, the BeginPlot/EndPlot capture window, the row-major values[item*group_count+group] layout, the PlotToPixels-not- GetItemRect rationale (a drag tool submits no ImGui item, so a captured rect would be stale), and the press-before-hover HoveredId race in the playwright helpers. Two structural moves avoided cutting anything. Section dividers fused to the prose below them were split with a blank line -- a divider and its prose count as one block, so splitting costs no words. And a 7-line block inside a def private (cap 1) was hoisted above the def, where the cap is 3, keeping the EndPlot-render ordering and the issue-#9 owned-copy quirk intact. No suppressions were needed. No code changed -- comments, one options line per file, and one field docstring reworded in place. Verified: 44 files, 3 issues, 0 errors, 1 skipped. The 3 are STYLE030, byte-identical to baseline. The skipped file is bind/bind_implot.das, which needs a daslang built with dasClangBind; it was hand-reviewed and needed no comment change -- its only long block is module-leading and exempt, confirmed by probing the linter rather than assuming. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gkkfmcb1RhM3vNR3M35Avh
There was a problem hiding this comment.
Pull request overview
Build configuration and daslang-source hygiene updates for dasImguiImplot: aligns ImGui ABI expectations with dasImgui (ImWchar width) and explicitly opts all .das sources into comment-hygiene mode, with accompanying comment-block trimming.
Changes:
- Add
IMGUI_USE_WCHAR32=1to the standalone shared-module build to match dasImgui’sImWcharwidth and prevent link/mangling mismatches. - Enable
options _comment_hygiene = trueacross the module’s.dassources. - Trim/reflow several documentation/comment blocks to comply with comment hygiene rules.
Reviewed changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| CMakeLists.txt | Define IMGUI_USE_WCHAR32=1 for the shared-module build to match dasImgui ABI. |
| bind/bind_implot.das | Enable comment hygiene option. |
| daslib/imgui_implot_app.das | Enable comment hygiene option; reflow doc comments. |
| daslib/imgui_implot_boost.das | Enable comment hygiene option. |
| daslib/imgui_implot_boost_v2.das | Enable comment hygiene option; reflow/trim doc comments around snapshot/legend/drag tools. |
| daslib/imgui_implot_playwright.das | Enable comment hygiene option; reflow/trim doc comments for drag/legend helpers. |
| utils/implot2rst.das | Enable comment hygiene option for doc generator script. |
| examples/tutorial/bar_groups_and_pie.das | Enable comment hygiene option. |
| examples/tutorial/colormaps_and_style.das | Enable comment hygiene option. |
| examples/tutorial/drag_tools.das | Enable comment hygiene option. |
| examples/tutorial/heatmap_histogram.das | Enable comment hygiene option. |
| examples/tutorial/line_plot.das | Enable comment hygiene option. |
| examples/tutorial/multi_axes.das | Enable comment hygiene option. |
| examples/tutorial/multi_series.das | Enable comment hygiene option. |
| examples/tutorial/query_and_hover.das | Enable comment hygiene option. |
| examples/tutorial/realtime_scroll.das | Enable comment hygiene option. |
| examples/tutorial/shaded_and_stairs.das | Enable comment hygiene option. |
| examples/tutorial/subplots.das | Enable comment hygiene option. |
| tests/integration/record_bar_groups_and_pie.das | Enable comment hygiene option. |
| tests/integration/record_colormaps_and_style.das | Enable comment hygiene option. |
| tests/integration/record_drag_tools.das | Enable comment hygiene option. |
| tests/integration/record_heatmap_histogram.das | Enable comment hygiene option. |
| tests/integration/record_line_plot.das | Enable comment hygiene option. |
| tests/integration/record_multi_axes.das | Enable comment hygiene option. |
| tests/integration/record_multi_series.das | Enable comment hygiene option. |
| tests/integration/record_query_and_hover.das | Enable comment hygiene option. |
| tests/integration/record_realtime_scroll.das | Enable comment hygiene option. |
| tests/integration/record_shaded_and_stairs.das | Enable comment hygiene option. |
| tests/integration/record_subplots.das | Enable comment hygiene option; reflow explanatory comment. |
| tests/integration/test_axis_limits.das | Enable comment hygiene option. |
| tests/integration/test_bar_groups_and_pie.das | Enable comment hygiene option. |
| tests/integration/test_colormaps.das | Enable comment hygiene option. |
| tests/integration/test_drag_tools.das | Enable comment hygiene option. |
| tests/integration/test_heatmap_histogram.das | Enable comment hygiene option. |
| tests/integration/test_line_plot.das | Enable comment hygiene option. |
| tests/integration/test_multi_axes.das | Enable comment hygiene option; reflow legend-label comment. |
| tests/integration/test_multi_series.das | Enable comment hygiene option. |
| tests/integration/test_plot_hover.das | Enable comment hygiene option. |
| tests/integration/test_plot_snapshot.das | Enable comment hygiene option. |
| tests/integration/test_query_and_hover.das | Enable comment hygiene option. |
| tests/integration/test_realtime_scroll.das | Enable comment hygiene option. |
| tests/integration/test_shaded_and_stairs.das | Enable comment hygiene option. |
| tests/integration/test_stats_items.das | Enable comment hygiene option. |
| tests/integration/test_subplots.das | Enable comment hygiene option. |
| tests/integration/test_v1_scopes.das | Enable comment hygiene option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
115
to
+122
| target_compile_definitions(dasModuleImplot PRIVATE | ||
| DAS_MOD_EXPORTS DAS_ENABLE_DLL=1 | ||
| IMGUI_DISABLE_OBSOLETE_FUNCTIONS=1 | ||
| IMPLOT_DISABLE_OBSOLETE_FUNCTIONS=1 | ||
| IMGUI_API=${IMGUI_IMPORT_ATTR} | ||
| # Must match dasImgui's ImWchar width, or ImWchar-taking imgui symbols mangle as | ||
| # unsigned short here and unsigned int there, and the link fails on FindGlyph. | ||
| IMGUI_USE_WCHAR32=1 |
test_v1_scopes.das failed with error[30341] too many matching functions or generics PopStyleVar. imgui and implot bind 20 names in common, and imgui_implot_boost.das called 13 of them unqualified. Nine could not resolve at all. EndDragDropSource and EndDragDropTarget take no arguments, so imgui::EndDragDropTarget and implot::EndDragDropTarget are indistinguishable at the call site, and likewise for PopStyleVar(1) / PopStyleColor(1) which take only an int. The other four resolved by accident: PushStyleVar(idx, value) and PushStyleColor(idx, col) disambiguate on ImPlotStyleVar / ImPlotCol in the first argument. They are qualified here too, so each push/pop pair is explicitly the same module rather than relying on an argument type to pick the stack. That pairing is the real invariant -- every one of these sits between an implot-only Begin (BeginDragDropSourceItem, BeginDragDropTargetPlot / Axis / Legend) or an implot Push, so popping imgui's stack would unbalance both. Reproduced locally with -project_root over a modules/ tree holding dasImgui and dasImguiImplot side by side, which is the layout daspkg install --global produces in CI. Under plain -load_module the file compiles clean, which is why this never showed up in local linting. After: the file that failed now passes, and the repo compiles clean through the same scan path -- 44 files, 3 issues, 0 errors. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gkkfmcb1RhM3vNR3M35Avh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commits: a build fix that this repo needed regardless, then the hygiene sweep.
1.
IMGUI_USE_WCHAR32=1— why the module would not linkdasImgui compiles imgui with
IMGUI_USE_WCHAR32=1, soImWcharisunsigned intthere. This module never set it, soImWcharwasunsigned shorthere and everyImWchar-taking imgui symbol mangled differently on the two sides.It surfaced as a single unresolved external, which reads like an imgui version skew — it isn't:
The symbol was in
dasModuleImgui.libthe whole time. This module already mirrorsIMGUI_DISABLE_OBSOLETE_FUNCTIONSandIMGUI_APIfrom dasImgui;IMGUI_USE_WCHAR32was simply missed.With it,
dasModuleImplotbuilds and the module loads — lint goes from 43 of 44 files skipped to 1. Everything below only became visible because of this fix.2. Comment hygiene
daslang PR #3504 turned STYLE014/STYLE015 on by default for any path containing
/daslib/. We're moving external module repos to comment hygiene across the board, so this opts in explicitly rather than depending on where a file sits.All 44
.dasfiles gainoptions _comment_hygiene = true, and 22 flagged blocks are trimmed. Load-bearing facts survive:plot_bar_groups' row-majorvalues[item*group_count+group]layoutTwo structural moves avoided cutting anything. Section dividers fused to the prose beneath them were split with a blank line — a divider and its prose count as one block, so splitting costs no words. And a 7-line block inside a
def private(cap 1) was hoisted above thedef, where the cap is 3, keeping the EndPlot-render ordering and the issue-#9 owned-copy quirk fully intact.No suppressions needed.
Verification
The 3 are STYLE030, byte-identical to baseline — nothing outside scope moved.
Probe-tested first, with a declaration above the test block (otherwise it's exempt as module-leading and STYLE014 never fires). A second probe confirmed
requirelines don't count as the first declaration, which is what let the skipped bind file's header be correctly left alone.bind/bind_implot.dasstays skipped — it needs a daslang built with dasClangBind. Skipped means unverified, so it was hand-reviewed: three comment blocks, two at cap, one module-leading and exempt. No changes needed; it got only its options line.All 44 files remain CRLF. No code changed — comments, one options line per file, and one field docstring reworded in place.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Gkkfmcb1RhM3vNR3M35Avh