Skip to content

Commit

Permalink
Merge branch 'main' into allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
baronfel authored Jul 28, 2023
2 parents 2717429 + d215e76 commit c513223
Show file tree
Hide file tree
Showing 24 changed files with 463 additions and 456 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Changelog


## [0.61.1] - 2023-07-22

### Fixed

* [Reduce project option duplication, reducing memory usage](https://github.com/fsharp/FsAutoComplete/pull/1147) (thanks @TheAngryByrd!)


## [0.61.0] - 2023-07-16

### Added

* [Codefix: Add codefix for redundant attribute suffix.](https://github.com/fsharp/FsAutoComplete/pull/1132) (thanks @nojaf!)
* [Add module to SemanticTokenTypes](https://github.com/fsharp/FsAutoComplete/pull/1137) (thanks @nojaf!)
* [Codefix: Add type annotations to entire function](https://github.com/fsharp/FsAutoComplete/pull/1138) (thanks @nojaf!)
* [Codefix: RemovePatternArgument quick fix](https://github.com/fsharp/FsAutoComplete/pull/1142) (thanks @edgarfgp!)
* [Codefix: for interpolated string](https://github.com/fsharp/FsAutoComplete/pull/1143), [fix #1](https://github.com/fsharp/FsAutoComplete/pull/1146) (thanks @nojaf!)

### Changed

* [Swap maybe for option CEs](https://github.com/fsharp/FsAutoComplete/pull/1131) (thanks @TheAngryByrd!)

### Fixed

* [Make ServerProgressReport threadsafe](https://github.com/fsharp/FsAutoComplete/pull/1130) (thanks @TheAngryByrd!)
* [Fix range handling for code completion in interpolated strings](https://github.com/fsharp/FsAutoComplete/pull/1133) (thanks @kojo12228!)
* [Fixing Typos](https://github.com/fsharp/FsAutoComplete/pull/1136) (thanks @TheAngryByrd!)
* [FSAC Not exiting on macos/linux](https://github.com/fsharp/FsAutoComplete/pull/1141) (thanks @TheAngryByrd!)
* [CI not failing on focused tests](https://github.com/fsharp/FsAutoComplete/pull/1145) (thanks @TheAngryByrd!)

### Removed

* [Remove old eventlistener](https://github.com/fsharp/FsAutoComplete/pull/1134) (thanks @TheAngryByrd!)

## [0.60.1] - 2023-07-01

### Added
Expand Down
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Contributing


## Release

1. Update version in CHANGELOG.md and add notes
1. If possible link the pull request of the changes and mention the author of the pull request
2. Create new commit
1. `git add CHANGELOG.md`
1. `git commit -m "changelog for v0.45.0"`
3. Make a new version tag (for example, `v0.45.0`)
1. `git tag v0.45.0`
4. Push changes to the repo.
1. `git push --atomic [insert-remote-branch] main v0.45.0`
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<Title>FsAutoComplete</Title>
<Product>FsAutoComplete</Product>
<PackageLicenseExpression Condition=" '$(PackAsTool)' != 'true' ">Apache-2.0</PackageLicenseExpression>
<NoWarn>3186,0042</NoWarn><!-- circumvent an error with the fake dependencymanager for paket: https://github.com/dotnet/fsharp/issues/8678 -->
<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 -->
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ChangelogFile>$(MSBuildThisFileDirectory)CHANGELOG.md</ChangelogFile>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ nuget Expecto.Diff
nuget YoloDev.Expecto.TestSdk
nuget AltCover
nuget GitHubActionsTestLogger
nuget Ionide.LanguageServerProtocol >= 0.4.12
nuget Ionide.LanguageServerProtocol >= 0.4.16
nuget Microsoft.Extensions.Caching.Memory
nuget OpenTelemetry.Exporter.OpenTelemetryProtocol >= 1.3.2
nuget LinkDotNet.StringBuilder 1.18.0
Expand Down
2 changes: 1 addition & 1 deletion paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ NUGET
System.Collections.Immutable (>= 5.0)
System.Reflection.Metadata (>= 5.0)
Ionide.KeepAChangelog.Tasks (0.1.8) - copy_local: true
Ionide.LanguageServerProtocol (0.4.14)
Ionide.LanguageServerProtocol (0.4.17)
FSharp.Core (>= 6.0)
Newtonsoft.Json (>= 13.0.1)
StreamJsonRpc (>= 2.10.44)
Expand Down
6 changes: 3 additions & 3 deletions src/FsAutoComplete.Core/Commands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ module Commands =
}

let docForText (lines: IFSACSourceText) (tyRes: ParseAndCheckResults) : Document =
{ LineCount = lines.Lines.Length
{ LineCount = lines.GetLineCount()
FullName = tyRes.FileName // from the compiler, assumed safe
GetText = fun _ -> string lines
GetLineText0 = fun i -> (lines :> ISourceText).GetLineString i
Expand Down Expand Up @@ -1351,7 +1351,7 @@ type Commands
state.Files.[file] <-
{ LastTouched = DateTime.Now
Source = text
Version = None }
Version = 0 }

Some text
| None -> None
Expand Down Expand Up @@ -1697,7 +1697,7 @@ type Commands
}

scriptFileProjectOptions.Trigger projectOptions
state.AddFileTextAndCheckerOptions(file, text, projectOptions, Some version)
state.AddFileTextAndCheckerOptions(file, text, projectOptions, version)
fileStateSet.Trigger()
return Some projectOptions
| None ->
Expand Down
6 changes: 2 additions & 4 deletions src/FsAutoComplete.Core/FileSystem.fs
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,6 @@ module RoslynSourceText =
let combineValues (values: seq<'T>) =
(0, values) ||> Seq.fold (fun hash value -> combine (value.GetHashCode()) hash)

let weakTable = ConditionalWeakTable<SourceText, IFSACSourceText>()

let rec create (fileName: string<LocalPath>, sourceText: SourceText) : IFSACSourceText =

let walk
Expand Down Expand Up @@ -758,7 +756,7 @@ type RoslynSourceTextFactory() =
type VolatileFile =
{ LastTouched: DateTime
Source: IFSACSourceText
Version: int option }
Version: int }

member this.FileName = this.Source.FileName

Expand All @@ -775,7 +773,7 @@ type VolatileFile =


/// <summary>Helper method to create a VolatileFile</summary>
static member Create(source: IFSACSourceText, ?version: int, ?touched: DateTime) =
static member Create(source: IFSACSourceText, version: int, ?touched: DateTime) =
let touched =
match touched with
| Some t -> t
Expand Down
2 changes: 1 addition & 1 deletion src/FsAutoComplete.Core/InlayHints.fs
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ let provideHints
let line, _ = Position.toZ endPosForMethod

let afterParenPosInLine =
getFirstPositionAfterParen (text.Lines.[line].ToString()) (endPosForMethod.Column)
getFirstPositionAfterParen (text.GetLineString(line)) (endPosForMethod.Column)

let tupledParamInfos =
parseAndCheck.GetParseResults.FindParameterLocations(Position.fromZ line afterParenPosInLine)
Expand Down
6 changes: 3 additions & 3 deletions src/FsAutoComplete.Core/SignatureHelp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type SignatureHelpInfo =
/// if present, the index of the method we think is the current one (will never be outside the bounds of the Methods array)
ActiveOverload: int option
/// if present, the index of the parameter on the active method (will never be outside the bounds of the Parameters array on the selected method)
ActiveParameter: int option
ActiveParameter: uint option
SigHelpKind: SignatureHelpKind
}

Expand Down Expand Up @@ -116,7 +116,7 @@ let private getSignatureHelpForFunctionApplication
tyRes.GetCheckResults.GetMethods(symbolStart.Line, symbolUse.Range.EndColumn, symbolStartLineText, None)

return
{ ActiveParameter = Some argumentIndex
{ ActiveParameter = Some(uint argumentIndex)
Methods = methods.Methods
ActiveOverload = None
SigHelpKind = FunctionApplication }
Expand Down Expand Up @@ -202,7 +202,7 @@ let private getSignatureHelpForMethod


return
{ ActiveParameter = Some argumentIndex
{ ActiveParameter = Some(uint argumentIndex)
Methods = filteredMethods
ActiveOverload = methodCandidate
SigHelpKind = MethodCall }
Expand Down
6 changes: 3 additions & 3 deletions src/FsAutoComplete.Core/State.fs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ type State =
x.Files.[file] <-
{ Source = text
LastTouched = DateTime.Now
Version = None }
Version = 0 }

opts)

Expand All @@ -209,14 +209,14 @@ type State =
|> Seq.map (fun (s, proj: FSharpProjectOptions) -> s, LanguageVersionShim.fromFSharpProjectOptions proj)

member x.TryGetFileVersion(file: string<LocalPath>) : int option =
x.Files.TryFind file |> Option.bind (fun f -> f.Version)
x.Files.TryFind file |> Option.map (fun f -> f.Version)

member x.TryGetLastCheckedVersion(file: string<LocalPath>) : int option = x.LastCheckedVersion.TryFind file

member x.SetFileVersion (file: string<LocalPath>) (version: int) =
x.Files.TryFind file
|> Option.iter (fun n ->
let fileState = { n with Version = Some version }
let fileState = { n with Version = version }
x.Files.[file] <- fileState)

member x.SetLastCheckedVersion (file: string<LocalPath>) (version: int) = x.LastCheckedVersion.[file] <- version
Expand Down
2 changes: 1 addition & 1 deletion src/FsAutoComplete/CodeFixes/ToInterpolatedString.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let languageFeature = lazy (LanguageFeatureShim("StringInterpolation"))

/// See https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/plaintext-formatting#format-specifiers-for-printf
let specifierRegex =
Regex("\\%(\\+|\\-)?\\d*(b|s|c|d|i|u|x|X|o|B|e|E|f|F|g|G|M|O|A)")
Regex(@"\%(\+|\-)?\.?\d*(b|s|c|d|i|u|x|X|o|B|e|E|f|F|g|G|M|O|A)")

let validFunctionNames = set [| "printf"; "printfn"; "sprintf" |]

Expand Down
11 changes: 7 additions & 4 deletions src/FsAutoComplete/LspHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,13 @@ module Conversions =
{ Uri = uri
Range = fcsRangeToLsp decl.Range }

let sym =
{ SymbolInformation.Name = decl.LogicalName
let sym: SymbolInformation =
{ Name = decl.LogicalName
Kind = kind
Location = location
ContainerName = container }
ContainerName = container
Tags = None
Deprecated = None }

if symbolFilter sym then Some sym else None

Expand Down Expand Up @@ -428,7 +430,8 @@ module Structure =
StartLine = lsp.Start.Line
EndCharacter = Some lsp.End.Character
EndLine = lsp.End.Line
Kind = kind }
Kind = kind
CollapsedText = None }

module ClassificationUtils =
[<RequireQualifiedAccess>]
Expand Down
Loading

0 comments on commit c513223

Please sign in to comment.