Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit f9093c8

Browse files
authored
delete language server (dotnet#8241)
1 parent 3166853 commit f9093c8

File tree

6 files changed

+2
-141
lines changed

6 files changed

+2
-141
lines changed

Common/LspService.fs

Lines changed: 0 additions & 28 deletions
This file was deleted.

Diagnostics/DocumentDiagnosticAnalyzer.fs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ type internal FSharpDocumentDiagnosticAnalyzer [<ImportingConstructor>] () =
3434
let getProjectInfoManager(document: Document) =
3535
document.Project.Solution.Workspace.Services.GetService<FSharpCheckerWorkspaceService>().FSharpProjectOptionsManager
3636

37-
let getSettings(document: Document) =
38-
document.Project.Solution.Workspace.Services.GetService<EditorOptions>()
39-
4037
static let errorInfoEqualityComparer =
4138
{ new IEqualityComparer<FSharpErrorInfo> with
4239
member __.Equals (x, y) =
@@ -113,10 +110,6 @@ type internal FSharpDocumentDiagnosticAnalyzer [<ImportingConstructor>] () =
113110
interface IFSharpDocumentDiagnosticAnalyzer with
114111

115112
member this.AnalyzeSyntaxAsync(document: Document, cancellationToken: CancellationToken): Task<ImmutableArray<Diagnostic>> =
116-
// if using LSP, just bail early
117-
let settings = getSettings document
118-
if settings.Advanced.UsePreviewDiagnostics then Task.FromResult(ImmutableArray<Diagnostic>.Empty)
119-
else
120113
let projectInfoManager = getProjectInfoManager document
121114
asyncMaybe {
122115
let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken)
@@ -130,10 +123,6 @@ type internal FSharpDocumentDiagnosticAnalyzer [<ImportingConstructor>] () =
130123
|> RoslynHelpers.StartAsyncAsTask cancellationToken
131124

132125
member this.AnalyzeSemanticsAsync(document: Document, cancellationToken: CancellationToken): Task<ImmutableArray<Diagnostic>> =
133-
// if using LSP, just bail early
134-
let settings = getSettings document
135-
if settings.Advanced.UsePreviewDiagnostics then Task.FromResult(ImmutableArray<Diagnostic>.Empty)
136-
else
137126
let projectInfoManager = getProjectInfoManager document
138127
asyncMaybe {
139128
let! parsingOptions, _, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document, cancellationToken)

FSharp.Editor.fsproj

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
<Compile Include="Common\RoslynHelpers.fs" />
3636
<Compile Include="Common\CodeAnalysisExtensions.fs" />
3737
<Compile Include="Common\Vs.fs" />
38-
<Compile Include="$(FSharpSourcesRoot)\fsharp\FSharp.Compiler.LanguageServer\LspExternalAccess.fs">
39-
<Link>Common\LspExternalAccess.fs</Link>
40-
</Compile>
41-
<Compile Include="Common\LspService.fs" />
4238
<Compile Include="Options\SettingsPersistence.fs" />
4339
<Compile Include="Options\UIHelpers.fs" />
4440
<Compile Include="Options\EditorOptions.fs" />
@@ -55,10 +51,6 @@
5551
<Compile Include="LanguageService\SingleFileWorkspaceMap.fs" />
5652
<Compile Include="LanguageService\LegacyProjectWorkspaceMap.fs" />
5753
<Compile Include="LanguageService\LanguageService.fs" />
58-
<Compile Include="$(FSharpSourcesRoot)\fsharp\FSharp.Compiler.LanguageServer\JsonOptionConverter.fs">
59-
<Link>LanguageService\JsonOptionConverter.fs</Link>
60-
</Compile>
61-
<Compile Include="LanguageService\FSharpLanguageClient.fs" Condition="'$(IncludeVsLanguageServer)' == 'true'" />
6254
<Compile Include="LanguageService\AssemblyContentProvider.fs" />
6355
<Compile Include="LanguageService\SymbolHelpers.fs" />
6456
<Compile Include="Classification\ClassificationDefinitions.fs" />
@@ -122,7 +114,6 @@
122114
<ItemGroup>
123115
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj" />
124116
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj" />
125-
<ProjectReference Include="..\FSharp.Editor.Helpers\FSharp.Editor.Helpers.csproj" />
126117
<ProjectReference Include="..\FSharp.PatternMatcher\FSharp.PatternMatcher.csproj" />
127118
<ProjectReference Include="..\FSharp.UIResources\FSharp.UIResources.csproj" />
128119
<ProjectReference Include="..\FSharp.VS.FSI\FSharp.VS.FSI.fsproj" />
@@ -151,7 +142,6 @@
151142
<PackageReference Include="Microsoft.VisualStudio.Language.Intellisense" Version="$(MicrosoftVisualStudioLanguageIntellisenseVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
152143
<PackageReference Include="Microsoft.VisualStudio.Language.StandardClassification" Version="$(MicrosoftVisualStudioLanguageStandardClassificationVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
153144
<PackageReference Include="Microsoft.VisualStudio.LanguageServices" Version="$(MicrosoftVisualStudioLanguageServicesVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
154-
<PackageReference Include="Microsoft.VisualStudio.LanguageServer.Client" Version="$(MicrosoftVisualStudioLanguageServerClientVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
155145
<PackageReference Include="Microsoft.VisualStudio.Package.LanguageService.15.0" Version="$(MicrosoftVisualStudioPackageLanguageService150Version)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
156146
<PackageReference Include="Microsoft.VisualStudio.ProjectAggregator" Version="$(MicrosoftVisualStudioProjectAggregatorVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
157147
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem" Version="$(MicrosoftVisualStudioProjectSystemVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />

LanguageService/FSharpLanguageClient.fs

Lines changed: 0 additions & 70 deletions
This file was deleted.

Options/EditorOptions.fs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ open System.ComponentModel.Composition
55
open System.Runtime.InteropServices
66
open System.Windows
77
open System.Windows.Controls
8-
open FSharp.Compiler.LanguageServer
98
open Microsoft.VisualStudio.Shell
109
open Microsoft.VisualStudio.FSharp.UIResources
1110

@@ -92,17 +91,10 @@ type CodeLensOptions =
9291
[<CLIMutable>]
9392
type AdvancedOptions =
9493
{ IsBlockStructureEnabled: bool
95-
IsOutliningEnabled: bool
96-
UsePreviewTextHover: bool
97-
UsePreviewDiagnostics: bool }
94+
IsOutliningEnabled: bool }
9895
static member Default =
9996
{ IsBlockStructureEnabled = true
100-
IsOutliningEnabled = true
101-
UsePreviewTextHover = false
102-
UsePreviewDiagnostics = false }
103-
member this.AsLspOptions(): Options =
104-
{ usePreviewTextHover = this.UsePreviewTextHover
105-
usePreviewDiagnostics = this.UsePreviewDiagnostics }
97+
IsOutliningEnabled = true }
10698

10799
[<CLIMutable>]
108100
type FormattingOptions =
@@ -203,14 +195,6 @@ module internal OptionsUI =
203195
inherit AbstractOptionPage<AdvancedOptions>()
204196
override __.CreateView() =
205197
upcast AdvancedOptionsControl()
206-
override this.OnApply(args) =
207-
base.OnApply(args)
208-
async {
209-
let lspService = this.GetService<LspService>()
210-
let settings = this.GetService<EditorOptions>()
211-
let options = settings.Advanced.AsLspOptions()
212-
do! lspService.SetOptions options
213-
} |> Async.Start
214198

215199
[<Guid(Guids.formattingOptionPageIdString)>]
216200
type internal FormattingOptionPage() =

QuickInfo/QuickInfoProvider.fs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,6 @@ type internal FSharpAsyncQuickInfoSource
206206
// This method can be called from the background thread.
207207
// Do not call IServiceProvider.GetService here.
208208
override __.GetQuickInfoItemAsync(session:IAsyncQuickInfoSession, cancellationToken:CancellationToken) : Task<QuickInfoItem> =
209-
// The following lines should be disabled for branch `release/dev16.2`, enabled otherwise
210-
//// if using LSP, just bail early
211-
//if settings.Advanced.UsePreviewTextHover then Task.FromResult<QuickInfoItem>(null)
212-
//else
213209
let triggerPoint = session.GetTriggerPoint(textBuffer.CurrentSnapshot)
214210
match triggerPoint.HasValue with
215211
| false -> Task.FromResult<QuickInfoItem>(null)

0 commit comments

Comments
 (0)