Skip to content

feat: enhance .NET detection with F#, framework parsing, and expanded signals#60

Merged
digitarald merged 1 commit intomainfrom
feat/dotnet-detection-enhanced
Mar 15, 2026
Merged

feat: enhance .NET detection with F#, framework parsing, and expanded signals#60
digitarald merged 1 commit intomainfrom
feat/dotnet-detection-enhanced

Conversation

@digitarald
Copy link
Copy Markdown
Collaborator

Cherry-picks and improves the valuable parts from #2 (which targets the old file structure and has merge conflicts).

What's new

F# language detection

  • Detects .fsproj files and pushes "F#" to analysis.languages
  • Mixed C#/F# repos correctly get both languages

Expanded .NET signals

  • global.json and Directory.Build.props now trigger .NET detection alongside .csproj/.sln/.slnx
  • packages.lock.json added to PACKAGE_MANAGERS for NuGet lock file detection

.NET framework detection from project file contents

New detectDotnetFrameworks() globs **/*.{csproj,fsproj} and parses XML content to identify:

  • Web: ASP.NET Core, Blazor WebAssembly, Blazor
  • Data: Entity Framework
  • UI: .NET MAUI, Xamarin, WPF, Windows Forms
  • Test: xUnit, NUnit, MSTest
  • Console: fallback for Sdk="Microsoft.NET.Sdk" + OutputType=Exe

Instructions prompt

  • Updated tech stack identification to include .fsproj, global.json

Tests added (7 new)

  • F# language via .fsproj
  • .NET via global.json
  • ASP.NET Core framework from .csproj
  • xUnit detection (without Microsoft.NET.Test.Sdk false positive for MSTest)
  • Mixed C#/F# repo
  • packages.lock.json → nuget package manager

Improvements over #2

  • Targets the current file structure (packages/core/src/services/)
  • Exact package name matching (Include="pkg" with closing quote) to avoid prefix false positives
  • Microsoft.NET.Test.Sdk excluded from MSTest detection (it's a shared test host)
  • Glob ignores node_modules, bin, obj directories
  • No redundant deep .csproj/.fsproj glob for language detection (solution parsing already handles monorepos)

Closes #2

… signals

- Add F# language detection via .fsproj files
- Add .NET framework detection by parsing project file contents
  (ASP.NET Core, Blazor, Entity Framework, MAUI, Xamarin, WPF,
  WinForms, xUnit, NUnit, MSTest, Console)
- Expand .NET signal detection to include global.json and Directory.Build.props
- Add packages.lock.json to PACKAGE_MANAGERS for NuGet lock file detection
- Update instructions prompt to include .fsproj and global.json
- Add 7 new tests covering all new detection paths

Cherry-picked and improved from #2.
Copilot AI review requested due to automatic review settings March 15, 2026 23:36
@digitarald digitarald merged commit 3144da7 into main Mar 15, 2026
13 checks passed
@digitarald digitarald deleted the feat/dotnet-detection-enhanced branch March 15, 2026 23:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enhances the repo analysis and instruction-generation services to better recognize .NET repositories by adding F# detection, additional .NET “signal” files, NuGet lockfile detection, and framework inference from *.csproj/*.fsproj contents.

Changes:

  • Extend .NET detection signals (.fsproj, global.json, Directory.Build.props) and add NuGet lockfile (packages.lock.json) recognition.
  • Add framework detection by scanning and parsing *.csproj/*.fsproj to infer common .NET frameworks (ASP.NET Core, xUnit, Console, etc.).
  • Update instruction-generation prompt to include .fsproj/global.json, and add tests for the new detection behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/services/__tests__/analyzer.test.ts Adds new Vitest cases covering F#, global.json detection, csproj framework parsing, mixed-language repos, and NuGet lockfile detection.
packages/core/src/services/instructions.ts Updates the instruction-generation prompt to include additional .NET/F# tech stack markers.
packages/core/src/services/analyzer.ts Expands .NET signals, adds NuGet lock detection, and introduces deep project-file scanning to infer .NET frameworks.

Comment on lines +112 to +113
if (hasCsproj || (hasDotnet && !hasFsproj)) analysis.languages.push("C#");
if (hasFsproj) analysis.languages.push("F#");
async function detectDotnetFrameworks(repoPath: string): Promise<string[]> {
const projectFiles = await fg("**/*.{csproj,fsproj}", {
cwd: repoPath,
onlyFiles: true,
analysis.frameworks.push(...detectFrameworks(deps, files));
}

if (hasDotnet) {
Comment on lines +313 to +317
it("detects both C# and F# in mixed repo", async () => {
const repoPath = await makeTmpDir();
await fs.writeFile(
path.join(repoPath, "App.csproj"),
'<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><OutputType>Exe</OutputType></PropertyGroup></Project>'
github-actions Bot pushed a commit that referenced this pull request Mar 15, 2026
- Add [Unreleased] section documenting features from PRs #55, #60, #53, #52:
  - instructions --dry-run flag
  - VS Code batch instructions and multi-root workspace support
  - Enhanced .NET/F# detection with framework parsing
  - Windows .bat/.cmd spawn EINVAL fix
  - ESM/CJS createRequire banner fix
  - Model default updated to claude-sonnet-4.6
  - TUI key binding changes (R for readiness, N for nested area)
  - Terminology de-branding
- Fix stale claude-sonnet-4.5 reference in [2.0.0] section

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants