diff --git a/build.fsx b/build.fsx index 683668a85..719b74956 100644 --- a/build.fsx +++ b/build.fsx @@ -52,23 +52,24 @@ let integrationTests = let runIntegrationTest (fn: string) : bool = let dir = Path.GetDirectoryName fn - + tracefn "Running FSIHelper '%s', '%s', '%s'" FSIHelper.fsiPath dir fn - let b, msgs = FSIHelper.executeFSI dir fn [] - if not b then + let result, msgs = FSIHelper.executeFSI dir fn [] + let msgs = msgs |> Seq.filter (fun x -> x.IsError) |> Seq.toList + if not result then for msg in msgs do traceError msg.Message - b + result Target "IntegrationTest" (fun _ -> let runOk = - [ for i in integrationTests do - yield runIntegrationTest i ] + integrationTests + |> Seq.map runIntegrationTest |> Seq.forall id + if not runOk then failwith "Integration tests did not run successfully" else - let ok, out, err = Git.CommandHelper.runGitCommand "." diff --git a/paket.lock b/paket.lock index f0e9f60bf..b0490b333 100644 --- a/paket.lock +++ b/paket.lock @@ -3,7 +3,7 @@ NUGET remote: https://www.nuget.org/api/v2 FAKE (4.37.2) FParsec (1.0.2) - FSharp.Compiler.Service (6.0.2) - framework: >= net45 + FSharp.Compiler.Service (8.0) - framework: >= net45 System.Collections.Immutable (>= 1.2) System.Reflection.Metadata (>= 1.4.1-beta-24227-04) FSharp.Compiler.Service.ProjectCracker (6.0.2) @@ -37,5 +37,5 @@ NUGET System.Collections.Immutable (>= 1.2) GITHUB remote: fsharp/FAKE - modules/Octokit/Octokit.fsx (934dc8313e2c54793813058fe2540511ad3b8468) + modules/Octokit/Octokit.fsx (889bda9367dfb24f9abb524165a0dbe2cdd86252) Octokit (>= 0.20) \ No newline at end of file diff --git a/src/FsAutoComplete.Core/CommandResponse.fs b/src/FsAutoComplete.Core/CommandResponse.fs index d43e699a0..8ea7b94b2 100644 --- a/src/FsAutoComplete.Core/CommandResponse.fs +++ b/src/FsAutoComplete.Core/CommandResponse.fs @@ -45,8 +45,18 @@ module internal CompletionUtils = | Some(s), _ -> s // Is the second number good for anything? | _, _ -> ("", "") -module CommandResponse = + let getEnclosingEntityChar = function + | FSharpEnclosingEntityKind.Namespace -> "N" + | FSharpEnclosingEntityKind.Module -> "M" + | FSharpEnclosingEntityKind.Class -> "C" + | FSharpEnclosingEntityKind.Exception -> "E" + | FSharpEnclosingEntityKind.Interface -> "I" + | FSharpEnclosingEntityKind.Record -> "R" + | FSharpEnclosingEntityKind.Enum -> "En" + | FSharpEnclosingEntityKind.DU -> "D" +module CommandResponse = + type ResponseMsg<'T> = { Kind: string @@ -179,6 +189,8 @@ module CommandResponse = Range: Range.range BodyRange : Range.range File : string + EnclosingEntity: string + IsAbstract: bool } static member OfDeclarationItem(e:FSharpNavigationDeclarationItem, fn) = let (glyph, glyphChar) = CompletionUtils.getIcon e.Glyph @@ -191,6 +203,8 @@ module CommandResponse = Range = e.Range BodyRange = e.BodyRange File = fn + EnclosingEntity = CompletionUtils.getEnclosingEntityChar e.EnclosingEntityKind + IsAbstract = e.IsAbstract } type DeclarationResponse = { diff --git a/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj b/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj index 262468006..bd0087ca3 100644 --- a/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj +++ b/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj @@ -107,6 +107,11 @@ + + ..\..\packages\FSharp.Compiler.Service\lib\net45\FSharp.Compiler.Service.MSBuild.v12.dll + True + True + ..\..\packages\FSharp.Compiler.Service\lib\net45\FSharp.Compiler.Service.dll True diff --git a/src/FsAutoComplete.Suave/App.config b/src/FsAutoComplete.Suave/App.config index 023472a55..5be04fbb8 100644 --- a/src/FsAutoComplete.Suave/App.config +++ b/src/FsAutoComplete.Suave/App.config @@ -9,7 +9,7 @@ True - + \ No newline at end of file diff --git a/src/FsAutoComplete.Suave/FsAutoComplete.Suave.fsproj b/src/FsAutoComplete.Suave/FsAutoComplete.Suave.fsproj index e594e4581..7fd911bc8 100644 --- a/src/FsAutoComplete.Suave/FsAutoComplete.Suave.fsproj +++ b/src/FsAutoComplete.Suave/FsAutoComplete.Suave.fsproj @@ -88,6 +88,11 @@ + + ..\..\packages\FSharp.Compiler.Service\lib\net45\FSharp.Compiler.Service.MSBuild.v12.dll + True + True + ..\..\packages\FSharp.Compiler.Service\lib\net45\FSharp.Compiler.Service.dll True diff --git a/src/FsAutoComplete/FsAutoComplete.fsproj b/src/FsAutoComplete/FsAutoComplete.fsproj index 8453c9c5b..97f32c70b 100644 --- a/src/FsAutoComplete/FsAutoComplete.fsproj +++ b/src/FsAutoComplete/FsAutoComplete.fsproj @@ -91,6 +91,11 @@ + + ..\..\packages\FSharp.Compiler.Service\lib\net45\FSharp.Compiler.Service.MSBuild.v12.dll + True + True + ..\..\packages\FSharp.Compiler.Service\lib\net45\FSharp.Compiler.Service.dll True diff --git a/test/FsAutoComplete.IntegrationTests/Colorizations/output.json b/test/FsAutoComplete.IntegrationTests/Colorizations/output.json index c35f87f96..dd8f02b2f 100644 --- a/test/FsAutoComplete.IntegrationTests/Colorizations/output.json +++ b/test/FsAutoComplete.IntegrationTests/Colorizations/output.json @@ -26,6 +26,240 @@ }, "Kind": "Keyword" }, + { + "Range": { + "StartColumn": 15, + "StartLine": 8, + "EndColumn": 17, + "EndLine": 8 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 13, + "StartLine": 10, + "EndColumn": 15, + "EndLine": 10 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 18, + "StartLine": 10, + "EndColumn": 22, + "EndLine": 10 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 23, + "StartLine": 10, + "EndColumn": 31, + "EndLine": 10 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 32, + "StartLine": 10, + "EndColumn": 34, + "EndLine": 10 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 13, + "StartLine": 10, + "EndColumn": 15, + "EndLine": 10 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 18, + "StartLine": 10, + "EndColumn": 22, + "EndLine": 10 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 23, + "StartLine": 10, + "EndColumn": 31, + "EndLine": 10 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 32, + "StartLine": 10, + "EndColumn": 34, + "EndLine": 10 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 3, + "StartLine": 12, + "EndColumn": 28, + "EndLine": 12 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 3, + "StartLine": 12, + "EndColumn": 28, + "EndLine": 12 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 16, + "StartLine": 14, + "EndColumn": 19, + "EndLine": 14 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 20, + "StartLine": 14, + "EndColumn": 22, + "EndLine": 14 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 13, + "StartLine": 24, + "EndColumn": 15, + "EndLine": 24 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 25, + "StartLine": 24, + "EndColumn": 33, + "EndLine": 24 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 34, + "StartLine": 24, + "EndColumn": 38, + "EndLine": 24 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 65, + "StartLine": 24, + "EndColumn": 69, + "EndLine": 24 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 44, + "StartLine": 24, + "EndColumn": 46, + "EndLine": 24 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 49, + "StartLine": 24, + "EndColumn": 57, + "EndLine": 24 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 58, + "StartLine": 24, + "EndColumn": 62, + "EndLine": 24 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 25, + "StartLine": 24, + "EndColumn": 33, + "EndLine": 24 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 34, + "StartLine": 24, + "EndColumn": 38, + "EndLine": 24 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 65, + "StartLine": 24, + "EndColumn": 69, + "EndLine": 24 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 44, + "StartLine": 24, + "EndColumn": 46, + "EndLine": 24 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 49, + "StartLine": 24, + "EndColumn": 57, + "EndLine": 24 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 58, + "StartLine": 24, + "EndColumn": 62, + "EndLine": 24 + }, + "Kind": "TypeName" + }, { "Range": { "StartColumn": 13, @@ -44,6 +278,15 @@ }, "Kind": "Keyword" }, + { + "Range": { + "StartColumn": 17, + "StartLine": 64, + "EndColumn": 23, + "EndLine": 64 + }, + "Kind": "TypeName" + }, { "Range": { "StartColumn": 16, @@ -52,6 +295,159 @@ "EndLine": 68 }, "Kind": "Keyword" + }, + { + "Range": { + "StartColumn": 15, + "StartLine": 82, + "EndColumn": 28, + "EndLine": 82 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 15, + "StartLine": 82, + "EndColumn": 28, + "EndLine": 82 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 15, + "StartLine": 82, + "EndColumn": 28, + "EndLine": 82 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 15, + "StartLine": 82, + "EndColumn": 28, + "EndLine": 82 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 21, + "StartLine": 84, + "EndColumn": 58, + "EndLine": 84 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 21, + "StartLine": 84, + "EndColumn": 58, + "EndLine": 84 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 59, + "StartLine": 84, + "EndColumn": 65, + "EndLine": 84 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 66, + "StartLine": 84, + "EndColumn": 72, + "EndLine": 84 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 21, + "StartLine": 84, + "EndColumn": 58, + "EndLine": 84 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 21, + "StartLine": 84, + "EndColumn": 58, + "EndLine": 84 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 59, + "StartLine": 84, + "EndColumn": 65, + "EndLine": 84 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 66, + "StartLine": 84, + "EndColumn": 72, + "EndLine": 84 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 13, + "StartLine": 87, + "EndColumn": 29, + "EndLine": 87 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 13, + "StartLine": 87, + "EndColumn": 29, + "EndLine": 87 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 25, + "StartLine": 86, + "EndColumn": 31, + "EndLine": 86 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 3, + "StartLine": 93, + "EndColumn": 14, + "EndLine": 93 + }, + "Kind": "TypeName" + }, + { + "Range": { + "StartColumn": 3, + "StartLine": 93, + "EndColumn": 14, + "EndLine": 93 + }, + "Kind": "TypeName" } ] } diff --git a/test/FsAutoComplete.IntegrationTests/Linter/output.json b/test/FsAutoComplete.IntegrationTests/Linter/output.json index 8123453bb..9c28dd090 100644 --- a/test/FsAutoComplete.IntegrationTests/Linter/output.json +++ b/test/FsAutoComplete.IntegrationTests/Linter/output.json @@ -8,86 +8,5 @@ } { "Kind": "lint", - "Data": [ - { - "Info": "`not (a=b)` might be able to be refactored into `a<>b`.", - "Range": { - "StartColumn": 17, - "StartLine": 1, - "EndColumn": 26, - "EndLine": 1 - }, - "Input": "let test1 a b = not (a=b)\nlet test2 a b = not (a<>b)\nlet test3 = fun a -> a\nlet test4 = not true\nlet test5 = not false\nlet test6 = List.fold ( + ) 0\nlet test7 a = a<>true\nlet test8 a = a=null\nlet test9 a = List.head (List.sort a) \n" - }, - { - "Info": "`not (a<>b)` might be able to be refactored into `a=b`.", - "Range": { - "StartColumn": 17, - "StartLine": 2, - "EndColumn": 27, - "EndLine": 2 - }, - "Input": "let test1 a b = not (a=b)\nlet test2 a b = not (a<>b)\nlet test3 = fun a -> a\nlet test4 = not true\nlet test5 = not false\nlet test6 = List.fold ( + ) 0\nlet test7 a = a<>true\nlet test8 a = a=null\nlet test9 a = List.head (List.sort a) \n" - }, - { - "Info": "`fun x -> x` might be able to be refactored into `id`.", - "Range": { - "StartColumn": 13, - "StartLine": 3, - "EndColumn": 23, - "EndLine": 3 - }, - "Input": "let test1 a b = not (a=b)\nlet test2 a b = not (a<>b)\nlet test3 = fun a -> a\nlet test4 = not true\nlet test5 = not false\nlet test6 = List.fold ( + ) 0\nlet test7 a = a<>true\nlet test8 a = a=null\nlet test9 a = List.head (List.sort a) \n" - }, - { - "Info": "`not true` might be able to be refactored into `false`.", - "Range": { - "StartColumn": 13, - "StartLine": 4, - "EndColumn": 21, - "EndLine": 4 - }, - "Input": "let test1 a b = not (a=b)\nlet test2 a b = not (a<>b)\nlet test3 = fun a -> a\nlet test4 = not true\nlet test5 = not false\nlet test6 = List.fold ( + ) 0\nlet test7 a = a<>true\nlet test8 a = a=null\nlet test9 a = List.head (List.sort a) \n" - }, - { - "Info": "`not false` might be able to be refactored into `true`.", - "Range": { - "StartColumn": 13, - "StartLine": 5, - "EndColumn": 22, - "EndLine": 5 - }, - "Input": "let test1 a b = not (a=b)\nlet test2 a b = not (a<>b)\nlet test3 = fun a -> a\nlet test4 = not true\nlet test5 = not false\nlet test6 = List.fold ( + ) 0\nlet test7 a = a<>true\nlet test8 a = a=null\nlet test9 a = List.head (List.sort a) \n" - }, - { - "Info": "`a<>true` might be able to be refactored into `not a`.", - "Range": { - "StartColumn": 15, - "StartLine": 7, - "EndColumn": 22, - "EndLine": 7 - }, - "Input": "let test1 a b = not (a=b)\nlet test2 a b = not (a<>b)\nlet test3 = fun a -> a\nlet test4 = not true\nlet test5 = not false\nlet test6 = List.fold ( + ) 0\nlet test7 a = a<>true\nlet test8 a = a=null\nlet test9 a = List.head (List.sort a) \n" - }, - { - "Info": "`x=null`; suggestion: Consider using pattern matching, or if you're using F# 4 then `isNull`.", - "Range": { - "StartColumn": 15, - "StartLine": 8, - "EndColumn": 21, - "EndLine": 8 - }, - "Input": "let test1 a b = not (a=b)\nlet test2 a b = not (a<>b)\nlet test3 = fun a -> a\nlet test4 = not true\nlet test5 = not false\nlet test6 = List.fold ( + ) 0\nlet test7 a = a<>true\nlet test8 a = a=null\nlet test9 a = List.head (List.sort a) \n" - }, - { - "Info": "`List.head (List.sort x)` might be able to be refactored into `List.min x`.", - "Range": { - "StartColumn": 15, - "StartLine": 9, - "EndColumn": 38, - "EndLine": 9 - }, - "Input": "let test1 a b = not (a=b)\nlet test2 a b = not (a<>b)\nlet test3 = fun a -> a\nlet test4 = not true\nlet test5 = not false\nlet test6 = List.fold ( + ) 0\nlet test7 a = a<>true\nlet test8 a = a=null\nlet test9 a = List.head (List.sort a) \n" - } - ] + "Data": [] } diff --git a/test/FsAutoComplete.IntegrationTests/SymbolUse/Script.fsx b/test/FsAutoComplete.IntegrationTests/SymbolUse/Script.fsx index 9470cf71b..05554ad84 100644 --- a/test/FsAutoComplete.IntegrationTests/SymbolUse/Script.fsx +++ b/test/FsAutoComplete.IntegrationTests/SymbolUse/Script.fsx @@ -3,6 +3,6 @@ module console [] let main argv = - System.IO.Directory + console.undefinedsymbol 3 0 // return an integer exit code diff --git a/test/FsAutoComplete.IntegrationTests/SymbolUse/SymbolUseRunner.fsx b/test/FsAutoComplete.IntegrationTests/SymbolUse/SymbolUseRunner.fsx index 96500f6a0..93e020570 100644 --- a/test/FsAutoComplete.IntegrationTests/SymbolUse/SymbolUseRunner.fsx +++ b/test/FsAutoComplete.IntegrationTests/SymbolUse/SymbolUseRunner.fsx @@ -23,7 +23,7 @@ p.symboluse "Program.fs" " let testval = 123" 14 12 //testval shadowed p.symboluse "Program.fs" "let shadowed = " 12 4 //miss p.symboluse "Program.fs" "let shadowed = " 12 5 //shadowed start p.symboluse "Program.fs" "let shadowed = " 12 13 //shadowed end -p.symboluse "Script.fsx" " System.IO.Directory" 6 18 // no uses due to compile error +p.symboluse "Script.fsx" " console.undefinedsymbol 3" 6 17 // no uses due to compile error Threading.Thread.Sleep(1000) p.send "quit\n" diff --git a/test/FsAutoComplete.IntegrationTests/SymbolUse/output.json b/test/FsAutoComplete.IntegrationTests/SymbolUse/output.json index f08a76193..bd2417d95 100644 --- a/test/FsAutoComplete.IntegrationTests/SymbolUse/output.json +++ b/test/FsAutoComplete.IntegrationTests/SymbolUse/output.json @@ -37,10 +37,10 @@ "FileName": "/FsAutoComplete.IntegrationTests/SymbolUse/Script.fsx", "StartLine": 6, "EndLine": 6, - "StartColumn": 15, - "EndColumn": 24, + "StartColumn": 5, + "EndColumn": 12, "Severity": "Error", - "Message": "The value, constructor, namespace or type 'Directory' is not defined", + "Message": "The namespace or module 'console' is not defined", "Subcategory": "typecheck" } ] @@ -181,9 +181,6 @@ } } { - "Kind": "symboluse", - "Data": { - "Name": "Directory", - "Uses": [] - } + "Kind": "info", + "Data": "No symbol information found" } diff --git a/test/FsAutoComplete.IntegrationTests/Test1Json/output.json b/test/FsAutoComplete.IntegrationTests/Test1Json/output.json index 38f8931eb..1626d8d0d 100644 --- a/test/FsAutoComplete.IntegrationTests/Test1Json/output.json +++ b/test/FsAutoComplete.IntegrationTests/Test1Json/output.json @@ -315,7 +315,9 @@ "EndColumn": 6, "EndLine": 15 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/Program.fs" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/Program.fs", + "EnclosingEntity": "M", + "IsAbstract": false }, "Nested": [ { @@ -336,7 +338,97 @@ "EndColumn": 6, "EndLine": 15 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/Program.fs" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/Program.fs", + "EnclosingEntity": "M", + "IsAbstract": false + }, + { + "UniqueName": "Program_1_of_1", + "Name": "testval", + "Glyph": "Field", + "GlyphChar": "F", + "IsTopLevel": false, + "Range": { + "StartColumn": 5, + "StartLine": 4, + "EndColumn": 12, + "EndLine": 4 + }, + "BodyRange": { + "StartColumn": 5, + "StartLine": 4, + "EndColumn": 12, + "EndLine": 4 + }, + "File": "/FsAutoComplete.IntegrationTests/Test1Json/Program.fs", + "EnclosingEntity": "M", + "IsAbstract": false + }, + { + "UniqueName": "Program_1_of_1", + "Name": "val2", + "Glyph": "Field", + "GlyphChar": "F", + "IsTopLevel": false, + "Range": { + "StartColumn": 5, + "StartLine": 6, + "EndColumn": 9, + "EndLine": 6 + }, + "BodyRange": { + "StartColumn": 5, + "StartLine": 6, + "EndColumn": 9, + "EndLine": 6 + }, + "File": "/FsAutoComplete.IntegrationTests/Test1Json/Program.fs", + "EnclosingEntity": "M", + "IsAbstract": false + }, + { + "UniqueName": "Program_1_of_1", + "Name": "val3", + "Glyph": "Field", + "GlyphChar": "F", + "IsTopLevel": false, + "Range": { + "StartColumn": 5, + "StartLine": 8, + "EndColumn": 9, + "EndLine": 8 + }, + "BodyRange": { + "StartColumn": 5, + "StartLine": 8, + "EndColumn": 9, + "EndLine": 8 + }, + "File": "/FsAutoComplete.IntegrationTests/Test1Json/Program.fs", + "EnclosingEntity": "M", + "IsAbstract": false + }, + { + "UniqueName": "Program_1_of_1", + "Name": "val4", + "Glyph": "Field", + "GlyphChar": "F", + "IsTopLevel": false, + "Range": { + "StartColumn": 5, + "StartLine": 10, + "EndColumn": 9, + "EndLine": 10 + }, + "BodyRange": { + "StartColumn": 5, + "StartLine": 10, + "EndColumn": 9, + "EndLine": 10 + }, + "File": "/FsAutoComplete.IntegrationTests/Test1Json/Program.fs", + "EnclosingEntity": "M", + "IsAbstract": false } ] }, @@ -359,7 +451,9 @@ "EndColumn": 21, "EndLine": 2 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/Program.fs" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/Program.fs", + "EnclosingEntity": "M", + "IsAbstract": false }, "Nested": [ { @@ -380,7 +474,9 @@ "EndColumn": 21, "EndLine": 2 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/Program.fs" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/Program.fs", + "EnclosingEntity": "M", + "IsAbstract": false } ] } @@ -408,7 +504,9 @@ "EndColumn": 6, "EndLine": 14 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs", + "EnclosingEntity": "M", + "IsAbstract": false }, "Nested": [ { @@ -429,7 +527,9 @@ "EndColumn": 20, "EndLine": 9 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs", + "EnclosingEntity": "M", + "IsAbstract": false }, { "UniqueName": "FileTwo_1_of_1", @@ -449,7 +549,9 @@ "EndColumn": 25, "EndLine": 7 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs", + "EnclosingEntity": "M", + "IsAbstract": false } ] }, @@ -472,7 +574,9 @@ "EndColumn": 8, "EndLine": 5 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs", + "EnclosingEntity": "D", + "IsAbstract": false }, "Nested": [ { @@ -493,7 +597,9 @@ "EndColumn": 8, "EndLine": 4 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs", + "EnclosingEntity": "D", + "IsAbstract": false }, { "UniqueName": "Foo_1_of_1", @@ -513,7 +619,9 @@ "EndColumn": 8, "EndLine": 5 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs", + "EnclosingEntity": "D", + "IsAbstract": false } ] }, @@ -536,7 +644,9 @@ "EndColumn": 6, "EndLine": 14 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs", + "EnclosingEntity": "C", + "IsAbstract": false }, "Nested": [ { @@ -557,7 +667,9 @@ "EndColumn": 6, "EndLine": 14 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/FileTwo.fs", + "EnclosingEntity": "C", + "IsAbstract": false } ] } @@ -582,12 +694,37 @@ "BodyRange": { "StartColumn": 1, "StartLine": 1, - "EndColumn": 22, - "EndLine": 4 + "EndColumn": 10, + "EndLine": 6 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/Script.fsx" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/Script.fsx", + "EnclosingEntity": "M", + "IsAbstract": false }, - "Nested": [] + "Nested": [ + { + "UniqueName": "Script_1_of_1", + "Name": "val99", + "Glyph": "Field", + "GlyphChar": "F", + "IsTopLevel": false, + "Range": { + "StartColumn": 5, + "StartLine": 6, + "EndColumn": 10, + "EndLine": 6 + }, + "BodyRange": { + "StartColumn": 5, + "StartLine": 6, + "EndColumn": 10, + "EndLine": 6 + }, + "File": "/FsAutoComplete.IntegrationTests/Test1Json/Script.fsx", + "EnclosingEntity": "M", + "IsAbstract": false + } + ] }, { "Declaration": { @@ -608,7 +745,9 @@ "EndColumn": 22, "EndLine": 4 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/Script.fsx" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/Script.fsx", + "EnclosingEntity": "M", + "IsAbstract": false }, "Nested": [ { @@ -629,7 +768,9 @@ "EndColumn": 22, "EndLine": 4 }, - "File": "/FsAutoComplete.IntegrationTests/Test1Json/Script.fsx" + "File": "/FsAutoComplete.IntegrationTests/Test1Json/Script.fsx", + "EnclosingEntity": "M", + "IsAbstract": false } ] } diff --git a/test/FsAutoComplete.IntegrationTests/TestHelpers.fsx b/test/FsAutoComplete.IntegrationTests/TestHelpers.fsx index b090528d3..2b191b22b 100644 --- a/test/FsAutoComplete.IntegrationTests/TestHelpers.fsx +++ b/test/FsAutoComplete.IntegrationTests/TestHelpers.fsx @@ -110,7 +110,7 @@ let writeNormalizedOutput (fn: string) (s: string) = "/FsAutoComplete.IntegrationTests/$1") - lines.[i] <- lines.[i].Replace("\r", "") + lines.[i] <- lines.[i].Replace("\r", "").Replace(@"\r", "") // Write manually to ensure \n line endings on all platforms using (new StreamWriter(fn)) diff --git a/test/FsAutoComplete.Tests/FsAutoComplete.Tests.fsproj b/test/FsAutoComplete.Tests/FsAutoComplete.Tests.fsproj index 1e4c41286..9f4f8dda7 100644 --- a/test/FsAutoComplete.Tests/FsAutoComplete.Tests.fsproj +++ b/test/FsAutoComplete.Tests/FsAutoComplete.Tests.fsproj @@ -82,6 +82,11 @@ + + ..\..\packages\FSharp.Compiler.Service\lib\net45\FSharp.Compiler.Service.MSBuild.v12.dll + True + True + ..\..\packages\FSharp.Compiler.Service\lib\net45\FSharp.Compiler.Service.dll True