Improve source indexer deduplication to prefer real implementation over *.notsupported.cs files#192
Conversation
Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
…er *.notsupported.cs Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
…utput Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
Implemented project properties plumbing as requested. The BinLogReader now captures project properties from the binlog and stores them in a ProjectProperties dictionary on CompilerInvocation. The scoring logic uses these properties instead of file/command-line conventions. Commit c59f2a1 |
…rder scoring priorities Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
…BinLogReader Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…t score values Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Almost, we need to enable tests to run. We should add test step to https://github.com/dotnet/source-indexer/blob/main/.github/workflows/dotnet.yml |
The fork has diverged ~21 commits since the last upstream sync (PR dotnet#184, 2025-05-12). Blindly re-running update-source-browser.ps1 risks silently dropping local features (dotnet#183 signing key, dotnet#192 dedup, dotnet#193 source-generated files, dotnet#255 net10 retarget, dotnet#257 Linux binlog fix, plus Dependabot bumps). - 02: prepend warning block to the 'Updating the vendored SourceBrowser' section listing the divergent PRs and recommending cherry-picks over a full re-sync. - 00: cross-reference the warning from the overview bullet. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This PR addresses the issue where https://source.dot.net/ shows platform-agnostic source code containing mostly empty classes that throw
PlatformNotSupportedExceptioninstead of the actual platform-specific implementation files.Problem
The current deduplication logic in
BinLogToSln/Program.cswas too simplistic, using only file path-based deduplication. When multiple builds existed for the same assembly (e.g., generic + Linux-specific), it would select whichever was processed first, often resulting in.notsupported.csstub files being chosen over real implementation files.Solution
Implemented improved deduplication logic that:
AssemblyNameinstead of simple file path deduplicationint.MaxValuescore for builds explicitly marked for indexingIsPlatformNotSupportedAssemblybuildsDocumentation and Testing
docs/source-selection-algorithm.mdexplaining the scoring priorities, examples with concrete scores, and configuration optionsBinLogToSln.Testsproject with 12 test methods covering all scoring scenarios, edge cases, and priority ordering to protect against regressionsExample
Before this change, if there were two builds for
System.Net.NameResolution:System.Net.NameResolution.notsupported.cs(score: -1,955)The tool would pick whichever was processed first. Now it consistently selects the Linux build with real implementation.
The changes maintain backward compatibility while significantly improving source quality on https://source.dot.net/.
Fixes #188.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.