Conversation
The value of inassembly:/innamespace: was added to the keyword list, so every entity name had to contain the assembly name to match. It only appeared to work for assemblies whose name is a prefix of their namespaces (UnityEngine); Unity game code in Assembly-CSharp lives in the global namespace and found nothing. The WPF parser treated scope prefixes as filters only, which this restores, including not letting a dotted scope value switch on full-name matching. Assisted-by: Claude:claude-fable-5-1:Claude Code
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.
Fixes #4246.
Root cause
The regression is not in the handling of the dash. The query parser in
RunningSearch.ParseInputadded the value of every prefix to the keyword list, including the scope prefixesinassembly:andinnamespace:. Every keyword has to be contained in an entity's (short) name forAbstractSearchStrategy.IsMatchto accept it, soinassembly:Assembly-CSharp Chipproduced the keywordsAssembly-CSharpandChip, and no type or member name in the game assembly containsAssembly-CSharp.inassembly:UnityEngineonly appeared to work: the stray keyword equals the namespace of the Unity types, so whenever another term carried a dot (which switches on full-name matching) the full namesUnityEngine.X.Ycontained it by coincidence. Game code inAssembly-CSharplives in the global namespace, so the stray keyword could never match. Any assembly whose name is not a prefix of its namespaces was affected, which is why the reporter saw it in "a lot of games".How the root cause was found
inassemblyhandling:RunningSearch.ParseInput(parser) andAbstractEntitySearchStrategy.IsInNamespaceOrAssembly(filter). The filter is a plainContainson the file name / full assembly name, so a dash cannot break it.AbstractSearchStrategy.PrepareTerms/IsMatch: every keyword is a mandatoryContainsagainst the entity name.ILSpy/Search/SearchPane.xaml.cs): it only added the term as a keyword (and only touchedFullNameSearch/OmitGenerics) whenprefix == null || prefix.Length <= 2, so scope prefixes were filters only.git log -Sshowed this was lost in 99a956c ("Search-prefix DSL"), which also pinned the new behaviour inSearchPrefixParsingTests.ilspycmd -l: none of the 116 types inAssembly-CSharp.dlland none of the 444 types inUnityEngine.CoreModule.dllhas the assembly name in its short name.Managedfolder:inassembly:Assembly-CSharp Chip: results in v10, empty in v11.inassembly:Assembly-CSharp: empty in both versions, because no keyword means no search strategy (GetSearchStrategy/GetStrategyreturn null). The reporter's "works on 10" therefore refers to the scope filter combined with a typed term, typically via the "Scope search to this assembly" context menu.Change
Scope prefixes now set their filter and skip the keyword list and the full-name / generics heuristics, restoring the v10 contract. The two parser tests that pinned the leak were corrected, and three regression tests were added: the exact
inassembly:Assembly-CSharp Chipshape, a lone scope prefix yielding zero keywords, and an end-to-end headless search forinassembly:System.Private.CoreLib =Stringwhose results must all come from the core library. All were red before the fix and green after.Side observation, not addressed here: the
--searchcommand-line argument is still a no-op at startup in the Avalonia build (AssemblyTreeModel.HandleCommandLineArgumentsAsync).Assisted-by: Claude:claude-fable-5-1:Claude Code
🤖 Generated with Claude Code