Skip to content

Commit

Permalink
Use dotnet 8 feed. (#1153)
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf authored Sep 6, 2023
1 parent 5be7315 commit 1f1011a
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 35 deletions.
4 changes: 2 additions & 2 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ framework: netstandard2.0, netstandard2.1, net6.0, net7.0

source https://api.nuget.org/v3/index.json
# this is the FCS nightly feed, re-enable at your own risk!
#source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json
source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json
#source: ./libs
storage: none
strategy: min
Expand All @@ -13,7 +13,7 @@ lowest_matching: true

nuget BenchmarkDotNet 0.13.5
nuget Fantomas.Client >= 0.9
nuget FSharp.Compiler.Service >= 43.7.400
nuget FSharp.Compiler.Service >= 43.8.100-preview.23429.1
nuget Ionide.ProjInfo >= 0.62.0
nuget Ionide.ProjInfo.FCS >= 0.62.0
nuget Ionide.ProjInfo.ProjectSystem >= 0.62.0
Expand Down
23 changes: 12 additions & 11 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,12 @@ NUGET
FSharp.Compiler.Service (>= 41.0.1) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0))
FSharp.Core (>= 6.0.1) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0))
McMaster.NETCore.Plugins (>= 1.4) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net5.0)) (&& (== netstandard2.1) (>= net5.0))
FSharp.Compiler.Service (43.7.400)
FSharp.Core (7.0.400)
System.Buffers (>= 4.5.1)
System.Collections.Immutable (>= 7.0)
System.Diagnostics.DiagnosticSource (>= 7.0.2)
System.Memory (>= 4.5.5)
System.Reflection.Emit (>= 4.7)
System.Reflection.Metadata (>= 7.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
FSharp.Control.AsyncSeq (3.2.1)
FSharp.Core (>= 4.7.2)
Microsoft.Bcl.AsyncInterfaces (>= 5.0)
FSharp.Control.Reactive (5.0.5) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
FSharp.Core (>= 4.7.2)
System.Reactive (>= 5.0 < 6.0)
FSharp.Core (7.0.400)
FSharp.Data.Adaptive (1.2.13)
FSharp.Core (>= 4.7)
System.Reflection.Emit.Lightweight (>= 4.6)
Expand Down Expand Up @@ -138,7 +128,7 @@ NUGET
FSharp.Core (>= 7.0.400) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Ionide.ProjInfo.Sln (>= 0.62) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Build (>= 17.2) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Build.Framework (>= 17.6.3) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Build.Framework (>= 17.2) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
SemanticVersioning (>= 2.0.2) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Ionide.ProjInfo.FCS (0.62)
FSharp.Compiler.Service (>= 43.7.400) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Expand Down Expand Up @@ -489,6 +479,17 @@ NUGET
Expecto (>= 9.0 < 10.0) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
FSharp.Core (>= 4.6.2) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
System.Collections.Immutable (>= 6.0) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1))
remote: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json
FSharp.Compiler.Service (43.8.100-preview.23429.1)
FSharp.Core (8.0.100-beta.23429.1)
System.Buffers (>= 4.5.1)
System.Collections.Immutable (>= 7.0)
System.Diagnostics.DiagnosticSource (>= 7.0.2)
System.Memory (>= 4.5.5)
System.Reflection.Emit (>= 4.7)
System.Reflection.Metadata (>= 7.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
FSharp.Core (8.0.100-beta.23429.1)

GROUP Build
STORAGE: NONE
Expand Down
3 changes: 2 additions & 1 deletion src/FsAutoComplete.Core/AbstractClassStubGenerator.fs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ type AbstractClassData =

let private (|ExplicitCtor|_|) =
function
| SynMemberDefn.Member(SynBinding(valData = SynValData(Some({ MemberKind = SynMemberKind.Constructor }), _, _)), _) ->
| SynMemberDefn.Member(
memberDefn = SynBinding(valData = SynValData(memberFlags = Some({ MemberKind = SynMemberKind.Constructor })))) ->
Some()
| _ -> None

Expand Down
11 changes: 6 additions & 5 deletions src/FsAutoComplete.Core/CodeGeneration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -631,14 +631,14 @@ module CodeGenerationUtils =
/// We also get the range of the leading keyword to establish indent position
let (|MemberNamePlusRangeAndKeywordRange|_|) =
function
| SynBinding(valData = SynValData(Some mf, _, _); headPat = LongIdentPattern(name, range); trivia = trivia) when
| SynBinding(valData = SynValData(memberFlags = Some mf); headPat = LongIdentPattern(name, range); trivia = trivia) when
mf.MemberKind = SynMemberKind.PropertyGet
->
if name.StartsWith("get_") then
Some(name, range, trivia.LeadingKeyword.Range)
else
Some("get_" + name, range, trivia.LeadingKeyword.Range)
| SynBinding(valData = SynValData(Some mf, _, _); headPat = LongIdentPattern(name, range); trivia = trivia) when
| SynBinding(valData = SynValData(memberFlags = Some mf); headPat = LongIdentPattern(name, range); trivia = trivia) when
mf.MemberKind = SynMemberKind.PropertySet
->
if name.StartsWith("set_") then
Expand Down Expand Up @@ -852,9 +852,10 @@ module CodeGenerationUtils =

let rec (|RationalConst|) =
function
| SynRationalConst.Integer i -> string i
| SynRationalConst.Rational(numerator, denominator, _) -> sprintf "(%i/%i)" numerator denominator
| SynRationalConst.Negate(RationalConst s) -> sprintf "- %s" s
| SynRationalConst.Integer(value = i) -> string i
| SynRationalConst.Rational(numerator = numerator; denominator = denominator) ->
sprintf "(%i/%i)" numerator denominator
| SynRationalConst.Negate(rationalConst = RationalConst s) -> sprintf "- %s" s

let rec (|TypeIdent|_|) =
function
Expand Down
6 changes: 4 additions & 2 deletions src/FsAutoComplete.Core/FCSPatches.fs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ module SyntaxTreeOps =
| SynExpr.YieldOrReturnFrom(_, e, _)
| SynExpr.DoBang(e, _)
| SynExpr.Fixed(e, _)
| SynExpr.Paren(e, _, _, _) -> walkExpr e
| SynExpr.Paren(e, _, _, _)
| SynExpr.DotLambda(expr = e) -> walkExpr e

| SynExpr.NamedIndexedPropertySet(_, e1, e2, _)
| SynExpr.DotSet(e1, _, e2, _)
Expand Down Expand Up @@ -440,7 +441,8 @@ module SyntaxTreeOps =
yield! bindings ]

