Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
062e67b
Experiemental async loading
TheAngryByrd Apr 4, 2023
fd0214e
Make graph builds all TFM
TheAngryByrd Feb 27, 2025
5034fab
Add local test cases
TheAngryByrd Feb 27, 2025
5b83436
Make tests tasks
TheAngryByrd Feb 27, 2025
31e5b63
Return Results based on errors
TheAngryByrd Mar 9, 2025
d3602c5
Changed from Exception to Error
TheAngryByrd Mar 9, 2025
137984e
Testing Sample2
TheAngryByrd Mar 9, 2025
975234b
Parse happy path without graph
TheAngryByrd Mar 9, 2025
ac9f4d1
Add GetAllTfms for Nongraph path
TheAngryByrd Mar 10, 2025
a9411c2
Make nongraph buildparameters per project for binlogs
TheAngryByrd Mar 10, 2025
328207d
Walk Projects non graph
TheAngryByrd Mar 11, 2025
6015124
Add 3535 to nowarn
TheAngryByrd Mar 11, 2025
ec2c343
Try "local" versions of msbuild in tests
TheAngryByrd Mar 12, 2025
a999b08
fix global.json
TheAngryByrd Mar 12, 2025
a14fe50
cleanups
TheAngryByrd Apr 5, 2025
95f96e3
Handle cancellation of builds by throwing OperationCanceledException …
TheAngryByrd Aug 3, 2025
7e3d339
Refactor BuildResultFailure type
TheAngryByrd Aug 8, 2025
a4f0ee2
Enhance documentation and refactor ProjectLoader2 and Tests modules f…
TheAngryByrd Aug 9, 2025
0f9bd69
Update Expecto and YoloDev.Expecto.TestSdk versions in Directory.Pack…
TheAngryByrd Oct 3, 2025
7179a24
Add Copilot instructions for Ionide.ProjInfo project
TheAngryByrd Oct 3, 2025
378b927
Add new test cases for sample projects in Ionide.ProjInfo.Tests
TheAngryByrd Oct 3, 2025
c7dba98
update test timeout and dependency chains
TheAngryByrd Oct 3, 2025
3651ba3
Refactor project testing utilities and enhance test structure
TheAngryByrd Oct 3, 2025
b5d8719
Enhance error handling for non-restored projects and improve test uti…
TheAngryByrd Dec 14, 2025
adef05b
Refactor error handling for project restoration and update related ty…
TheAngryByrd Dec 17, 2025
3f40b1b
Add new test cases for various project samples and update project opt…
TheAngryByrd Dec 17, 2025
7ee0ede
Remove redundant dependency for Test:net8.0 in build targets
TheAngryByrd Dec 18, 2025
d0585c3
Update fantomas version to 7.0.5 in dotnet-tools configuration
TheAngryByrd Dec 18, 2025
00008b3
Increase test timeout to 5 minutes for improved stability in CI
TheAngryByrd Dec 18, 2025
307547b
Move AwaitableDisposable type definition into SemaphoreSlimExtensions…
TheAngryByrd Dec 18, 2025
95975d6
Add agent guide for Ionide.ProjInfo with build and testing instructions
TheAngryByrd Dec 18, 2025
785b225
Add cleanup function for global.json in test directory
TheAngryByrd Dec 18, 2025
f9abe60
Refactor test function name for consistency and clarity
TheAngryByrd Dec 18, 2025
4f9ae07
Refactor project option expectations in test assets for clarity and c…
TheAngryByrd Dec 18, 2025
f79a067
Enhance EvaluateAsGraphAllTfms method to improve multi-targeting supp…
TheAngryByrd Dec 19, 2025
25fbb21
Refactor code for improved readability in TestAssets.fs
TheAngryByrd Dec 19, 2025
20b2c4a
Refactor target framework retrieval in EvaluateAsGraphAllTfms for cla…
TheAngryByrd Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"fantomas": {
"version": "7.0.3",
"version": "7.0.5",
"commands": [
"fantomas"
],
Expand Down
59 changes: 59 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copilot Instructions for Ionide.ProjInfo

## Project Overview
- **Ionide.ProjInfo** is a set of F# libraries and tools for parsing and evaluating `.fsproj` and `.sln` files, used by F# tooling (e.g., Ionide, FSAC, Fable, FSharpLint).
- Major components:
- `Ionide.ProjInfo`: Core project/solution parsing logic (uses Microsoft.Build APIs).
- `Ionide.ProjInfo.FCS`: Maps project data to FSharp.Compiler.Service types.
- `Ionide.ProjInfo.ProjectSystem`: High-level project system for editor tooling (change tracking, notifications, caching).
- `Ionide.ProjInfo.Tool`: CLI for debugging project cracking.

## Build & Test Workflows
- **Restore tools:** `dotnet tool restore`
- **Build solution:** `dotnet build ionide-proj-info.sln`
- **Run all tests:** `dotnet run --project build -- Test`
- **Multi-TFM testing:**
- For specific TFM:
- LTS (net8.0) `dotnet run --project build -- Test:net8.0`
- STS (net9.0) `dotnet run --project build -- Test:net9.0`

- **Test assets:** Test projects in `test/examples/` cover a wide range of real-world project structures (multi-TFM, C#/F#, old/new SDK, solution filters, etc.).

## Key Patterns & Conventions
- **Project loading:** Prefer using the MSBuild loader; use `--graph` for graph-based loading in CLI tool.
- **Output formats:** CLI tool supports structured text, FCS options (`--fcs`), or JSON (`--serialize`).
- **Cross-language:** Handles both F# and C# projects/references.
- **Persistent caching:** ProjectSystem caches data for fast reloads.
- **Testing:** Uses Expecto for tests; see `test/Ionide.ProjInfo.Tests/` for patterns.
- **Release process:** Update `CHANGELOG.md`, tag, and push (see `CONTRIBUTING.md`).

## Integration Points
- Consumed by Fable, FSAC, Ionide, FSharpLint, and F# Formatting.
- External dependencies: Microsoft.Build, FSharp.Compiler.Service (FCS).
- Nightly builds may require custom NuGet feeds (see `CONTRIBUTING.md`).

## Where to Look
- **Architecture:** See `README.md` (root), `src/` for main libraries, `test/examples/` for project scenarios.
- **Developer workflow:** `CONTRIBUTING.md` for build/test/release details.
- **Tool usage:** `src/Ionide.ProjInfo.Tool/README.md` and `Program.fs`.
- **Test patterns:** `test/Ionide.ProjInfo.Tests/` and helpers in `FileUtils.fs`.

## Code of Conduct
- See `CODE_OF_CONDUCT.md` for community standards.

---
For more, see https://github.com/ionide/dotnet-proj-info and linked docs.


### MCP Tools

> [!IMPORTANT]

You have access to a long-term memory system via the Model Context Protocol (MCP) at the endpoint `memorizer`. Use the following tools:
- `store`: Store a new memory. Parameters: `type`, `content` (markdown), `source`, `tags`, `confidence`, `relatedTo` (optional, memory ID), `relationshipType` (optional).
- `search`: Search for similar memories. Parameters: `query`, `limit`, `minSimilarity`, `filterTags`.
- `get`: Retrieve a memory by ID. Parameter: `id`.
- `getMany`: Retrieve multiple memories by their IDs. Parameter: `ids` (list of IDs).
- `delete`: Delete a memory by ID. Parameter: `id`.
- `createRelationship`: Create a relationship between two memories. Parameters: `fromId`, `toId`, `type`.
Use these tools to remember, recall, relate, and manage information as needed to assist the user. You can also manually retrieve or relate memories by their IDs when necessary.
58 changes: 58 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Agent Guide for Ionide.ProjInfo
1. Restore local tools before anything else: `dotnet tool restore`.
2. Standard build: `dotnet build ionide-proj-info.sln` (FAKE build target `dotnet run --project build -- -t Build`).
3. Full test matrix: `dotnet run --project build -- -t Test` (runs net8/net9/net10 with temporary `global.json`).
4. Single test project: `dotnet test test/Ionide.ProjInfo.Tests/Ionide.ProjInfo.Tests.fsproj --filter "FullyQualifiedName~<TestName>"` after ensuring the desired SDK via `global.json` and `BuildNet*` env vars.
5. Formatting uses Fantomas; prefer `dotnet run --project build -- -t CheckFormat`, and run `-t Format` only when necessary.
6. Repo follows .editorconfig: 4-space indent, LF endings, final newline; XML projects/yaml use 2 spaces.
7. F# formatting: Stroustrup braces, 240 char max line, limited blank lines, arrays/lists wrap after one item, multiline lambdas close on newline.
8. Naming: descriptive PascalCase for types/modules, camelCase for values/parameters, UPPER_CASE for constants/environment keys.
9. Imports: keep `open` statements grouped at top, ordered System → third-party → project namespaces; remove unused opens.
10. Types: prefer explicit types on public members and when inference harms clarity; use records/DU for shape safety.
11. Error handling: use `Result`/`Choice` for recoverable states, raise exceptions only when failing fast; log via FsLibLog where available.
12. Async workflows: keep side effects isolated; favor `task {}` or `async {}` consistently per module.
13. Tests use Expecto; follow `TestAssets.fs` helpers and keep assertions expressive.
14. Avoid introducing new dependencies without discussion; stick to existing FAKE pipeline for packaging/pushing.
15. Copilot rules apply: follow `.github/copilot-instructions.md` for architecture pointers and release workflow awareness.
16. No Cursor-specific rules present; if they appear later under `.cursor/`, integrate them here.
17. Always update CHANGELOG for user-facing changes and confirm Code of Conduct compliance.
18. Document CLI/tool behavior changes in respective `README.md` files under `src/*`.
19. Keep public APIs backward compatible; prefer additive changes and guard feature flags.
20. When unsure about SDK/runtime alignment, run `dotnet --version` and adjust `global.json` to match test needs.


## Resources

### Core Documentation
- [FsAutoComplete GitHub Repository](https://github.com/ionide/FsAutoComplete)
- [LSP Specification](https://microsoft.github.io/language-server-protocol/)
- [F# Compiler Service Documentation](https://fsharp.github.io/FSharp.Compiler.Service/)

### F# Development Guidelines
- [F# Style Guide](https://docs.microsoft.com/en-us/dotnet/fsharp/style-guide/)
- [F# Formatting Guidelines](https://docs.microsoft.com/en-us/dotnet/fsharp/style-guide/formatting)
- [F# Component Design Guidelines](https://docs.microsoft.com/en-us/dotnet/fsharp/style-guide/component-design-guidelines)

### Project-Specific Guides
- [Creating a New Code Fix Guide](./docs/Creating%20a%20new%20code%20fix.md)
- [Ionide.ProjInfo Documentation](https://github.com/ionide/proj-info)
- [Fantomas Configuration](https://fsprojects.github.io/fantomas/)

### Related Tools
- [FSharpLint](https://github.com/fsprojects/FSharpLint/) - Static analysis tool
- [Paket](https://fsprojects.github.io/Paket/) - Dependency management
- [FAKE](https://fake.build/) - Build automation (used for scaffolding)


### MCP Tools

> [!IMPORTANT]

You have access to a long-term memory system via the Model Context Protocol (MCP) at the endpoint `memorizer`. Use the following tools:
- `store`: Store a new memory. Parameters: `type`, `content` (markdown), `source`, `tags`, `confidence`, `relatedTo` (optional, memory ID), `relationshipType` (optional).
- `search`: Search for similar memories. Parameters: `query`, `limit`, `minSimilarity`, `filterTags`.
- `get`: Retrieve a memory by ID. Parameter: `id`.
- `getMany`: Retrieve multiple memories by their IDs. Parameter: `ids` (list of IDs).
- `delete`: Delete a memory by ID. Parameter: `id`.
- `createRelationship`: Create a relationship between two memories. Parameters: `fromId`, `toId`, `type`.
Use these tools to remember, recall, relate, and manage information as needed to assist the user. You can also manually retrieve or relate memories by their IDs when necessary.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<PackageVersion Include="Expecto" Version="$(ExpectoVersion)" />
<PackageVersion Include="Expecto.Diff" Version="$(ExpectoVersion)" />
<PackageVersion Include="MedallionShell" Version="1.5.1" />
<PackageVersion Include="YoloDev.Expecto.TestSdk" Version="0.15.3" />
<PackageVersion Include="YoloDev.Expecto.TestSdk" Version="0.15.5" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<!-- Build Dependencies-->
Expand Down
33 changes: 29 additions & 4 deletions build/Program.fs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
open Fake.Core
open Fake.Core
open Fake.DotNet
open Fake.IO
open Fake.IO.Globbing.Operators
open Fake.Core.TargetOperators
open System

System.Environment.CurrentDirectory <- (Path.combine __SOURCE_DIRECTORY__ "..")

Expand Down Expand Up @@ -104,7 +105,19 @@ let init args =
"net10.0", Some "BuildNet10"
]

let cleanupGlobalJson =
let globalJsonPath = Path.combine "test" "global.json"

fun () ->
try
if System.IO.File.Exists globalJsonPath then
System.IO.File.Delete globalJsonPath
with _ ->
()

let testTFM tfm =
cleanupGlobalJson ()

try
exec "dotnet" $"new globaljson --force --sdk-version {tfmToSdkMap.[tfm]} --roll-forward LatestMinor" "test" Map.empty

Expand All @@ -123,10 +136,18 @@ let init args =
| Some envVar -> Map.ofSeq [ envVar, "true" ]
| None -> Map.empty

exec "dotnet" $"test --blame --blame-hang-timeout 120s --framework {tfm} --logger trx --logger GitHubActions -c %s{configuration} .\\Ionide.ProjInfo.Tests\\Ionide.ProjInfo.Tests.fsproj -- %s{failedOnFocus}" "test" envs
let timeoutInSeconds =
(TimeSpan.FromMinutes 5).TotalSeconds
|> int

exec
"dotnet"
$"test --blame --blame-hang-timeout %d{timeoutInSeconds}s --framework %s{tfm} --logger trx --logger GitHubActions -c %s{configuration} .\\Ionide.ProjInfo.Tests\\Ionide.ProjInfo.Tests.fsproj -- %s{failedOnFocus}"
"test"
envs
|> ignore
finally
System.IO.File.Delete "test\\global.json"
cleanupGlobalJson ()

Target.create "Test" DoNothing

Expand Down Expand Up @@ -204,7 +225,11 @@ let init args =
Target.create "Release" DoNothing

"Clean"
==> "CheckFormat"
==> "Default"
|> ignore

"Clean"
?=> "CheckFormat"
==> "Build"
==> "Test"
==> "Default"
Expand Down
3 changes: 1 addition & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"rollForward": "latestMinor",
"allowPrerelease": true
"rollForward": "latestMinor"
}
}
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<NoWarn>$(NoWarn);FS3535</NoWarn> <!-- interfaces with static abstract methods --> <PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DebugType>embedded</DebugType>
Expand Down
1 change: 1 addition & 0 deletions src/Ionide.ProjInfo/Ionide.ProjInfo.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Compile Include="VisualTree.fs" />
<Compile Include="InspectSln.fs" />
<Compile Include="Library.fs" />
<Compile Include="ProjectLoader2.fs" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading