Repository navigation
Restyle settings and offer to fix asmdef references (1.2.1) - #13
Merged
Merged
Conversation
- Group the settings into collapsible Output, Tables, Generated Members, Naming and Advanced sections; each remembers whether it is open. - Use one label width so long labels are no longer truncated, and grey out options that do not apply: Smart Parameter Types while Smart Strings is Off, and Reference Members while MethodsAndRefs forces it. - Warn when both table kinds are off; show folder errors as errors. - Window and Project Settings page share a toolbar (Regenerate, Verify, Open Output Folder, Setup Wizard) and a last-run summary whose warnings fold out; the page gets proper margins, and every setting label is a search keyword. - Fix: a folder picked with Browse was not saved, because ExitGUI throws before the change check runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the output folder lies below a folder owned by an .asmdef (or one joined to an assembly through an .asmref), the generated code compiles into that assembly. Unlike Assembly-CSharp it only sees the assemblies it references explicitly, so the code failed to compile until the user added com.severnbli.localization-codegen.Runtime and Unity.Localization (and the UniTask assemblies when UniTask members are on) by hand. - AssemblyOwnership walks up from the output folder to Assets, resolves .asmref files and GUID: references, and lists the missing references. - Changing the output folder (typed, Browse or setup wizard) asks to Add References, Use Separate .asmdef or decide later. Read-only package asmdefs only offer the separate .asmdef. - The Output section keeps showing which assembly the code compiles into, with the same two fixes while references are missing. - References are added by text insertion, so the asmdef keeps its formatting, line endings and BOM, and GUID-style references are written as GUIDs. - Generation warns about missing references, without failing on a broken asmdef. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Text edits: multi-line, empty, missing and single-line references arrays, CRLF with tabs, and other arrays such as versionDefines left untouched. - Lookup: nearest asmdef wins, folders that do not exist yet, the generator's own asmdef skipped, GUID references, .asmref by name and by GUID, and an .asmref to an unknown assembly. - Writing: names vs GUIDs following the asmdef's style, BOM kept, no write when nothing is missing. The fixtures live in a folder ending with '~', which Unity never imports, so the tests do not trigger a recompile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AssemblyBuilder is marked obsolete from Unity 6.5 (CS0618) but is still the only in-editor way to compile with Unity's compiler and references. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
This restyles the settings UI and adds a prompt for the case where the output folder sits inside another assembly definition. Version bumped to 1.2.1.
Owning-assembly prompt
If the output folder is below a folder owned by an
.asmdef(directly, or joined through an.asmref), the generated code compiles into that assembly. That assembly only sees what it references, so the code didn't compile until the user addedcom.severnbli.localization-codegen.RuntimeandUnity.Localizationby hand (plus the UniTask assemblies when UniTask members are on).Now, choosing such a folder (typed, Browse…, or in the setup wizard) asks what to do:
.asmdef. Its formatting, line endings and BOM are kept, and references are written as GUIDs if the asmdef already uses GUIDs.An asmdef inside a read-only package only gets the separate-.asmdef option. The Output section keeps showing which assembly the code compiles into, with both fixes, and generation warns while references are missing.
Settings styling
Fixes
ExitGUIthrows before the change check runs.AssemblyBuilderobsolete warning (CS0618) in the compile test on Unity 6.5.Commits
4d81a2crestyle ·c86519fowning-assembly prompt ·ec5d6a2tests ·01e8731CS0618 ·f019f17docs ·b3c41fd1.2.1Test plan
commands/check-package.shpasses (versions, synced READMEs/changelogs, .meta files)🤖 Generated with Claude Code