Skip to content

Commit

Permalink
Merge pull request #16420 from dotnet/merges/main-to-release/dev17.9
Browse files Browse the repository at this point in the history
Merge main to release/dev17.9
  • Loading branch information
KevinRansom authored Dec 12, 2023
2 parents bb83216 + eae9846 commit 325e0af
Show file tree
Hide file tree
Showing 42 changed files with 618 additions and 171 deletions.
34 changes: 29 additions & 5 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -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
}
8 changes: 5 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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}",
Expand All @@ -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}",
Expand Down
117 changes: 108 additions & 9 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
}
Expand Down
2 changes: 0 additions & 2 deletions eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

<UsageData>
<IgnorePatterns>
<UsagePattern IdentityGlob="Microsoft.SourceBuild.Intermediate.*/*" />

<!-- Ignoring the known prebuilts. -->

<!--
Expand Down
18 changes: 16 additions & 2 deletions vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ open CancellableTasks
module Logger = Microsoft.VisualStudio.FSharp.Editor.Logger

type internal FSharpCompletionProvider
(workspace: Workspace, serviceProvider: SVsServiceProvider, assemblyContentProvider: AssemblyContentProvider) =
(
workspace: Workspace,
serviceProvider: SVsServiceProvider,
assemblyContentProvider: AssemblyContentProvider,
editorOptions: EditorOptions
) =

inherit FSharpCompletionProviderBase()

Expand Down Expand Up @@ -380,7 +385,16 @@ type internal FSharpCompletionProvider
let documentation = List()
let collector = RoslynHelpers.CollectTaggedText documentation
// mix main description and xmldoc by using one collector
XmlDocumentation.BuildDataTipText(documentationBuilder, collector, collector, collector, collector, collector, description)
XmlDocumentation.BuildDataTipText(
documentationBuilder,
collector,
collector,
collector,
collector,
collector,
description,
editorOptions.QuickInfo.ShowRemarks
)

Task.FromResult(CompletionDescription.Create(documentation.ToImmutableArray()))
| _ ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type internal FSharpCompletionService

let builtInProviders =
ImmutableArray.Create<CompletionProvider>(
FSharpCompletionProvider(workspace, serviceProvider, assemblyContentProvider),
FSharpCompletionProvider(workspace, serviceProvider, assemblyContentProvider, settings),
FSharpCommonCompletionProvider.Create(HashDirectiveCompletionProvider.Create(workspace, projectInfoManager))
)

Expand Down
32 changes: 21 additions & 11 deletions vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type SignatureHelpData =

[<Shared>]
[<Export(typeof<IFSharpSignatureHelpProvider>)>]
type internal FSharpSignatureHelpProvider [<ImportingConstructor>] (serviceProvider: SVsServiceProvider) =
type internal FSharpSignatureHelpProvider [<ImportingConstructor>] (serviceProvider: SVsServiceProvider, editorOptions: EditorOptions) =

let documentationBuilder =
XmlDocumentation.CreateDocumentationBuilder(serviceProvider.XMLMemberIndexService)
Expand All @@ -79,7 +79,8 @@ type internal FSharpSignatureHelpProvider [<ImportingConstructor>] (serviceProvi
documentationBuilder: IDocumentationBuilder,
sourceText: SourceText,
caretPosition: int,
triggerIsTypedChar: char option
triggerIsTypedChar: char option,
editorOptions: EditorOptions
) =
asyncMaybe {
let textLines = sourceText.Lines
Expand Down Expand Up @@ -206,7 +207,8 @@ type internal FSharpSignatureHelpProvider [<ImportingConstructor>] (serviceProvi
RoslynHelpers.CollectTaggedText mainDescription,
RoslynHelpers.CollectTaggedText documentation,
method.Description,
false
false,
editorOptions.QuickInfo.ShowRemarks
)

let parameters =
Expand All @@ -225,7 +227,8 @@ type internal FSharpSignatureHelpProvider [<ImportingConstructor>] (serviceProvi
documentationBuilder,
RoslynHelpers.CollectTaggedText doc,
method.XmlDoc,
p.ParameterName
p.ParameterName,
editorOptions.QuickInfo.ShowRemarks
)

p.Display |> Seq.iter (RoslynHelpers.CollectTaggedText parts)
Expand Down Expand Up @@ -292,7 +295,8 @@ type internal FSharpSignatureHelpProvider [<ImportingConstructor>] (serviceProvi
sourceText: SourceText,
caretPosition: int,
adjustedColumnInSource: int,
filePath: string
filePath: string,
editorOptions: EditorOptions
) =
asyncMaybe {
let textLine = sourceText.Lines.GetLineFromPosition(adjustedColumnInSource)
Expand Down Expand Up @@ -430,7 +434,8 @@ type internal FSharpSignatureHelpProvider [<ImportingConstructor>] (serviceProvi
typeParameterMap.Add,
usage.Add,
exceptions.Add,
tooltip
tooltip,
editorOptions.QuickInfo.ShowRemarks
)

let fsharpDocs =
Expand Down Expand Up @@ -606,7 +611,8 @@ type internal FSharpSignatureHelpProvider [<ImportingConstructor>] (serviceProvi
documentationBuilder: IDocumentationBuilder,
caretPosition: int,
triggerTypedChar: char option,
possibleCurrentSignatureHelpSessionKind: CurrentSignatureHelpSessionKind option
possibleCurrentSignatureHelpSessionKind: CurrentSignatureHelpSessionKind option,
editorOptions: EditorOptions
) =
asyncMaybe {

Expand Down Expand Up @@ -655,7 +661,8 @@ type internal FSharpSignatureHelpProvider [<ImportingConstructor>] (serviceProvi
sourceText,
caretPosition,
adjustedColumnInSource,
document.FilePath
document.FilePath,
editorOptions
)
| _, Some FunctionApplication when
adjustedColumnChar <> ','
Expand All @@ -674,7 +681,8 @@ type internal FSharpSignatureHelpProvider [<ImportingConstructor>] (serviceProvi
sourceText,
caretPosition,
adjustedColumnInSource,
document.FilePath
document.FilePath,
editorOptions
)
| _ ->
let! paramInfoLocations = parseResults.FindParameterLocations(Position.fromZ caretLinePos.Line caretLineColumn)
Expand All @@ -688,7 +696,8 @@ type internal FSharpSignatureHelpProvider [<ImportingConstructor>] (serviceProvi
documentationBuilder,
sourceText,
caretPosition,
triggerTypedChar
triggerTypedChar,
editorOptions
)
}

Expand Down Expand Up @@ -722,7 +731,8 @@ type internal FSharpSignatureHelpProvider [<ImportingConstructor>] (serviceProvi
documentationBuilder,
position,
triggerTypedChar,
possibleCurrentSignatureHelpSessionKind
possibleCurrentSignatureHelpSessionKind,
editorOptions
)

match signatureHelpDataOpt with
Expand Down
Loading

0 comments on commit 325e0af

Please sign in to comment.