| SynExpr.ForEach(enumExpr = e1; bodyExpr = e2)
| SynExpr.While(whileExpr = e1; doExpr = e2) -> walkExpr e1 || walkExpr e2
| SynExpr.While(whileExpr = e1; doExpr = e2)
| SynExpr.WhileBang(whileExpr = e1; doExpr = e2) -> walkExpr e1 || walkExpr e2

| SynExpr.For(identBody = e1; toBody = e2; doBody = e3) -> walkExpr e1 || walkExpr e2 || walkExpr e3

Expand Down
2 changes: 1 addition & 1 deletion src/FsAutoComplete.Core/Lexer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module Lexer =
| _ -> defines, langVersion)

let sourceTokenizer =
FSharpSourceTokenizer(Seq.toList defines, Some "/tmp.fsx", langVersion)
FSharpSourceTokenizer(Seq.toList defines, Some "/tmp.fsx", langVersion, None)

let lineTokenizer = sourceTokenizer.CreateLineTokenizer lineStr

Expand Down
9 changes: 9 additions & 0 deletions src/FsAutoComplete.Core/ParseAndCheckResults.fs
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,14 @@ type ParseAndCheckResults
if symbol.IsPropertyGetterMethod then
Ok(typ, [], [])
else
let symbol =
// Symbol is a property with both get and set.
// Take the setter symbol in this case.
if symbol.HasGetterMethod && symbol.HasSetterMethod then
symbol.SetterMethod
else
symbol

