Skip to content

Commit 2e2c636

Browse files
committed
Merge upstream main
2 parents 785e6a7 + b38116a commit 2e2c636

File tree

357 files changed

+19203
-7915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

+19203
-7915
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
44
#-------------------------------------------------------------------------------------------------------------
55

6-
ARG VARIANT=7.0-bullseye-slim
6+
ARG VARIANT=7.0.100-bullseye-slim-amd64
77
FROM mcr.microsoft.com/dotnet/sdk:${VARIANT}
88

99
# Avoid warnings by switching to noninteractive

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"args": {
77
// Update 'VARIANT' to pick a .NET Core version: 3.1, 5.0, 6.0, 7.0
88
// Append -bullseye(-slim), -focal, or -jammy to pin to an OS version.
9-
"VARIANT": "7.0-bullseye-slim"
9+
"VARIANT": "7.0.100-bullseye-slim-amd64"
1010
}
1111
},
1212
"hostRequirements": {

.fantomasignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ fcs-samples/
77
scripts/
88
setup/
99
tests/
10-
vsintegration/
10+
vsintegration/*
11+
!vsintegration/tests/FSharp.Editor.Tests
1112
artifacts/
1213

1314
# Explicitly formatted Tests/ subdirectories (with exceptions)

.github/workflows/add_to_project.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: Add all issues to F# project, assign milestone and labels
1+
name: Add all issues and PRs to F# project, assign milestone and labels
22

33
on:
44
issues:
55
types:
66
- opened
77
- transferred
8+
pull_request_target:
9+
types:
10+
- opened
11+
branches: ['main']
812

913
permissions:
1014
issues: write
@@ -13,6 +17,7 @@ permissions:
1317
jobs:
1418
cleanup_old_runs:
1519
runs-on: ubuntu-20.04
20+
if: github.event_name != 'pull_request_target'
1621
permissions:
1722
actions: write
1823
env:
@@ -38,6 +43,7 @@ jobs:
3843
github-token: ${{ secrets.REPO_PROJECT_PAT }}
3944
apply-label:
4045
runs-on: ubuntu-latest
46+
if: github.event_name != 'pull_request_target'
4147
steps:
4248
- uses: actions/github-script@v6
4349
with:
@@ -50,6 +56,7 @@ jobs:
5056
})
5157
apply-milestone:
5258
runs-on: ubuntu-latest
59+
if: github.event_name != 'pull_request_target'
5360
steps:
5461
- uses: actions/github-script@v6
5562
with:

.github/workflows/commands.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Commands on PR
2+
on:
3+
issue_comment:
4+
types: [created]
5+
schedule:
6+
# once a day at 13:00 UTC
7+
- cron: '0 13 * * *'
8+
9+
permissions:
10+
contents: write
11+
issues: write
12+
pull-requests: write
13+
14+
jobs:
15+
cleanup_old_runs:
16+
if: github.event.schedule == '0 13 * * *'
17+
runs-on: ubuntu-20.04
18+
permissions:
19+
actions: write
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
steps:
23+
- name: Delete old workflow runs
24+
run: |
25+
_UrlPath="/repos/$GITHUB_REPOSITORY/actions/workflows"
26+
_CurrentWorkflowID="$(gh api -X GET "$_UrlPath" | jq '.workflows[] | select(.name == '\""$GITHUB_WORKFLOW"\"') | .id')"
27+
28+
# delete workitems which are 'completed'. (other candidate values of status field are: 'queued' and 'in_progress')
29+
30+
gh api -X GET "$_UrlPath/$_CurrentWorkflowID/runs" --paginate \
31+
| jq '.workflow_runs[] | select(.status == "completed") | .id' \
32+
| xargs -I{} gh api -X DELETE "/repos/$GITHUB_REPOSITORY/actions/runs"/{}
33+
34+
run_command:
35+
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/run')
36+
runs-on: ubuntu-20.04
37+
steps:
38+
- name: Extract command to run
39+
uses: actions/github-script@v3
40+
id: command-extractor
41+
with:
42+
result-encoding: string
43+
script: |
44+
if (context.eventName !== "issue_comment") throw "Error: This action only works on issue_comment events.";
45+
46+
// extract the command to run, allowed characters: a-z, A-Z, digits, hyphen, underscore
47+
const regex = /^\/run ([a-zA-Z\d\-\_]+)/;
48+
command = regex.exec(context.payload.comment.body);
49+
if (command == null) throw "Error: No command found in the trigger phrase.";
50+
51+
return command[1];
52+
- name: Get github ref
53+
uses: actions/github-script@v3
54+
id: get-pr
55+
with:
56+
script: |
57+
const result = await github.pulls.get({
58+
pull_number: context.issue.number,
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
});
62+
return { "ref": result.data.head.ref, "repository": result.data.head.repo.full_name};
63+
- name: Checkout repo
64+
uses: actions/checkout@v2
65+
with:
66+
repository: ${{ fromJson(steps.get-pr.outputs.result).repository }}
67+
ref: ${{ fromJson(steps.get-pr.outputs.result).ref }}
68+
fetch-depth: 0
69+
- name: Install dotnet
70+
uses: actions/setup-dotnet@v3
71+
with:
72+
global-json-file: global.json
73+
- name: Install dotnet tools
74+
run: dotnet tool restore
75+
- name: Process fantomas command
76+
if: steps.command-extractor.outputs.result == 'fantomas'
77+
id: fantomas
78+
run: dotnet fantomas src -r
79+
- name: Process fantomas command
80+
if: steps.command-extractor.outputs.result == 'xlf'
81+
id: xlf
82+
run: dotnet build src\Compiler /t:UpdateXlf
83+
- name: Commit and push changes
84+
if: steps.fantomas.outcome == 'success' || steps.xlf.outcome == 'success'
85+
run: |
86+
git config --local user.name "github-actions[bot]"
87+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
88+
git commit -a -m 'Automated command ran: ${{ steps.command-extractor.outputs.result }}
89+
90+
Co-authored-by: ${{ github.event.comment.user.login }} <${{ github.event.comment.user.id }}+${{ github.event.comment.user.login }}@users.noreply.github.com>'
91+
git push
92+
- name: Post command comment
93+
if: steps.fantomas.outcome == 'success' || steps.xlf.outcome == 'success'
94+
uses: actions/github-script@v3
95+
with:
96+
script: |
97+
// Probably, there's more universal way of getting outputs, but my gh-actions-fu is not that good.
98+
var output = ""
99+
if ("${{steps.command-extractor.outputs.result}}" == 'fantomas') {
100+
output = "${{steps.fantomas.outputs.result}}"
101+
} else if("${{steps.command-extractor.outputs.result}}" == 'xlf') {
102+
output = "${{steps.xlf.outputs.result}}"
103+
}
104+
const body = `Ran ${{ steps.command-extractor.outputs.result }}: https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}\n${output}`;
105+
await github.issues.createComment({
106+
issue_number: context.issue.number,
107+
owner: context.repo.owner,
108+
repo: context.repo.repo,
109+
body: body
110+
});
111+
- name: Post command failed comment
112+
if: failure()
113+
uses: actions/github-script@v3
114+
with:
115+
script: |
116+
const body = `Failed to run ${{ steps.command-extractor.outputs.result }}: https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`;
117+
await github.issues.createComment({
118+
issue_number: context.issue.number,
119+
owner: context.repo.owner,
120+
repo: context.repo.repo,
121+
body: body
122+
});

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ scripts/*.patch
1515
/src/FSharp.Build/*.resx
1616
/src/fsi/*.resx
1717
/src/FSharp.Compiler.Interactive.Settings/*.resx
18-
/src/FSharp.Compiler.Server.Shared/*.resx
1918
/src/fsi/Fsi.sln
2019
/src/FSharp.Build/*.resources
2120
/src/Compiler/*.resx

.vscode/launch.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
"version": "0.2.0",
44
"inputs": [
55
{
6-
"id": "argsPrompt",
6+
"id": "fscArgsPrompt",
77
"description": "Enter arguments for fsc",
88
"default": "",
99
"type": "promptString",
10+
},
11+
{
12+
"id": "fsiArgsPrompt",
13+
"description": "Enter arguments for fsi (optional)",
14+
"default": "",
15+
"type": "promptString",
1016
}
1117
],
1218
"configurations": [
@@ -18,6 +24,9 @@
1824
// "preLaunchTask": "Build (Debug)",
1925
// If you have changed target frameworks, make sure to update the program p
2026
"program": "${workspaceFolder}/artifacts/bin/fsi/Debug/net7.0/fsi.dll",
27+
"args": [
28+
"${input:fsiArgsPrompt}"
29+
],
2130
"cwd": "${workspaceFolder}/src",
2231
"console": "integratedTerminal", // This is the default to be able to run in Codespaces.
2332
"internalConsoleOptions": "neverOpen",
@@ -44,7 +53,7 @@
4453
// If you have changed target frameworks, make sure to update the program path.
4554
"program": "${workspaceFolder}/artifacts/bin/fsc/Debug/net7.0/fsc.dll",
4655
"args": [
47-
"${input:argsPrompt}"
56+
"${input:fscArgsPrompt}"
4857
],
4958
"cwd": "${workspaceFolder}",
5059
"console": "integratedTerminal", // This is the default to be able to run in Codespaces.

.vscode/tasks.json

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,52 @@
1515
},
1616
"tasks": [
1717
{
18-
"label": "Build (Debug)",
18+
"label": "Full Build (Debug)",
1919
"command": "./build.sh",
2020
"type": "shell",
2121
"args": [
2222
"-c Debug"
2323
],
2424
"windows": {
2525
"command": "${workspaceFolder}/Build.cmd",
26+
"args": [
27+
"-c Debug",
28+
"-noVisualStudio"
29+
],
2630
},
2731
"problemMatcher": "$msCompile",
2832
"group": "build",
2933
},
3034
{
31-
"label": "Build (Release)",
35+
"label": "Full Build (Release)",
3236
"command": "./build.sh",
3337
"type": "shell",
3438
"args": [
3539
"-c Release"
3640
],
3741
"windows": {
3842
"command": "${workspaceFolder}/Build.cmd",
43+
"args": [
44+
"-c Release",
45+
"-noVisualStudio"
46+
],
3947
},
4048
"problemMatcher": "$msCompile",
4149
"group": "build",
4250
},
51+
{
52+
"label": "Rebuild (Debug)",
53+
"command": "dotnet",
54+
"type": "shell",
55+
"args": [
56+
"build",
57+
"-c",
58+
"Debug",
59+
"${workspaceFolder}/FSharp.sln"
60+
],
61+
"problemMatcher": "$msCompile",
62+
"group": "build",
63+
},
4364
{
4465
"label": "Update xlf files",
4566
"command": "./build.sh",

FSharp.Editor.sln

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.1.32113.165
4+
MinimumVisualStudioVersion = 10.0.40219.1
5+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Editor.Tests", "vsintegration\tests\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj", "{321F47BC-8148-4C8D-B340-08B7BF07D31D}"
6+
EndProject
7+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Service", "src\Compiler\FSharp.Compiler.Service.fsproj", "{AD603EF2-FAC6-48D1-AAEB-A6CF898062A9}"
8+
EndProject
9+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Core", "src\FSharp.Core\FSharp.Core.fsproj", "{67DA0BF3-AAD3-47F4-9EC6-AD8EC532B5A9}"
10+
EndProject
11+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.DependencyManager.Nuget", "src\FSharp.DependencyManager.Nuget\FSharp.DependencyManager.Nuget.fsproj", "{24399E68-9000-4556-BDDD-8D74A9660D28}"
12+
EndProject
13+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Editor", "vsintegration\src\FSharp.Editor\FSharp.Editor.fsproj", "{86E148BE-92C8-47CC-A070-11D769C6D898}"
14+
EndProject
15+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharp.PatternMatcher", "vsintegration\src\FSharp.PatternMatcher\FSharp.PatternMatcher.csproj", "{4FFA5E03-4128-48C9-8FCD-D7C60729ED74}"
16+
EndProject
17+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharp.UIResources", "vsintegration\src\FSharp.UIResources\FSharp.UIResources.csproj", "{DA9495E6-BEAA-42A4-AD3B-170D2005AF4B}"
18+
EndProject
19+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.VS.FSI", "vsintegration\src\FSharp.VS.FSI\FSharp.VS.FSI.fsproj", "{EAC029EB-4A8F-4966-9B38-60D73D8E20D1}"
20+
EndProject
21+
Global
22+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
23+
Debug|Any CPU = Debug|Any CPU
24+
Release|Any CPU = Release|Any CPU
25+
Proto|Any CPU = Proto|Any CPU
26+
EndGlobalSection
27+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
28+
{321F47BC-8148-4C8D-B340-08B7BF07D31D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{321F47BC-8148-4C8D-B340-08B7BF07D31D}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{321F47BC-8148-4C8D-B340-08B7BF07D31D}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{321F47BC-8148-4C8D-B340-08B7BF07D31D}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{321F47BC-8148-4C8D-B340-08B7BF07D31D}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
33+
{AD603EF2-FAC6-48D1-AAEB-A6CF898062A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34+
{AD603EF2-FAC6-48D1-AAEB-A6CF898062A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
35+
{AD603EF2-FAC6-48D1-AAEB-A6CF898062A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
36+
{AD603EF2-FAC6-48D1-AAEB-A6CF898062A9}.Release|Any CPU.Build.0 = Release|Any CPU
37+
{AD603EF2-FAC6-48D1-AAEB-A6CF898062A9}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
38+
{67DA0BF3-AAD3-47F4-9EC6-AD8EC532B5A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39+
{67DA0BF3-AAD3-47F4-9EC6-AD8EC532B5A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
40+
{67DA0BF3-AAD3-47F4-9EC6-AD8EC532B5A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
41+
{67DA0BF3-AAD3-47F4-9EC6-AD8EC532B5A9}.Release|Any CPU.Build.0 = Release|Any CPU
42+
{67DA0BF3-AAD3-47F4-9EC6-AD8EC532B5A9}.Proto|Any CPU.ActiveCfg = Proto|Any CPU
43+
{67DA0BF3-AAD3-47F4-9EC6-AD8EC532B5A9}.Proto|Any CPU.Build.0 = Proto|Any CPU
44+
{24399E68-9000-4556-BDDD-8D74A9660D28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45+
{24399E68-9000-4556-BDDD-8D74A9660D28}.Debug|Any CPU.Build.0 = Debug|Any CPU
46+
{24399E68-9000-4556-BDDD-8D74A9660D28}.Release|Any CPU.ActiveCfg = Release|Any CPU
47+
{24399E68-9000-4556-BDDD-8D74A9660D28}.Release|Any CPU.Build.0 = Release|Any CPU
48+
{24399E68-9000-4556-BDDD-8D74A9660D28}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
49+
{86E148BE-92C8-47CC-A070-11D769C6D898}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50+
{86E148BE-92C8-47CC-A070-11D769C6D898}.Debug|Any CPU.Build.0 = Debug|Any CPU
51+
{86E148BE-92C8-47CC-A070-11D769C6D898}.Release|Any CPU.ActiveCfg = Release|Any CPU
52+
{86E148BE-92C8-47CC-A070-11D769C6D898}.Release|Any CPU.Build.0 = Release|Any CPU
53+
{86E148BE-92C8-47CC-A070-11D769C6D898}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
54+
{4FFA5E03-4128-48C9-8FCD-D7C60729ED74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55+
{4FFA5E03-4128-48C9-8FCD-D7C60729ED74}.Debug|Any CPU.Build.0 = Debug|Any CPU
56+
{4FFA5E03-4128-48C9-8FCD-D7C60729ED74}.Release|Any CPU.ActiveCfg = Release|Any CPU
57+
{4FFA5E03-4128-48C9-8FCD-D7C60729ED74}.Release|Any CPU.Build.0 = Release|Any CPU
58+
{4FFA5E03-4128-48C9-8FCD-D7C60729ED74}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
59+
{DA9495E6-BEAA-42A4-AD3B-170D2005AF4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
60+
{DA9495E6-BEAA-42A4-AD3B-170D2005AF4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
61+
{DA9495E6-BEAA-42A4-AD3B-170D2005AF4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
62+
{DA9495E6-BEAA-42A4-AD3B-170D2005AF4B}.Release|Any CPU.Build.0 = Release|Any CPU
63+
{DA9495E6-BEAA-42A4-AD3B-170D2005AF4B}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
64+
{EAC029EB-4A8F-4966-9B38-60D73D8E20D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
65+
{EAC029EB-4A8F-4966-9B38-60D73D8E20D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
66+
{EAC029EB-4A8F-4966-9B38-60D73D8E20D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
67+
{EAC029EB-4A8F-4966-9B38-60D73D8E20D1}.Release|Any CPU.Build.0 = Release|Any CPU
68+
{EAC029EB-4A8F-4966-9B38-60D73D8E20D1}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
69+
EndGlobalSection
70+
GlobalSection(SolutionProperties) = preSolution
71+
HideSolutionNode = FALSE
72+
EndGlobalSection
73+
GlobalSection(ExtensibilityGlobals) = postSolution
74+
SolutionGuid = {68ED1BEB-EB1D-4334-A708-988D54C83B66}
75+
EndGlobalSection
76+
EndGlobal

FSharp.Profiles.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@
1414
</Otherwise>
1515
</Choose>
1616

17+
<PropertyGroup>
18+
<!-- Override the setting for the Arcade UserRuntimeConfig for fsc on .NET Core -->
19+
<ServerGarbageCollection>true</ServerGarbageCollection>
20+
</PropertyGroup>
1721
</Project>

0 commit comments

Comments
 (0)