Skip to content

Commit 9c6e560

Browse files
authored
Merge branch 'feature/lsp' into merge/main-to-feature/lsp
2 parents 32c2764 + f5e190c commit 9c6e560

File tree

42 files changed

+2097
-119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2097
-119
lines changed

.fantomasignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ src/Compiler/SyntaxTree/LexerStore.fs
131131
src/Compiler/Driver/GraphChecking/Graph.fsi
132132
src/Compiler/Driver/GraphChecking/Graph.fs
133133

134+
src/FSharp.Compiler.LanguageServer/Common/LifecycleManager.fs
134135
src/Compiler/DependencyManager/NativeDllResolveHandler.fsi
135136
src/Compiler/DependencyManager/AssemblyResolveHandler.fsi
136137

VSFSharpExtension.sln

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B4A1E626-4A48-4977-B291-219882DB3413}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharp.VisualStudio.Extension", "src\FSharp.VisualStudio.Extension\FSharp.VisualStudio.Extension.csproj", "{14B9AB0E-2FC0-43F1-9775-20C262202D12}"
9+
EndProject
10+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer", "src\FSharp.Compiler.LanguageServer\FSharp.Compiler.LanguageServer.fsproj", "{7EDDFB35-2428-4433-8ABF-47233480B746}"
11+
EndProject
12+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service", "src\Compiler\FSharp.Compiler.Service.fsproj", "{0B24DCA6-902F-409E-A18C-7B1BFDDC8849}"
13+
EndProject
14+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Core", "src\FSharp.Core\FSharp.Core.fsproj", "{5A4B66D5-A6C3-402C-A010-7A3635098DA7}"
15+
EndProject
16+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.DependencyManager.Nuget", "src\FSharp.DependencyManager.Nuget\FSharp.DependencyManager.Nuget.fsproj", "{860808CF-D092-4511-B011-6205B654031D}"
17+
EndProject
18+
Global
19+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
20+
Debug|Any CPU = Debug|Any CPU
21+
Proto|Any CPU = Proto|Any CPU
22+
Release|Any CPU = Release|Any CPU
23+
EndGlobalSection
24+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
25+
{14B9AB0E-2FC0-43F1-9775-20C262202D12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26+
{14B9AB0E-2FC0-43F1-9775-20C262202D12}.Debug|Any CPU.Build.0 = Debug|Any CPU
27+
{14B9AB0E-2FC0-43F1-9775-20C262202D12}.Proto|Any CPU.ActiveCfg = Release|Any CPU
28+
{14B9AB0E-2FC0-43F1-9775-20C262202D12}.Proto|Any CPU.Build.0 = Release|Any CPU
29+
{14B9AB0E-2FC0-43F1-9775-20C262202D12}.Proto|Any CPU.Deploy.0 = Release|Any CPU
30+
{14B9AB0E-2FC0-43F1-9775-20C262202D12}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{14B9AB0E-2FC0-43F1-9775-20C262202D12}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{7EDDFB35-2428-4433-8ABF-47233480B746}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{7EDDFB35-2428-4433-8ABF-47233480B746}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{7EDDFB35-2428-4433-8ABF-47233480B746}.Proto|Any CPU.ActiveCfg = Release|Any CPU
35+
{7EDDFB35-2428-4433-8ABF-47233480B746}.Proto|Any CPU.Build.0 = Release|Any CPU
36+
{7EDDFB35-2428-4433-8ABF-47233480B746}.Release|Any CPU.ActiveCfg = Release|Any CPU
37+
{7EDDFB35-2428-4433-8ABF-47233480B746}.Release|Any CPU.Build.0 = Release|Any CPU
38+
{0B24DCA6-902F-409E-A18C-7B1BFDDC8849}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39+
{0B24DCA6-902F-409E-A18C-7B1BFDDC8849}.Debug|Any CPU.Build.0 = Debug|Any CPU
40+
{0B24DCA6-902F-409E-A18C-7B1BFDDC8849}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
41+
{0B24DCA6-902F-409E-A18C-7B1BFDDC8849}.Proto|Any CPU.Build.0 = Debug|Any CPU
42+
{0B24DCA6-902F-409E-A18C-7B1BFDDC8849}.Release|Any CPU.ActiveCfg = Release|Any CPU
43+
{0B24DCA6-902F-409E-A18C-7B1BFDDC8849}.Release|Any CPU.Build.0 = Release|Any CPU
44+
{5A4B66D5-A6C3-402C-A010-7A3635098DA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45+
{5A4B66D5-A6C3-402C-A010-7A3635098DA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
46+
{5A4B66D5-A6C3-402C-A010-7A3635098DA7}.Proto|Any CPU.ActiveCfg = Proto|Any CPU
47+
{5A4B66D5-A6C3-402C-A010-7A3635098DA7}.Proto|Any CPU.Build.0 = Proto|Any CPU
48+
{5A4B66D5-A6C3-402C-A010-7A3635098DA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
49+
{5A4B66D5-A6C3-402C-A010-7A3635098DA7}.Release|Any CPU.Build.0 = Release|Any CPU
50+
{860808CF-D092-4511-B011-6205B654031D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
51+
{860808CF-D092-4511-B011-6205B654031D}.Debug|Any CPU.Build.0 = Debug|Any CPU
52+
{860808CF-D092-4511-B011-6205B654031D}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
53+
{860808CF-D092-4511-B011-6205B654031D}.Proto|Any CPU.Build.0 = Debug|Any CPU
54+
{860808CF-D092-4511-B011-6205B654031D}.Release|Any CPU.ActiveCfg = Release|Any CPU
55+
{860808CF-D092-4511-B011-6205B654031D}.Release|Any CPU.Build.0 = Release|Any CPU
56+
EndGlobalSection
57+
GlobalSection(SolutionProperties) = preSolution
58+
HideSolutionNode = FALSE
59+
EndGlobalSection
60+
GlobalSection(NestedProjects) = preSolution
61+
{14B9AB0E-2FC0-43F1-9775-20C262202D12} = {B4A1E626-4A48-4977-B291-219882DB3413}
62+
EndGlobalSection
63+
GlobalSection(ExtensibilityGlobals) = postSolution
64+
SolutionGuid = {BCE01FEF-1B00-471B-81E0-A06994EC90ED}
65+
EndGlobalSection
66+
EndGlobal

VisualFSharp.sln

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,14 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "MicroPerf", "tests\benchmar
193193
EndProject
194194
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroPerfCSharp", "tests\benchmarks\CompiledCodeBenchmarks\MicroPerf\CS\MicroPerfCSharp.csproj", "{9F9DD315-37DA-4413-928E-1CFC6924B64F}"
195195
EndProject
196+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer", "src\FSharp.Compiler.LanguageServer\FSharp.Compiler.LanguageServer.fsproj", "{D72F6593-DB2D-47AC-8E15-8DCE8527972E}"
197+
EndProject
198+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer.Tests", "tests\FSharp.Compiler.LanguageServer.Tests\FSharp.Compiler.LanguageServer.Tests.fsproj", "{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388}"
199+
EndProject
200+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharp.VisualStudio.Extension", "src\FSharp.VisualStudio.Extension\FSharp.VisualStudio.Extension.csproj", "{E1013576-6257-47BA-AAFB-F95B68DAB1FF}"
201+
EndProject
202+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.CommonLanguageServerProtocol.Framework.Proxy", "src\Microsoft.CommonLanguageServerProtocol.Framework.Proxy\Microsoft.CommonLanguageServerProtocol.Framework.Proxy.csproj", "{FAFF15B5-F7C4-1CE5-9A18-2F6DC93E03ED}"
203+
EndProject
196204
Global
197205
GlobalSection(SolutionConfigurationPlatforms) = preSolution
198206
Debug|Any CPU = Debug|Any CPU
@@ -1019,6 +1027,54 @@ Global
10191027
{9F9DD315-37DA-4413-928E-1CFC6924B64F}.Release|Any CPU.Build.0 = Release|Any CPU
10201028
{9F9DD315-37DA-4413-928E-1CFC6924B64F}.Release|x86.ActiveCfg = Release|Any CPU
10211029
{9F9DD315-37DA-4413-928E-1CFC6924B64F}.Release|x86.Build.0 = Release|Any CPU
1030+
{D72F6593-DB2D-47AC-8E15-8DCE8527972E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1031+
{D72F6593-DB2D-47AC-8E15-8DCE8527972E}.Debug|Any CPU.Build.0 = Debug|Any CPU
1032+
{D72F6593-DB2D-47AC-8E15-8DCE8527972E}.Debug|x86.ActiveCfg = Debug|Any CPU
1033+
{D72F6593-DB2D-47AC-8E15-8DCE8527972E}.Debug|x86.Build.0 = Debug|Any CPU
1034+
{D72F6593-DB2D-47AC-8E15-8DCE8527972E}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
1035+
{D72F6593-DB2D-47AC-8E15-8DCE8527972E}.Proto|Any CPU.Build.0 = Debug|Any CPU
1036+
{D72F6593-DB2D-47AC-8E15-8DCE8527972E}.Proto|x86.ActiveCfg = Debug|Any CPU
1037+
{D72F6593-DB2D-47AC-8E15-8DCE8527972E}.Proto|x86.Build.0 = Debug|Any CPU
1038+
{D72F6593-DB2D-47AC-8E15-8DCE8527972E}.Release|Any CPU.ActiveCfg = Release|Any CPU
1039+
{D72F6593-DB2D-47AC-8E15-8DCE8527972E}.Release|Any CPU.Build.0 = Release|Any CPU
1040+
{D72F6593-DB2D-47AC-8E15-8DCE8527972E}.Release|x86.ActiveCfg = Release|Any CPU
1041+
{D72F6593-DB2D-47AC-8E15-8DCE8527972E}.Release|x86.Build.0 = Release|Any CPU
1042+
{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1043+
{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388}.Debug|Any CPU.Build.0 = Debug|Any CPU
1044+
{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388}.Debug|x86.ActiveCfg = Debug|Any CPU
1045+
{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388}.Debug|x86.Build.0 = Debug|Any CPU
1046+
{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
1047+
{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388}.Proto|Any CPU.Build.0 = Debug|Any CPU
1048+
{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388}.Proto|x86.ActiveCfg = Debug|Any CPU
1049+
{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388}.Proto|x86.Build.0 = Debug|Any CPU
1050+
{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388}.Release|Any CPU.ActiveCfg = Release|Any CPU
1051+
{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388}.Release|Any CPU.Build.0 = Release|Any CPU
1052+
{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388}.Release|x86.ActiveCfg = Release|Any CPU
1053+
{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388}.Release|x86.Build.0 = Release|Any CPU
1054+
{E1013576-6257-47BA-AAFB-F95B68DAB1FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1055+
{E1013576-6257-47BA-AAFB-F95B68DAB1FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
1056+
{E1013576-6257-47BA-AAFB-F95B68DAB1FF}.Debug|x86.ActiveCfg = Debug|Any CPU
1057+
{E1013576-6257-47BA-AAFB-F95B68DAB1FF}.Debug|x86.Build.0 = Debug|Any CPU
1058+
{E1013576-6257-47BA-AAFB-F95B68DAB1FF}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
1059+
{E1013576-6257-47BA-AAFB-F95B68DAB1FF}.Proto|Any CPU.Build.0 = Debug|Any CPU
1060+
{E1013576-6257-47BA-AAFB-F95B68DAB1FF}.Proto|x86.ActiveCfg = Debug|Any CPU
1061+
{E1013576-6257-47BA-AAFB-F95B68DAB1FF}.Proto|x86.Build.0 = Debug|Any CPU
1062+
{E1013576-6257-47BA-AAFB-F95B68DAB1FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
1063+
{E1013576-6257-47BA-AAFB-F95B68DAB1FF}.Release|Any CPU.Build.0 = Release|Any CPU
1064+
{E1013576-6257-47BA-AAFB-F95B68DAB1FF}.Release|x86.ActiveCfg = Release|Any CPU
1065+
{E1013576-6257-47BA-AAFB-F95B68DAB1FF}.Release|x86.Build.0 = Release|Any CPU
1066+
{FAFF15B5-F7C4-1CE5-9A18-2F6DC93E03ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1067+
{FAFF15B5-F7C4-1CE5-9A18-2F6DC93E03ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
1068+
{FAFF15B5-F7C4-1CE5-9A18-2F6DC93E03ED}.Debug|x86.ActiveCfg = Debug|Any CPU
1069+
{FAFF15B5-F7C4-1CE5-9A18-2F6DC93E03ED}.Debug|x86.Build.0 = Debug|Any CPU
1070+
{FAFF15B5-F7C4-1CE5-9A18-2F6DC93E03ED}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
1071+
{FAFF15B5-F7C4-1CE5-9A18-2F6DC93E03ED}.Proto|Any CPU.Build.0 = Debug|Any CPU
1072+
{FAFF15B5-F7C4-1CE5-9A18-2F6DC93E03ED}.Proto|x86.ActiveCfg = Debug|Any CPU
1073+
{FAFF15B5-F7C4-1CE5-9A18-2F6DC93E03ED}.Proto|x86.Build.0 = Debug|Any CPU
1074+
{FAFF15B5-F7C4-1CE5-9A18-2F6DC93E03ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
1075+
{FAFF15B5-F7C4-1CE5-9A18-2F6DC93E03ED}.Release|Any CPU.Build.0 = Release|Any CPU
1076+
{FAFF15B5-F7C4-1CE5-9A18-2F6DC93E03ED}.Release|x86.ActiveCfg = Release|Any CPU
1077+
{FAFF15B5-F7C4-1CE5-9A18-2F6DC93E03ED}.Release|x86.Build.0 = Release|Any CPU
10221078
EndGlobalSection
10231079
GlobalSection(SolutionProperties) = preSolution
10241080
HideSolutionNode = FALSE
@@ -1099,6 +1155,7 @@ Global
10991155
{6734FC6F-B5F3-45E1-9A72-720378BB49C9} = {DFB6ADD7-3149-43D9-AFA0-FC4A818B472B}
11001156
{601CD5C1-EAFA-4AE3-8FB9-F667B5728213} = {DFB6ADD7-3149-43D9-AFA0-FC4A818B472B}
11011157
{9F9DD315-37DA-4413-928E-1CFC6924B64F} = {DFB6ADD7-3149-43D9-AFA0-FC4A818B472B}
1158+
{1E83A6C8-FA4D-42BD-B4A5-B7F9AAD1B388} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
11021159
EndGlobalSection
11031160
GlobalSection(ExtensibilityGlobals) = postSolution
11041161
SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37}

buildtools/AssemblyCheck/SkipVerifyEmbeddedPdb.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ FSharp.Benchmarks.Common.dll
33
FSharp.Compiler.Benchmarks.dll
44
FSharp.Compiler.ComponentTests.dll
55
FSharp.Test.Utilities.dll
6+
FSharp.Compiler.LanguageServer.Tests.dll
67
FSharp.Compiler.Private.Scripting.UnitTests.dll
78
FSharp.Compiler.Service.Tests.dll
89
FSharp.Core.UnitTests.dll
9-
FSharpSuite.Tests.dll
10+
FSharpSuite.Tests.dll

src/Compiler/FSharp.Compiler.Service.fsproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@
100100
<InternalsVisibleTo Include="HistoricalBenchmark" />
101101
<InternalsVisibleTo Include="FSharp.Test.Utilities" />
102102
<InternalsVisibleTo Include="FSharp.Editor" />
103+
<InternalsVisibleTo Include="FSharp.Compiler.LanguageServer" />
104+
<InternalsVisibleTo Include="FSharp.VisualStudio.Extension" />
103105
</ItemGroup>
104106

105107
<ItemGroup>

src/Compiler/Facilities/AsyncMemoize.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ module internal Utils =
104104

105105
/// Return file name with one directory above it
106106
let shortPath (path: string) =
107-
let dirPath = !! Path.GetDirectoryName(path)
107+
let dirPath = Path.GetDirectoryName(path) |> Option.ofObj |> Option.defaultValue ""
108108

109109
let dir =
110110
dirPath.Split Path.DirectorySeparatorChar
@@ -228,7 +228,7 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T
228228
|> Option.map countHit
229229
|> Option.defaultWith cacheSetNewJob
230230

231-
async {
231+
async {
232232
let otherVersions, job = lock cache getOrAdd
233233

234234
log Requested key

src/Compiler/Facilities/Hashing.fs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ module internal Md5Hasher =
4646
let private md5 =
4747
new ThreadLocal<_>(fun () -> System.Security.Cryptography.MD5.Create())
4848

49-
let computeHash (bytes: byte array) = md5.Value.ComputeHash(bytes)
49+
let computeHash (bytes: byte array) =
50+
// md5.Value.ComputeHash(bytes) TODO: the threadlocal is not working in new VS extension
51+
ignore md5
52+
let md5 = System.Security.Cryptography.MD5.Create()
53+
md5.ComputeHash(bytes)
5054

5155
let empty = Array.empty
5256

src/Compiler/Service/FSharpProjectSnapshot.fs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ and [<Experimental("This FCS API is experimental and subject to change.")>] FSha
616616
member _.OriginalLoadReferences = projectSnapshot.OriginalLoadReferences
617617
member _.Stamp = projectSnapshot.Stamp
618618
member _.OutputFileName = projectSnapshot.OutputFileName
619+
member _.ProjectConfig = projectSnapshot.ProjectConfig
619620

620621
static member Create
621622
(
@@ -747,6 +748,69 @@ and [<Experimental("This FCS API is experimental and subject to change.")>] FSha
747748

748749
FSharpProjectSnapshot.FromOptions(options, getFileSnapshot)
749750

751+
static member FromResponseFile(responseFile: FileInfo, projectFileName) =
752+
if not responseFile.Exists then
753+
failwith $"%s{responseFile.FullName} does not exist"
754+
755+
let compilerArgs = File.ReadAllLines responseFile.FullName
756+
757+
let directoryName: string =
758+
match responseFile.DirectoryName with
759+
| null -> failwith "Directory name of the response file is null"
760+
| str -> str
761+
762+
FSharpProjectSnapshot.FromCommandLineArgs(compilerArgs, directoryName, projectFileName)
763+
764+
static member FromCommandLineArgs(compilerArgs: string array, directoryPath: string, projectFileName) =
765+
let fsharpFileExtensions = set [| ".fs"; ".fsi"; ".fsx" |]
766+
767+
let isFSharpFile (file: string) =
768+
Set.exists (fun (ext: string) -> file.EndsWith(ext, StringComparison.Ordinal)) fsharpFileExtensions
769+
770+
let isReference: string -> bool = _.StartsWith("-r:")
771+
772+
let fsharpFiles =
773+
compilerArgs
774+
|> Array.choose (fun (line: string) ->
775+
if not (isFSharpFile line) then
776+
None
777+
else
778+
779+
let fullPath = Path.Combine(directoryPath, line)
780+
if not (File.Exists fullPath) then None else Some fullPath)
781+
|> Array.toList
782+
783+
let referencesOnDisk =
784+
compilerArgs |> Seq.filter isReference |> Seq.map _.Substring(3) |> Seq.toList
785+
786+
let otherOptions =
787+
compilerArgs
788+
|> Seq.filter (not << isReference)
789+
|> Seq.filter (not << isFSharpFile)
790+
|> Seq.toList
791+
792+
FSharpProjectSnapshot.Create(
793+
projectFileName = projectFileName,
794+
outputFileName = None,
795+
projectId = None,
796+
sourceFiles = (fsharpFiles |> List.map FSharpFileSnapshot.CreateFromFileSystem),
797+
referencesOnDisk =
798+
(referencesOnDisk
799+
|> List.map (fun x ->
800+
{
801+
Path = x
802+
LastModified = FileSystem.GetLastWriteTimeShim(x)
803+
})),
804+
otherOptions = otherOptions,
805+
referencedProjects = [],
806+
isIncompleteTypeCheckEnvironment = false,
807+
useScriptResolutionRules = false,
808+
loadTime = DateTime.Now,
809+
unresolvedReferences = None,
810+
originalLoadReferences = [],
811+
stamp = None
812+
)
813+
750814
let internal snapshotTable =
751815
ConditionalWeakTable<ProjectSnapshot, FSharpProjectOptions>()
752816

src/Compiler/Service/FSharpWorkspace.fs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,7 @@ type FSharpWorkspace(checker: FSharpChecker) =
4646
)
4747
)
4848

49-
member internal this.Debug_DumpMermaid(path) =
50-
let content =
51-
depGraph.Debug_RenderMermaid (function
52-
// Collapse all reference on disk nodes into one. Otherwise the graph is too big to render.
53-
| WorkspaceGraphTypes.WorkspaceNodeKey.ReferenceOnDisk _ -> WorkspaceGraphTypes.WorkspaceNodeKey.ReferenceOnDisk "..."
54-
| x -> x)
55-
56-
File.WriteAllText(__SOURCE_DIRECTORY__ + path, content)
49+
member internal _.DepGraph = depGraph
5750

5851
/// The `FSharpChecker` instance used by this workspace.
5952
member _.Checker = checker

0 commit comments

Comments
 (0)