let parms =
symbol.CurriedParameterGroups
|> Seq.map (
Expand Down Expand Up @@ -645,6 +653,7 @@ type ParseAndCheckResults
| CompletionItemKind.Argument -> 4
| CompletionItemKind.Other -> 5
| CompletionItemKind.Method(isExtension = true) -> 6
| CompletionItemKind.SuggestedName -> 7

let decls =
match filter with
Expand Down
2 changes: 0 additions & 2 deletions src/FsAutoComplete.Core/UnionPatternMatchCaseGenerator.fs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ let private clauseIsCandidateForCodeGen (cursorPos: Position) (SynMatchClause(pa
| SynPat.Null _
| SynPat.IsInst _
| SynPat.QuoteExpr _
| SynPat.DeprecatedCharRange _
| SynPat.InstanceMember _
| SynPat.FromParseError _
| SynPat.As _
Expand Down Expand Up @@ -307,7 +306,6 @@ let getWrittenCases (patMatchExpr: PatternMatchExpr) =
| SynPat.InstanceMember(_, _, _, _, _)
| SynPat.IsInst(_, _)
| SynPat.QuoteExpr(_, _)
| SynPat.DeprecatedCharRange(_, _, _)
| SynPat.ListCons _
| SynPat.FromParseError(_, _) -> false

Expand Down
24 changes: 16 additions & 8 deletions src/FsAutoComplete.Core/UntypedAstUtils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ let internal getRangesAtPosition input (r: Position) : Range list =
addIfInside attr.Range
walkExpr attr.ArgExpr

and walkTyparDecl (SynTyparDecl(attributes = AllAttrs attrs; Item2 = typar)) =
and walkTyparDecl (SynTyparDecl(attributes = AllAttrs attrs; typar = typar; intersectionConstraints = ts)) =
List.iter walkAttribute attrs
walkTypar typar
List.iter walkType ts

and walkTyparDecls (typars: SynTyparDecls) =
typars.TyparDecls |> List.iter walkTyparDecl
Expand Down Expand Up @@ -156,7 +157,6 @@ let internal getRangesAtPosition input (r: Position) : Range list =
| SynPat.Record(_, r) -> addIfInside r
| SynPat.Null(r) -> addIfInside r
| SynPat.OptionalVal(_, r) -> addIfInside r
| SynPat.DeprecatedCharRange(_, _, r) -> addIfInside r
| SynPat.InstanceMember(_, _, _, accessibility, r) -> addIfInside r
| SynPat.FromParseError(_, r) -> addIfInside r
| SynPat.As(lpat, rpat, r) ->
Expand Down Expand Up @@ -243,6 +243,9 @@ let internal getRangesAtPosition input (r: Position) : Range list =
walkType lhs
walkType rhs
| SynType.FromParseError(r) -> addIfInside r
| SynType.Intersection(typar = typar; types = ts) ->
Option.iter walkTypar typar
List.iter walkType ts

and walkClause (SynMatchClause(pat, e1, e2, r, _, _)) =
addIfInside r
Expand Down Expand Up @@ -307,7 +310,8 @@ let internal getRangesAtPosition input (r: Position) : Range list =
List.iter walkExpr es
| SynExpr.App(_, _, e1, e2, r)
| SynExpr.TryFinally(e1, e2, r, _, _, _)
| SynExpr.While(_, e1, e2, r) ->
| SynExpr.While(_, e1, e2, r)
| SynExpr.WhileBang(_, e1, e2, r) ->
addIfInside r
List.iter walkExpr [ e1; e2 ]
| SynExpr.Record(_, _, fields, r) ->
Expand Down Expand Up @@ -396,7 +400,7 @@ let internal getRangesAtPosition input (r: Position) : Range list =
walkType t
walkMemberSig sign
walkExpr e
| SynExpr.Const(SynConst.Measure(_, _, m), r) ->
| SynExpr.Const(SynConst.Measure(synMeasure = m), r) ->
addIfInside r
walkMeasure m
| SynExpr.Const(_, r) -> addIfInside r
Expand Down Expand Up @@ -436,19 +440,23 @@ let internal getRangesAtPosition input (r: Position) : Range list =
| SynExpr.Typar(t, r) ->
addIfInside r
walkTypar t
| SynExpr.DotLambda(expr = e) -> walkExpr e

and walkMeasure =
function
| SynMeasure.Product(m1, m2, r)
| SynMeasure.Divide(m1, m2, r) ->
| SynMeasure.Product(m1, _, m2, r) ->
addIfInside r
walkMeasure m1
walkMeasure m2
| SynMeasure.Divide(m1, _, m2, r) ->
addIfInside r
Option.iter walkMeasure m1
walkMeasure m2
| SynMeasure.Named(longIdent, r) -> addIfInside r
| SynMeasure.Seq(ms, r) ->
addIfInside r
List.iter walkMeasure ms
| SynMeasure.Power(m, _, r) ->
| SynMeasure.Power(measure = m; range = r) ->
addIfInside r
walkMeasure m
| SynMeasure.Var(ty, r) ->
Expand All @@ -457,7 +465,7 @@ let internal getRangesAtPosition input (r: Position) : Range list =
| SynMeasure.Paren(m, r) ->
addIfInside r
walkMeasure m
| SynMeasure.One
| SynMeasure.One _
| SynMeasure.Anon _ -> ()

and walkSimplePat =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let title = "Add missing '=' to type definition"

/// a codefix that adds in missing '=' characters in type declarations
let fix (getFileLines: GetFileLines) =
Run.ifDiagnosticByCode (Set.ofList [ "3360" ]) (fun diagnostic codeActionParams ->
Run.ifDiagnosticByCode (Set.ofList [ "10" ]) (fun diagnostic codeActionParams ->
asyncResult {
let fileName = codeActionParams.TextDocument.GetFilePath() |> Utils.normalizePath

Expand Down
4 changes: 2 additions & 2 deletions test/FsAutoComplete.Tests.Lsp/CodeFixTests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let private addMissingEqualsToTypeDefinitionTests state =
"""
type Person $0{ Name : string; Age : int; City : string }
"""
(Diagnostics.expectCode "3360")
(Diagnostics.expectCode "10")
selectCodeFix
"""
type Person = { Name : string; Age : int; City : string }
Expand All @@ -29,7 +29,7 @@ let private addMissingEqualsToTypeDefinitionTests state =
"""
type Name $0Name of string
"""
(Diagnostics.expectCode "3360")
(Diagnostics.expectCode "10")
selectCodeFix
"""
type Name = Name of string
Expand Down

0 comments on commit 1f1011a

Please sign in to comment.