From 31a242e8c44dd610dde9c6b8166b735e56466fcd Mon Sep 17 00:00:00 2001 From: Andrii Chebukin Date: Mon, 30 Jun 2025 01:52:11 +0400 Subject: [PATCH 1/2] chore(copilot): add GitHub MCP --- .mcp.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .mcp.json diff --git a/.mcp.json b/.mcp.json new file mode 100644 index 000000000..b97056ff8 --- /dev/null +++ b/.mcp.json @@ -0,0 +1,19 @@ +{ + "servers": { + "GitHub": { + "type": "http", + "url": "https://api.githubcopilot.com/mcp/", + "headers": { + "Authorization": "Bearer ${input:github_pat}" + } + } + }, + "inputs": [ + { + "id": "github_pat", + "description": "GitHub personal access token", + "type": "promptString", + "password": true + } + ] +} From f470eb6dcf75ed5728f971b63c3537abb1470b45 Mon Sep 17 00:00:00 2001 From: Andrii Chebukin Date: Mon, 30 Jun 2025 01:54:06 +0400 Subject: [PATCH 2/2] chore(copilot): add basic Copilot instructions --- .github/copilot-instructions.md | 57 +++++++++++++++++++++++++++++++++ CHANGELOG.md | 1 + 2 files changed, 58 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 000000000..8690c4389 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,57 @@ +We prefer the latest F# 9 features over the old syntax + +Prefer `voption` over `option` + +Prefer `task` CE over `async` CE + +This is how you define a non-default F# class constructor: +```fsharp +type DerivedClass = + inherit BaseClass + + new (``arguments here``) as ``created object`` + = + // create any objects used in the base class constructor + let fieldValue = "" + { + inherit + BaseClass (``arguments here``) + } + then + ``created object``.otherField <- fieldValue + + [] + val mutable otherField : FieldType +``` + +Always prefer F# class initializers over property assignment! **You absolutely must use F# class initializers instead of property assignment**! + +Class declaration: +``` F# +type MyClass (someConstructorParam : string) = + member ReadOnlyProperty = someConstructorParam + + member val MutableProperty1 = "" with get, set + member val MutableProperty2 = "" with get, set +``` + +Wrong: +``` F# +let myClass = MyClass("some value") +myClass.MutableProperty1 <- "new value" +myClass.MutableProperty2 <- "new value" +``` + +Right: +``` F# +let myClass = + MyClass( + // constructor parameters go first without names + "some value", + // then mutable properties go next with names + MutableProperty1 = "new value", + MutableProperty2 = + // operations must be placed into parentheses + (5 |> string) + ) +``` diff --git a/CHANGELOG.md b/CHANGELOG.md index 928a30bbb..a79ee7619 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Remove `Newtonsoft.Json` NuGet dependency #725 [@xperiandri] - Add missing rule checks for FL0079-FL0081 #713 [@BennieCopeland] - Modify `.gitignore` to the Visual Studio standard one #735 [@xperiandri] +- Add basic Copilot instructions and GitHub MCP #726 [@xperiandri] ## [0.24.2] - 2024-02-29