Skip to content

Commit

Permalink
Merge nightly for 8.0.300 (#1294)
Browse files Browse the repository at this point in the history
Merge the nightly branch into main now that there is a new stable FCS
version
  • Loading branch information
baronfel authored May 14, 2024
2 parents 8b1eb5a + d805ef3 commit 261d5bd
Show file tree
Hide file tree
Showing 109 changed files with 4,591 additions and 2,435 deletions.
6 changes: 6 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
"commands": [
"fsharp-analyzers"
]
},
"telplin": {
"version": "0.9.6",
"commands": [
"telplin"
]
}
}
}
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ indent_size = 2
fsharp_max_array_or_list_width=80
fsharp_max_dot_get_expression_width=80
fsharp_max_function_binding_width=80
fsharp_max_value_binding_width=80
fsharp_max_value_binding_width=80

[src/FsAutoComplete/CodeFixes/*.fs]
fsharp_experimental_keep_indent_in_branch = true
20 changes: 14 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ jobs:
- macos-13 # using 13 because it's a bigger machine, and latest is still pointing to 12
- ubuntu-latest
dotnet-version: ["", "6.0.x", "7.0.x", "8.0.x"]
use-transparent-compiler:
- "TransparentCompiler"
- "BackgroundCompiler"
workspace-loader:
- "WorkspaceLoader"
# - "ProjectGraph" # this is disable because it just adds too much time to the build
# these entries will mesh with the above combinations
include:
# just use what's in the repo
Expand Down Expand Up @@ -61,18 +67,18 @@ jobs:

runs-on: ${{ matrix.os }}

name: Build on ${{matrix.os}} for ${{ matrix.label }}
name: Build on ${{matrix.os}} for ${{ matrix.label }} ${{ matrix.workspace-loader }} ${{ matrix.use-transparent-compiler }}

steps:
- uses: actions/checkout@v3

# setup .NET per the repo global.json
- name: Setup .NET
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v3

# setup .NET per test session
- name: Setup .NET
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v3
with:
include-prerelease: ${{ matrix.include-prerelease }}
global-json-file: ${{ matrix.global-json-file }}
Expand All @@ -96,8 +102,8 @@ jobs:
DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1

# Ensure the scaffolding code can still add items to the existing code.
- name: EnsureCanScaffoldCodeFix
run: dotnet fsi build.fsx -- -p EnsureCanScaffoldCodeFix
# - name: EnsureCanScaffoldCodeFix
# run: dotnet fsi build.fsx -- -p EnsureCanScaffoldCodeFix

- name: Run Build
run: dotnet build -c Release
Expand All @@ -106,11 +112,13 @@ jobs:
BuildNet8: ${{ matrix.build_net8 }}

- name: Run and report tests
run: dotnet test -c Release -f ${{ matrix.test_tfm }} --no-restore --no-build --no-build --logger GitHubActions /p:AltCover=true /p:AltCoverAssemblyExcludeFilter="System.Reactive|FSharp.Compiler.Service|Ionide.ProjInfo|FSharp.Analyzers|Analyzer|Humanizer|FSharp.Core|FSharp.DependencyManager" -- Expecto.fail-on-focused-tests=true --blame-hang --blame-hang-timeout 1m
run: dotnet test -c Release -f ${{ matrix.test_tfm }} --no-restore --no-build --logger "console;verbosity=normal" --logger GitHubActions /p:AltCover=true /p:AltCoverAssemblyExcludeFilter="System.Reactive|FSharp.Compiler.Service|Ionide.ProjInfo|FSharp.Analyzers|Analyzer|Humanizer|FSharp.Core|FSharp.DependencyManager" -- Expecto.fail-on-focused-tests=true --blame-hang --blame-hang-timeout 1m
working-directory: test/FsAutoComplete.Tests.Lsp
env:
BuildNet7: ${{ matrix.build_net7 }}
BuildNet8: ${{ matrix.build_net8 }}
USE_TRANSPARENT_COMPILER: ${{ matrix.use-transparent-compiler }}
USE_WORKSPACE_LOADER: ${{ matrix.workspace-loader }}

analyze:
runs-on: ubuntu-latest
Expand Down
30 changes: 27 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,31 @@
"--filter",
"FSAC.lsp.${input:loader}.${input:lsp-server}.${input:testName}"
]
},
{
"name": "Pick General tests",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/test/FsAutoComplete.Tests.Lsp/bin/Debug/${input:tfm}/FsAutoComplete.Tests.Lsp.dll",
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"stopAtEntry": false,
"justMyCode": false,
"symbolOptions": {
"searchMicrosoftSymbolServer": true,
"searchNuGetOrgSymbolServer": true
},
"sourceLinkOptions": {
"*": {
"enabled": true
}
},
"enableStepFiltering": false,
"args": [
"--debug",
"--filter",
"FSAC.general.${input:testName}"
]
}
],
"inputs": [
Expand All @@ -77,7 +102,6 @@
"default": "WorkspaceLoader",
"type": "pickString"
},

{
"id": "lsp-server",
"description": "The lsp serrver",
Expand All @@ -86,12 +110,12 @@
"AdaptiveLspServer"
],
"default": "AdaptiveLspServer",
"type": "pickString"
"type": "pickString",
},
{
"id": "testName",
"description": "the name of the test as provided to `testCase`",
"type": "promptString"
}
]
}
}
4 changes: 3 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<NoWarn>$(NoWarn);3186,0042</NoWarn><!-- circumvent an error with the fake dependencymanager for
paket: https://github.com/dotnet/fsharp/issues/8678 -->
<NoWarn>$(NoWarn);NU1902</NoWarn><!-- NU1902 - package vulnerability detected -->
<WarnOn>$(WarnOn);1182</WarnOn> <!-- Unused variables,https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-options#opt-in-warnings -->
<NoWarn>$(NoWarn);57</NoWarn> <!-- Enable experimental compiler features -->
<WarnOn Condition="'$(Configuration)' != 'Debug'">$(WarnOn);1182</WarnOn> <!-- Unused
variables,https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-options#opt-in-warnings -->
<NoWarn>$(NoWarn);FS0044</NoWarn> <!-- Ignore deprecations -->
<WarnOn>$(WarnOn);3390</WarnOn><!-- Malformed XML doc comments -->
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ To export traces, run [Jaeger](https://www.jaegertracing.io/)

```bash
docker run -d --name jaeger \
-e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
-e COLLECTOR_ZIPKIN_HOST_PORT=9411 \
-e COLLECTOR_OTLP_ENABLED=true \
-p 6831:6831/udp \
-p 6832:6832/udp \
Expand Down
70 changes: 29 additions & 41 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,48 +45,13 @@ module ScaffoldCodeFix =
open FSharp.Compiler.Symbols
open FSharp.Compiler.Syntax
open FSharp.Compiler.Text
open FsToolkit.ErrorHandling
open Ionide.LanguageServerProtocol.Types
open FsAutoComplete.CodeFix.Types
open FsAutoComplete
open FsAutoComplete.LspHelpers
// The syntax tree can be an intimidating set of types to work with.
// It is a tree structure but it consists out of many different types.
// See https://fsharp.github.io/fsharp-compiler-docs/reference/fsharp-compiler-syntax.html
// It can be useful to inspect a syntax tree via a code sample using https://fsprojects.github.io/fantomas-tools/#/ast
// For example `let a b c = ()` in
// https://fsprojects.github.io/fantomas-tools/#/ast?data=N4KABGBEAmCmBmBLAdrAzpAXFSAacUiaAYmolmPAIYA2as%%2BEkAxgPZwWQ2wAuYVYAEZhmYALxgAFAEo8BSLAAeAByrJoFHgCcArrBABfIA
// Let's say we want to find the (FCS) range for identifier `a`.
let visitSyntaxTree
(cursor: FSharp.Compiler.Text.pos)
(tree: ParsedInput)
=
// We will use a syntax visitor to traverse the tree from the top to the node of interest.
// See https://github.com/dotnet/fsharp/blob/main/src/Compiler/Service/ServiceParseTreeWalk.fsi
// We implement the different members of interest and allow the default traversal to move to the lower levels we care about.
let visitor =
// A visitor will report the first item it finds.
// Think of it as `List.tryPick`
// It is not an ideal solution to find all nodes inside a tree, be aware of that.
// For example finding all function names.
{{ new SyntaxVisitorBase<FSharp.Compiler.Text.range>() with
// We know that `a` will be part of a `SynPat.LongIdent`
// This was visible in the online tool.
member _.VisitPat(path, defaultTraverse, synPat) =
match synPat with
| SynPat.LongIdent(longDotId = SynLongIdent(id = [ functionNameIdent ])) ->
// When our code fix operates on the user's code there is no way of knowing what will be inside the syntax tree.
// So we need to be careful and verify that the pattern is indeed matching the position of the cursor.
if FSharp.Compiler.Text.Range.rangeContainsPos functionNameIdent.idRange cursor then
Some functionNameIdent.idRange
else
None
| _ -> None }}
// Invoke the visitor and kick off the traversal.
SyntaxTraversal.Traverse(cursor, tree, visitor)
// TODO: add proper title for code fix
let title = "%s{codeFixName} Codefix"
Expand All @@ -105,9 +70,29 @@ let fix
let! (parseAndCheckResults:ParseAndCheckResults, line:string, sourceText:IFSACSourceText) =
getParseResultsForFile fileName fcsPos
// As an example, we want to check whether the users cursor is inside a function definition name.
// We will traverse the syntax tree to verify this is the case.
match visitSyntaxTree fcsPos parseAndCheckResults.GetParseResults.ParseTree with
// The syntax tree can be an intimidating set of types to work with.
// It is a tree structure but it consists out of many different types.
// See https://fsharp.github.io/fsharp-compiler-docs/reference/fsharp-compiler-syntax.html
// It can be useful to inspect a syntax tree via a code sample using https://fsprojects.github.io/fantomas-tools/#/ast
// For example `let a b c = ()` in
// https://fsprojects.github.io/fantomas-tools/#/ast?data=N4KABGBEAmCmBmBLAdrAzpAXFSAacUiaAYmolmPAIYA2as%%2BEkAxgPZwWQ2wAuYVYAEZhmYALxgAFAEo8BSLAAeAByrJoFHgCcArrBABfIA
// Let's say we want to find the (FCS) range for identifier `a` if the user's cursor is inside the function name.
// We will query the syntax tree to verify this is the case.
let maybeFunctionNameRange =
(fcsPos, parseAndCheckResults.GetParseResults.ParseTree)
||> ParsedInput.tryPick (fun _path node ->
match node with
// We know that `a` will be part of a `SynPat.LongIdent`
// This was visible in the online tool.
| SyntaxNode.SynPat(SynPat.LongIdent(longDotId = SynLongIdent(id = [ functionNameIdent ]))) when
// When our code fix operates on the user's code there is no way of knowing what will be inside the syntax tree.
// So we need to be careful and verify that the pattern is indeed matching the position of the cursor.
Range.rangeContainsPos functionNameIdent.idRange fcsPos
->
Some functionNameIdent.idRange
| _ -> None)
match maybeFunctionNameRange with
| None ->
// The cursor is not in a position we are interested in.
// This code fix should not trigger any suggestions so we return an empty list.
Expand Down Expand Up @@ -367,8 +352,11 @@ let tests state =

let appNode =
match testBinding.Expr with
| Expr.App appNode -> appNode
| e -> failwithf $"Expected Expr.App, got %A{e}"
| Expr.InfixApp infixApp ->
match infixApp.RightHandSide with
| Expr.App appNode -> appNode
| e -> failwithf $"Expected Expr.App, got %A{e}"
| e -> failwithf $"Expected Expr.InfixApp, got %A{e}"

findArrayOrListOfFail (List.last appNode.Arguments)

Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "7.0.400",
"rollForward": "major",
"rollForward": "latestMajor",
"allowPrerelease": true
}
}
}
6 changes: 3 additions & 3 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ lowest_matching: true

nuget BenchmarkDotNet 0.13.5
nuget Fantomas.Client >= 0.9
nuget FSharp.Compiler.Service >= 43.8.200
nuget FSharp.Compiler.Service >= 43.8.300
nuget Ionide.Analyzers 0.10.0
nuget FSharp.Analyzers.Build 0.3.0
nuget Ionide.ProjInfo >= 0.64.0
Expand All @@ -26,7 +26,7 @@ nuget Microsoft.Build.Utilities.Core >= 17.4 copy_local:false
nuget Microsoft.Build.Tasks.Core >= 17.4 copy_local: false
nuget Nuget.Frameworks >= 6.3 copy_local: false
nuget Microsoft.CodeAnalysis 4.5.0
nuget FSharp.Analyzers.SDK 0.25.0
# nuget FSharp.Analyzers.SDK # disabled because it conflicts with the floating FCS dependency
nuget ICSharpCode.Decompiler
nuget Mono.Cecil >= 0.11.4
nuget FSharpLint.Core
Expand All @@ -38,7 +38,7 @@ nuget Destructurama.FSharp
nuget FSharp.UMX >= 1.1
nuget FSharp.Formatting >= 14.0
nuget FsToolkit.ErrorHandling.TaskResult >= 4.4 framework: netstandard2.1 ,net6.0, net7.0, net8.0
nuget IcedTasks >= 0.9.2
nuget IcedTasks >= 0.11.5
nuget FSharpx.Async >= 1.14
nuget CliWrap >= 3.0
nuget System.CommandLine prerelease
Expand Down
25 changes: 7 additions & 18 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,8 @@ NUGET
FParsec (1.1.1) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0))
FSharp.Core (>= 4.3.4)
FSharp.Analyzers.Build (0.3)
FSharp.Analyzers.SDK (0.25)
FSharp.Compiler.Service (43.8.200) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
FSharp.Core (8.0.200) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
McMaster.NETCore.Plugins (>= 1.4) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Extensions.Logging.Abstractions (>= 6.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
FSharp.Compiler.Service (43.8.200)
FSharp.Core (8.0.200)
FSharp.Compiler.Service (43.8.300)
FSharp.Core (8.0.300)
System.Buffers (>= 4.5.1)
System.Collections.Immutable (>= 7.0)
System.Diagnostics.DiagnosticSource (>= 7.0.2)
Expand All @@ -76,7 +71,7 @@ NUGET
FSharp.Control.Reactive (5.0.5) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
FSharp.Core (>= 4.7.2)
System.Reactive (>= 5.0 < 6.0)
FSharp.Core (8.0.200)
FSharp.Core (8.0.300)
FSharp.Data.Adaptive (1.2.13)
FSharp.Core (>= 4.7)
System.Reflection.Emit.Lightweight (>= 4.6)
Expand Down Expand Up @@ -125,8 +120,9 @@ NUGET
Grpc.Core.Api (>= 2.51)
Humanizer.Core (2.14.1)
Iced (1.17)
IcedTasks (0.9.2)
IcedTasks (0.11.5)
FSharp.Core (>= 6.0.1)
Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0)
ICSharpCode.Decompiler (7.2.1.6856)
Microsoft.Win32.Registry (>= 5.0)
System.Collections.Immutable (>= 5.0)
Expand Down Expand Up @@ -157,9 +153,6 @@ NUGET
Newtonsoft.Json (>= 13.0.1) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Ionide.ProjInfo.Sln (0.64)
LinkDotNet.StringBuilder (1.18)
McMaster.NETCore.Plugins (1.4) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.DotNet.PlatformAbstractions (>= 3.1.6) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp2.1)) (&& (== netstandard2.1) (>= netcoreapp2.1))
Microsoft.Extensions.DependencyModel (>= 5.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp2.1)) (&& (== netstandard2.1) (>= netcoreapp2.1))
MessagePack (2.5.108)
MessagePack.Annotations (>= 2.5.108)
Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net7.0) (< net6.0)) (&& (== net8.0) (< net6.0)) (== netstandard2.0) (== netstandard2.1)
Expand Down Expand Up @@ -277,12 +270,6 @@ NUGET
Microsoft.Extensions.DependencyInjection.Abstractions (6.0)
Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net461)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461))
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net461)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461))
Microsoft.Extensions.DependencyModel (6.0) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
System.Buffers (>= 4.5.1)
System.Memory (>= 4.5.4)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Text.Encodings.Web (>= 6.0)
System.Text.Json (>= 6.0)
Microsoft.Extensions.Logging (6.0)
Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< netstandard2.1)) (&& (== net8.0) (>= net461)) (&& (== net8.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461))
Microsoft.Extensions.DependencyInjection (>= 6.0)
Expand All @@ -291,6 +278,8 @@ NUGET
Microsoft.Extensions.Options (>= 6.0)
System.Diagnostics.DiagnosticSource (>= 6.0)
Microsoft.Extensions.Logging.Abstractions (6.0.2)
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< net6.0)) (&& (== net8.0) (>= net461)) (&& (== net8.0) (< net6.0)) (== netstandard2.0) (== netstandard2.1)
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net7.0) (>= net461)) (&& (== net7.0) (< net6.0)) (&& (== net8.0) (>= net461)) (&& (== net8.0) (< net6.0)) (== netstandard2.0) (== netstandard2.1)
Microsoft.Extensions.Logging.Configuration (6.0)
Microsoft.Extensions.Configuration (>= 6.0)
Microsoft.Extensions.Configuration.Abstractions (>= 6.0)
Expand Down
Loading

0 comments on commit 261d5bd

Please sign in to comment.