Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

WIP update to FCS 10 #1496

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#### 2.5.7 - February 20 2017

* Updated FSharp.Compiler.Services, Fantomas and FSharpLint [#1496](https://github.com/fsprojects/VisualFSharpPowerTools/pull/1496)

#### 2.5.6 - February 3 2017
* Updated FsXaml and FSharp.ViewModule to prevent type provider conflicts

Expand Down
14 changes: 8 additions & 6 deletions paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
source http://nuget.org/api/v2
redirects: on
strategy: max

framework >= net40
nuget Fantomas
nuget FSharp.Compiler.Service
nuget FSharp.Core
nuget FSharp.Compiler.Service.ProjectCracker # fslint also depends on it, and conflicted with standalone dependency in Test group which is now removed
nuget FSharp.Core = 4.0.0.1
nuget FSharp.Data
nuget FSharp.Management
nuget FSharp.ViewModule.Core
nuget FSharpLint.Core
nuget FSharpLint.Core prerelease
nuget FsPickler
nuget FsXaml.Wpf
nuget SourceLink.SymbolStore 0.5.0
Expand Down Expand Up @@ -42,18 +43,19 @@ group vssdk

group Test
source http://nuget.org/api/v2

framework >= net40
nuget Foq
nuget FsCheck
nuget FSharp.Compiler.Service.ProjectCracker
nuget FSharp.Core = 4.0.0.1
nuget NUnit
nuget NUnit.Runners

group Build
source http://nuget.org/api/v2

framework >= net40
nuget canopy
nuget FAKE
nuget FSharp.Core = 4.0.0.1
nuget FSharp.Formatting
nuget Nuget.CommandLine
nuget Selenium.WebDriver.ChromeDriver
Expand Down
238 changes: 90 additions & 148 deletions paket.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/FSharp.Editing.VisualStudio.Tests.v2015/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ open System.Runtime.CompilerServices
[<assembly: AssemblyTitleAttribute("FSharp.Editing.VisualStudio.v2015")>]
[<assembly: AssemblyProductAttribute("FSharpVSPowerTools")>]
[<assembly: AssemblyDescriptionAttribute("A collection of additional commands for F# in Visual Studio")>]
[<assembly: AssemblyVersionAttribute("2.5.6")>]
[<assembly: AssemblyFileVersionAttribute("2.5.6")>]
[<assembly: AssemblyVersionAttribute("2.5.7")>]
[<assembly: AssemblyFileVersionAttribute("2.5.7")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] InternalsVisibleTo = "FSharp.Editing.VisualStudio.Tests"
let [<Literal>] AssemblyTitle = "FSharp.Editing.VisualStudio.v2015"
let [<Literal>] AssemblyProduct = "FSharpVSPowerTools"
let [<Literal>] AssemblyDescription = "A collection of additional commands for F# in Visual Studio"
let [<Literal>] AssemblyVersion = "2.5.6"
let [<Literal>] AssemblyFileVersion = "2.5.6"
let [<Literal>] AssemblyVersion = "2.5.7"
let [<Literal>] AssemblyFileVersion = "2.5.7"

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/FSharp.Editing.VisualStudio/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ open System.Runtime.CompilerServices
[<assembly: AssemblyTitleAttribute("FSharp.Editing.VisualStudio")>]
[<assembly: AssemblyProductAttribute("FSharpVSPowerTools")>]
[<assembly: AssemblyDescriptionAttribute("A collection of additional commands for F# in Visual Studio")>]
[<assembly: AssemblyVersionAttribute("2.5.6")>]
[<assembly: AssemblyFileVersionAttribute("2.5.6")>]
[<assembly: AssemblyVersionAttribute("2.5.7")>]
[<assembly: AssemblyFileVersionAttribute("2.5.7")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] InternalsVisibleTo = "FSharp.Editing.VisualStudio.Tests"
let [<Literal>] AssemblyTitle = "FSharp.Editing.VisualStudio"
let [<Literal>] AssemblyProduct = "FSharpVSPowerTools"
let [<Literal>] AssemblyDescription = "A collection of additional commands for F# in Visual Studio"
let [<Literal>] AssemblyVersion = "2.5.6"
let [<Literal>] AssemblyFileVersion = "2.5.6"
let [<Literal>] AssemblyVersion = "2.5.7"
let [<Literal>] AssemblyFileVersion = "2.5.7"
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ type UnusedSymbolClassifier
let projectCheckedSubscription =
// project check results needed for Unused Declarations only.
if includeUnusedReferences() then
Some (vsLanguageService.RawChecker.ProjectChecked.Subscribe (fun projectFileName ->
Some (vsLanguageService.RawChecker.ProjectChecked.Subscribe (fun (projectFileName, _extraProjectInfo) ->
let projects = singleSymbolsProjects.Value
let projects =
match projects |> List.partition (fun p -> p.Options.ProjectFileName = projectFileName) with
Expand Down
503 changes: 105 additions & 398 deletions src/FSharp.Editing.VisualStudio/FSharp.Editing.VisualStudio.fsproj

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions src/FSharp.Editing.VisualStudio/Linting/LintUtils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ module LintUtils =

let private settingFromObject (settingObj:obj) =
match settingObj with
| :? BoolViewModel as x ->
| :? BoolViewModel as x ->
match x.Name with
| "IncludeMatchStatements" -> Some(x.Name, IncludeMatchStatements(x.IsChecked))
| "OneSpaceAllowedAfterOperator" -> Some(x.Name, OneSpaceAllowedAfterOperator(x.IsChecked))
| "IgnoreBlankLines" -> Some(x.Name, IgnoreBlankLines(x.IsChecked))
| _ -> None
Expand All @@ -109,7 +108,6 @@ module LintUtils =
| "Depth" -> Some(x.Name, Depth(x.Value))
| "MaxItems" -> Some(x.Name, MaxItems(x.Value))
| "Length" -> Some(x.Name, Length(x.Value))
| "MaxCyclomaticComplexity" -> Some(x.Name, MaxCyclomaticComplexity(x.Value))
| "NumberOfSpacesAllowed" -> Some(x.Name, NumberOfSpacesAllowed(x.Value))
| _ -> None
| :? AccessViewModel as x -> Some(x.Name, Access(x.Value))
Expand Down Expand Up @@ -145,8 +143,7 @@ module LintUtils =
("Hints", analyser)

let viewModelToConfig (viewModel:OptionsViewModel) =
{ UseTypeChecker = None
IgnoreFiles =
{ IgnoreFiles =
{ Update = IgnoreFilesUpdate.Overwrite
Files = []
Content = viewModel.IgnoreFiles.IgnoreFiles
Expand All @@ -168,8 +165,7 @@ module LintUtils =
let existingPartial =
getPartialConfig loadedConfigs normalisedDir
|> Option.getOrTry (fun _ ->
{ UseTypeChecker = None
IgnoreFiles = None
{ IgnoreFiles = None
Analysers = Map.ofList [] })

let updatedPartial = updateConfigMap config existing existingPartial
Expand Down
14 changes: 9 additions & 5 deletions src/FSharp.Editing.VisualStudio/Linting/OptionsViewModel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ type AccessViewModel(name, initialValue) as this =
member __.AccessValues = Enum.GetValues(typeof<Access>) |> Seq.cast<Access>

module SetupViewModels =

let getSettingsViewModelsFromRule (settings:Map<_, _>) =
[ for setting in settings do
match setting.Value with
Expand All @@ -121,10 +122,6 @@ module SetupViewModels =
yield IntViewModel("MaxItems", value) :> obj
| Length(value) ->
yield IntViewModel("Length", value) :> obj
| MaxCyclomaticComplexity(value) ->
yield IntViewModel("MaxCyclomaticComplexity", value) :> obj
| IncludeMatchStatements(value) ->
yield BoolViewModel("IncludeMatchStatements", value) :> obj
| OneSpaceAllowedAfterOperator(value) ->
yield BoolViewModel("OneSpaceAllowedAfterOperator", value) :> obj
| NumberOfSpacesAllowed(value) ->
Expand All @@ -133,8 +130,15 @@ module SetupViewModels =
yield BoolViewModel("IgnoreBlankLines", value) :> obj
| Access(value) ->
yield AccessViewModel("Access", value) :> obj
| Prefix(_)
| Suffix(_)
| Underscores(_)
| Naming(_)
| Hints(_)
| Enabled(_) -> () ]
| Enabled(_) ->
// those are unhandled settings
// up-for-grabs
() ]

let isRuleEnabled settings = Map.tryFind "Enabled" settings = Some(Enabled(true))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ type VSLanguageService
let statusBar = serviceProvider.GetService<IVsStatusbar, SVsStatusbar>()
statusBar.SetText Resource.languageServiceErrorMessage |> ignore

do instance.SetCriticalErrorHandler suggestRecoveryAfterFailure
openDocumentsTracker.DocumentChanged.Add instance.OnFileChanged
openDocumentsTracker.DocumentClosed.Add instance.OnFileClosed
do
instance.SetCriticalErrorHandler suggestRecoveryAfterFailure

let mutable skipLexCache = false

Expand Down
8 changes: 4 additions & 4 deletions src/FSharp.Editing/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ open System.Runtime.CompilerServices
[<assembly: AssemblyTitleAttribute("FSharp.Editing")>]
[<assembly: AssemblyProductAttribute("FSharpVSPowerTools")>]
[<assembly: AssemblyDescriptionAttribute("A collection of additional commands for F# in Visual Studio")>]
[<assembly: AssemblyVersionAttribute("2.5.6")>]
[<assembly: AssemblyFileVersionAttribute("2.5.6")>]
[<assembly: AssemblyVersionAttribute("2.5.7")>]
[<assembly: AssemblyFileVersionAttribute("2.5.7")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] InternalsVisibleTo = "FSharp.Editing.Tests"
let [<Literal>] AssemblyTitle = "FSharp.Editing"
let [<Literal>] AssemblyProduct = "FSharpVSPowerTools"
let [<Literal>] AssemblyDescription = "A collection of additional commands for F# in Visual Studio"
let [<Literal>] AssemblyVersion = "2.5.6"
let [<Literal>] AssemblyFileVersion = "2.5.6"
let [<Literal>] AssemblyVersion = "2.5.7"
let [<Literal>] AssemblyFileVersion = "2.5.7"
2 changes: 1 addition & 1 deletion src/FSharp.Editing/Coloring/PrintfSpecifiersUsageGetter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let getAll (input: ParseAndCheckResults) (onError: string -> unit): PrintfSpecif
let specRangesAndArities =
specRangesAndArities
|> Array.map (fun (x, ar) ->
(Range.mkRange x.FileName x.Start (Range.mkPos x.EndLine (x.EndColumn + 1))), ar)
(Range.mkRange x.FileName x.Start (Range.mkPos x.EndLine (x.EndColumn))), ar)

let printfFunctions = Printf.getAll input.ParseTree

Expand Down
4 changes: 2 additions & 2 deletions src/FSharp.Editing/Common/Lexer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module Lexer =
| Some _, newLexState ->
loop lineTokenizer newLexState

let sourceTokenizer = SourceTokenizer(defines, Some "/tmp.fsx")
let sourceTokenizer = FSharpSourceTokenizer(defines, Some "/tmp.fsx")
let lines = String.getLines source
let lexState = ref 0L
for line in lines do
Expand Down Expand Up @@ -81,7 +81,7 @@ module Lexer =
let defines =
args |> Seq.choose (fun s -> if s.StartsWith "--define:" then Some s.[9..] else None)
|> Seq.toList
let sourceTokenizer = SourceTokenizer(defines, Some "/tmp.fsx")
let sourceTokenizer = FSharpSourceTokenizer(defines, Some "/tmp.fsx")
let lineTokenizer = sourceTokenizer.CreateLineTokenizer lineStr
let rec loop lexState acc =
match lineTokenizer.ScanToken lexState with
Expand Down
Loading