Skip to content

Commit

Permalink
Bump Deps in preparation for 8.0.400 release (#1317)
Browse files Browse the repository at this point in the history
* bump a bunch of deps

* bump tools as well

* Make our completions more structurally similar to F# in VS for comparison/drift purposes

* Update completion tests to be more precise now that FCS is returning more type members

* Fix expectation with completion item ordering

* Fix completion list length assertions due to new members

* Fix test assertion since the different TFMs can have different module member lists

* Revert LinkDotNet.StringBuilder update to see if that was cause of new exception in Utils

* bump Ionide.Analyzers as well to green up the final CI check
  • Loading branch information
baronfel authored Aug 19, 2024
1 parent 2e2fd24 commit 9f99bfe
Show file tree
Hide file tree
Showing 13 changed files with 633 additions and 612 deletions.
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
"rollForward": false
},
"dotnet-reportgenerator-globaltool": {
"version": "5.0.2",
"version": "5.3.8",
"commands": [
"reportgenerator"
],
"rollForward": false
},
"fantomas": {
"version": "6.3.1",
"version": "6.3.11",
"commands": [
"fantomas"
],
"rollForward": false
},
"fsharp-analyzers": {
"version": "0.26.0",
"version": "0.27.0",
"commands": [
"fsharp-analyzers"
],
Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
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 -->
<!-- Package Reference with no usable assets -->
<NoWarn>$(NoWarn);NU1701</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ChangelogFile>$(MSBuildThisFileDirectory)CHANGELOG.md</ChangelogFile>
<!-- Only the tool package is packable -->
Expand Down
26 changes: 11 additions & 15 deletions paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
version 7.2.1

framework: netstandard2.0, netstandard2.1, net6.0, net7.0, net8.0
framework: netstandard2.0, netstandard2.1, net6.0, net7.0, net8.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/dotnet8/nuget/v3/index.json
# source: ./libs
storage: none
strategy: min
lowest_matching: true


nuget BenchmarkDotNet 0.13.5
nuget BenchmarkDotNet
nuget Fantomas.Client >= 0.9
nuget FSharp.Compiler.Service >= 43.8.300
nuget Ionide.Analyzers 0.11.0
nuget FSharp.Analyzers.Build 0.3.0
nuget Ionide.Analyzers
nuget FSharp.Analyzers.Build
nuget Ionide.ProjInfo >= 0.65.0
nuget Ionide.ProjInfo.FCS >= 0.65.0
nuget Ionide.ProjInfo.ProjectSystem >= 0.65.0
Expand All @@ -25,8 +22,8 @@ nuget Microsoft.Build.Framework >= 17.4 copy_local:false
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.26.0
nuget Microsoft.CodeAnalysis
nuget FSharp.Analyzers.SDK
nuget ICSharpCode.Decompiler
nuget Mono.Cecil >= 0.11.4
nuget FSharpLint.Core
Expand All @@ -46,19 +43,18 @@ nuget FSharp.Data.Adaptive >= 1.2
nuget Microsoft.NET.Test.Sdk >= 17.4
nuget Dotnet.ReproducibleBuilds copy_local:true

nuget Microsoft.NETFramework.ReferenceAssemblies
nuget Ionide.KeepAChangelog.Tasks copy_local: true
nuget Expecto.Diff
nuget YoloDev.Expecto.TestSdk
nuget AltCover
nuget GitHubActionsTestLogger
nuget Ionide.LanguageServerProtocol 0.6.0
nuget Ionide.LanguageServerProtocol
nuget Microsoft.Extensions.Caching.Memory
nuget OpenTelemetry.Api >= 1.3.2
nuget OpenTelemetry.Exporter.OpenTelemetryProtocol >= 1.3.2 # 1.4 bumps to 7.0 versions of System.Diagnostics libs, so can't use it
nuget OpenTelemetry.Instrumentation.Runtime
nuget LinkDotNet.StringBuilder 1.18.0
nuget LinkDotNet.StringBuilder
nuget CommunityToolkit.HighPerformance
nuget System.Security.Cryptography.Pkcs 6.0.4
nuget System.Net.Http 4.3.4 # pinned for security reasons
nuget System.Text.RegularExpressions 4.3.1 # pinned for security reasons
nuget System.Security.Cryptography.Pkcs
nuget System.Net.Http
nuget System.Text.RegularExpressions
901 changes: 481 additions & 420 deletions paket.lock

Large diffs are not rendered by default.

151 changes: 50 additions & 101 deletions src/FsAutoComplete.Core/ParseAndCheckResults.fs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ type ParseAndCheckResults
| None -> ResultOrString.Error "No symbol information found"
| Some hlp -> Ok hlp

member x.TryGetCompletions (pos: Position) (lineStr: LineStr) filter (getAllSymbols: unit -> AssemblySymbol list) =
member x.TryGetCompletions (pos: Position) (lineStr: LineStr) (getAllSymbols: unit -> AssemblySymbol list) =
async {
let completionContext = Completion.atPos (pos, x.GetParseResults.ParseTree)

Expand All @@ -614,123 +614,72 @@ type ParseAndCheckResults
try
let longName = QuickParse.GetPartialLongNameEx(lineStr, pos.Column - 1)

let residue = longName.PartialIdent

logger.info (
Log.setMessage "TryGetCompletions - lineStr: {lineStr}"
>> Log.addContextDestructured "lineStr" lineStr
)

logger.info (
Log.setMessage "TryGetCompletions - long name: {longName}"
>> Log.addContextDestructured "longName" longName
)

let getSymbols () =
getAllSymbols ()
|> List.filter (fun entity ->
// Attempt to filter to types when we know we're in a type and FCS uses all symbols
(completionContext <> Completion.Context.SynType
|| entity.Kind LookupType.Fuzzy = EntityKind.Type)
&& entity.FullName.Contains "."
&& not (PrettyNaming.IsOperatorDisplayName entity.Symbol.DisplayName))

let token =
Lexer.getSymbol (uint32 pos.Line) (uint32 pos.Column - 1u) lineStr SymbolLookupKind.ForCompletion [||]

logger.info (
Log.setMessage "TryGetCompletions - token: {token}"
>> Log.addContextDestructured "token" token
)

let isEmpty =
longName.QualifyingIdents.IsEmpty
&& String.IsNullOrWhiteSpace longName.PartialIdent
&& longName.LastDotPos.IsNone

match token with
| Some k when k.Kind = Other && not isEmpty -> return None
| Some k when k.Kind = Operator -> return None
| Some k when k.Kind = Keyword -> return None
| _ ->
let fcsCompletionContext =
ParsedInput.TryGetCompletionContext(pos, x.GetParseResults.ParseTree, lineStr)

let results =
checkResults.GetDeclarationListInfo(
Some parseResults,
pos.Line,
lineStr,
longName,
getAllEntities = getSymbols,
completionContextAtPos = (pos, fcsCompletionContext)
)

let getKindPriority =
function
| CompletionItemKind.CustomOperation -> -1
| CompletionItemKind.Property -> 0
| CompletionItemKind.Field -> 1
| CompletionItemKind.Method(isExtension = false) -> 2
| CompletionItemKind.Event -> 3
| CompletionItemKind.Argument -> 4
| CompletionItemKind.Other -> 5
| CompletionItemKind.Method(isExtension = true) -> 6
| CompletionItemKind.SuggestedName -> 7

let decls =
match filter with
| Some "StartsWith" ->
results.Items
|> Array.filter (fun d -> d.NameInList.StartsWith(residue, StringComparison.InvariantCultureIgnoreCase))
| Some "Contains" ->
results.Items
|> Array.filter (fun d ->
d.NameInList.IndexOf(residue, StringComparison.InvariantCultureIgnoreCase) >= 0)
| _ -> results.Items

let sortedDecls =
decls
|> Array.sortWith (fun x y ->
let transformKind (item: DeclarationListItem) =
if item.Kind = CompletionItemKind.Field && item.Glyph = FSharpGlyph.Method then
CompletionItemKind.Method false
elif item.Kind = CompletionItemKind.Argument && item.Glyph = FSharpGlyph.Property then
CompletionItemKind.Property
else
item.Kind
[ for assemblySymbol in getAllSymbols () do
if
assemblySymbol.FullName.Contains(".")
&& not (PrettyNaming.IsOperatorDisplayName assemblySymbol.Symbol.DisplayName)
then
yield assemblySymbol ]

let fcsCompletionContext =
ParsedInput.TryGetCompletionContext(pos, x.GetParseResults.ParseTree, lineStr)

let results =
checkResults.GetDeclarationListInfo(
Some parseResults,
pos.Line,
lineStr,
longName,
getAllEntities = getSymbols,
completionContextAtPos = (pos, fcsCompletionContext)
)

let mutable n = (not x.IsResolved).CompareTo(not y.IsResolved)
let getKindPriority kind =
match kind with
| CompletionItemKind.SuggestedName
| CompletionItemKind.CustomOperation -> 0
| CompletionItemKind.Property -> 1
| CompletionItemKind.Field -> 2
| CompletionItemKind.Method(isExtension = false) -> 3
| CompletionItemKind.Event -> 4
| CompletionItemKind.Argument -> 5
| CompletionItemKind.Other -> 6
| CompletionItemKind.Method(isExtension = true) -> 7

Array.sortInPlaceWith
(fun (x: DeclarationListItem) (y: DeclarationListItem) ->
let mutable n = (not x.IsResolved).CompareTo(not y.IsResolved)

if n <> 0 then
n
else
n <- (getKindPriority x.Kind).CompareTo(getKindPriority y.Kind)

if n <> 0 then
n
else
n <-
(getKindPriority <| transformKind x)
.CompareTo(getKindPriority <| transformKind y)
n <- (not x.IsOwnMember).CompareTo(not y.IsOwnMember)

if n <> 0 then
n
else
n <- (not x.IsOwnMember).CompareTo(not y.IsOwnMember)
n <- String.Compare(x.NameInList, y.NameInList, StringComparison.OrdinalIgnoreCase)

if n <> 0 then
n
else
n <- StringComparer.OrdinalIgnoreCase.Compare(x.NameInList, y.NameInList)
x.MinorPriority.CompareTo(y.MinorPriority))
results.Items

if n <> 0 then
n
else
x.MinorPriority.CompareTo(y.MinorPriority))

let shouldKeywords =
sortedDecls.Length > 0
&& not results.IsForType
&& not results.IsError
&& List.isEmpty longName.QualifyingIdents
let shouldKeywords =
results.Items.Length > 0
&& not results.IsForType
&& not results.IsError
&& List.isEmpty longName.QualifyingIdents

return Some(sortedDecls, residue, shouldKeywords)
return Some(results.Items, longName.PartialIdent, shouldKeywords)
with :? TimeoutException ->
return None
}
Expand Down
1 change: 0 additions & 1 deletion src/FsAutoComplete.Core/ParseAndCheckResults.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ type ParseAndCheckResults =
member TryGetCompletions:
pos: Position ->
lineStr: LineStr ->
filter: string option ->
getAllSymbols: (unit -> AssemblySymbol list) ->
Async<(DeclarationListItem array * string * bool) option>

Expand Down
1 change: 0 additions & 1 deletion src/FsAutoComplete.Core/paket.references
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FSharp.Analyzers.SDK
ICSharpCode.Decompiler
Microsoft.SourceLink.GitHub
FSharp.UMX
FsToolkit.ErrorHandling.TaskResult
Fantomas.Client
Expand Down
1 change: 0 additions & 1 deletion src/FsAutoComplete.Logging/paket.references
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FSharp.Core

Microsoft.NETFramework.ReferenceAssemblies
Ionide.KeepAChangelog.Tasks
Ionide.Analyzers
FSharp.Analyzers.Build
2 changes: 1 addition & 1 deletion src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ type AdaptiveFSharpLspServer

let! (decls, residue, shouldKeywords) =
Debug.measure "TextDocumentCompletion.TryGetCompletions" (fun () ->
typeCheckResults.TryGetCompletions pos lineStr None getAllSymbols
typeCheckResults.TryGetCompletions pos lineStr getAllSymbols
|> AsyncResult.ofOption (fun () -> "No TryGetCompletions results"))

do! Result.requireNotEmpty "Should not have empty completions" decls
Expand Down
2 changes: 0 additions & 2 deletions src/FsAutoComplete/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ ICSharpCode.Decompiler
Ionide.KeepAChangelog.Tasks
Ionide.LanguageServerProtocol
Ionide.ProjInfo.ProjectSystem
Microsoft.NETFramework.ReferenceAssemblies
Microsoft.SourceLink.GitHub
Serilog.Sinks.Async
Serilog.Sinks.Console
Serilog.Sinks.File
Expand Down
Loading

0 comments on commit 9f99bfe

Please sign in to comment.