From f503ae99e30188689b2ee5724b2fb969b0948711 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 11 Dec 2023 15:38:11 +0100 Subject: [PATCH] Added default dotnet-tools + additional tasks to launch them (#16409) * Added default dotnet-tools + additional tasks to launch them * Added default dotnet-tools + additional tasks to launch them --- .config/dotnet-tools.json | 34 +++++++++-- .vscode/launch.json | 8 ++- .vscode/tasks.json | 117 +++++++++++++++++++++++++++++++++++--- 3 files changed, 142 insertions(+), 17 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 506d284412a..eb5e920c2b7 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -1,12 +1,36 @@ { - "version": 1, "isRoot": true, "tools": { + "dotnet-counters": { + "commands": ["dotnet-counters"], + "version": "8.0.460601" + }, + "dotnet-dump": { + "commands": ["dotnet-dump"], + "version": "8.0.460601" + }, + "dotnet-gcdump": { + "commands": ["dotnet-gcdump"], + "version": "8.0.460601" + }, + "dotnet-sos": { + "commands": ["dotnet-sos"], + "version": "8.0.460601" + }, + "dotnet-symbol": { + "commands": ["dotnet-symbol"], + "version": "1.0.460401" + }, + "dotnet-trace": { + "commands": ["dotnet-trace"], + "version": "8.0.460601" + }, "fantomas": { - "version": "6.2.3", "commands": [ "fantomas" - ] + ], + "version": "6.2.3" } - } -} + }, + "version": 1 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 18cccaccbcb..1c0af1d324e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -21,7 +21,7 @@ "type": "coreclr", "request": "launch", // TODO: Shall we assume that it's already been built, or build it every time we debug? - "preLaunchTask": "Build (Debug)", + "preLaunchTask": "${defaultBuildTask}", // If you have changed target frameworks, make sure to update the program p "program": "${workspaceFolder}/artifacts/bin/fsi/Debug/net8.0/fsi.dll", "args": [ @@ -51,10 +51,12 @@ "type": "coreclr", "request": "launch", // TODO: Shall we assume that it's already been built, or build it every time we debug? - "preLaunchTask": "Build (Debug)", + "preLaunchTask": "${defaultBuildTask}", // If you have changed target frameworks, make sure to update the program path. "program": "${workspaceFolder}/artifacts/bin/fsc/Debug/net8.0/fsc.dll", "args": [ + "--targetprofile:netstandard", + "--simpleresolution", "${input:fscArgsPrompt}" ], "cwd": "${workspaceFolder}", @@ -77,7 +79,7 @@ "allowFastEvaluate": true }, { - "name": "Attach to a .NET process", + "name": "Attach to a .NET process with debugger", "type": "coreclr", "request": "attach", "processId": "${command:pickProcess}", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 1728f4efc97..c80b85f366a 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,6 +2,25 @@ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", + "inputs": [ + { + "id": "fscArgsPrompt", + "description": "Enter arguments for fsc", + "default": "", + "type": "promptString", + }, + { + "id": "fsiArgsPrompt", + "description": "Enter arguments for fsi", + "default": "", + "type": "promptString", + }, + { + "id": "PickProcess", + "description": "Enter process id", + "type": "promptString" + } + ], "windows": { "options": { "shell": { @@ -71,18 +90,98 @@ "problemMatcher": "$msCompile", "group": "build" }, + { + "label": "Run FSI with dotnet-trace", + "command": "dotnet", + "type": "shell", + "args": [ + "dotnet-trace", + "collect", + "--format", + "Speedscope", + "--", + "dotnet", + "${workspaceFolder}/artifacts/bin/fsi/Debug/net8.0/fsi.dll", + "${input:fsiArgsPrompt}" + ], + "problemMatcher": "$msCompile", + "group": "none" + }, + { + "label": "Run FSC with dotnet-trace", + "command": "dotnet", + "type": "shell", + "args": [ + "dotnet-trace", + "collect", + "--format", + "Speedscope", + "--", + "dotnet", + "${workspaceFolder}/artifacts/bin/fsc/Debug/net8.0/fsc.dll", + "--targetprofile:netstandard", + "--simpleresolution", + "${input:fscArgsPrompt}" + ], + "problemMatcher": "$msCompile", + "group": "none" + }, + { + "label": "Create a process dump with dotnet-dump", + "command": "dotnet", + "type": "shell", + "args": [ + "dotnet-dump", + "collect", + "--diag", + "--crashreport", + "--type", + "Full", + "--process-id", + "${input:PickProcess}", + ], + "problemMatcher": "$msCompile", + "group": "none" + }, + { + "label": "Create a process GC dump with dotnet-gcdump", + "command": "dotnet", + "type": "shell", + "args": [ + "dotnet-gcdump", + "collect", + "--process-id", + "${input:PickProcess}", + ], + "problemMatcher": "$msCompile", + "group": "none" + }, + { + "label": "Collect process counters with dotnet-counters", + "command": "dotnet", + "type": "shell", + "args": [ + "dotnet-counters", + "collect", + "--process-id", + "${input:PickProcess}", + ], + "problemMatcher": "$msCompile", + "group": "none" + }, { "label": "Update xlf files", - "command": "./build.sh", + "command": "dotnet", + "type": "shell", + "args": ["build", "-t:UpdateXlf", "src/Compiler/FSharp.Compiler.Service.fsproj"], + "problemMatcher": "$msCompile", + "group": "build" + }, + { + "label": "Run Fantomas", + "command": "dotnet", + "args": ["fantomas", "."], "type": "shell", - "windows": { - "command": "${workspaceFolder}/Build.cmd" - }, - "options": { - "env": { - "UpdateXlfOnBuild": "true" - } - }, "problemMatcher": "$msCompile", "group": "build" }