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

Commit cc001ca

Browse files
brettfonosami
authored andcommitted
delete language server (dotnet#8241)
1 parent 08e5c00 commit cc001ca

File tree

6 files changed

+74
-131
lines changed

6 files changed

+74
-131
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) =
@@ -123,10 +120,6 @@ type internal FSharpDocumentDiagnosticAnalyzer [<ImportingConstructor>] () =
123120
interface IFSharpDocumentDiagnosticAnalyzer with
124121

125122
member this.AnalyzeSyntaxAsync(document: Document, cancellationToken: CancellationToken): Task<ImmutableArray<Diagnostic>> =
126-
// if using LSP, just bail early
127-
let settings = getSettings document
128-
if settings.Advanced.UsePreviewDiagnostics then Task.FromResult(ImmutableArray<Diagnostic>.Empty)
129-
else
130123
let projectInfoManager = getProjectInfoManager document
131124
asyncMaybe {
132125
let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken)
@@ -140,10 +133,6 @@ type internal FSharpDocumentDiagnosticAnalyzer [<ImportingConstructor>] () =
140133
|> RoslynHelpers.StartAsyncAsTask cancellationToken
141134

142135
member this.AnalyzeSemanticsAsync(document: Document, cancellationToken: CancellationToken): Task<ImmutableArray<Diagnostic>> =
143-
// if using LSP, just bail early
144-
let settings = getSettings document
145-
if settings.Advanced.UsePreviewDiagnostics then Task.FromResult(ImmutableArray<Diagnostic>.Empty)
146-
else
147136
let projectInfoManager = getProjectInfoManager document
148137
asyncMaybe {
149138
let! parsingOptions, _, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document, cancellationToken)

FSharp.Editor.fsproj

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
<Compile Include="Common\CompilerService.fs" />
9999
<Compile Include="Common\FSharpProject.fs" />
100100
<Compile Include="Common\LanguageService.fs" />
101+
<Compile Include="Common\Vs.fs" />
101102
<Compile Include="Options\SettingsPersistence.fs" />
102103
<None Include="Options\UIHelpers.fs" />
103104
<None Include="Options\EditorOptions.fs" />
@@ -274,6 +275,77 @@
274275
<Compile Include="VSMac\FSharpProjectFileNodeExtension.fs" />
275276
<Compile Include="VSMac\FSharpSymbolHelper.fs" />
276277
<Compile Include="VSMac\GlobalSearch.fs" />
278+
<Compile Include="CodeLens\AbstractCodeLensDisplayService.fs" />
279+
<Compile Include="CodeLens\CodeLensGeneralTagger.fs" />
280+
<Compile Include="CodeLens\LineLensDisplayService.fs" />
281+
<Compile Include="CodeLens\FSharpCodeLensService.fs" />
282+
<Compile Include="CodeLens\CodeLensProvider.fs" />
283+
</ItemGroup>
284+
285+
<ItemGroup>
286+
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj" />
287+
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj" />
288+
<ProjectReference Include="..\FSharp.PatternMatcher\FSharp.PatternMatcher.csproj" />
289+
<ProjectReference Include="..\FSharp.UIResources\FSharp.UIResources.csproj" />
290+
<ProjectReference Include="..\FSharp.VS.FSI\FSharp.VS.FSI.fsproj" />
291+
</ItemGroup>
292+
293+
<ItemGroup>
294+
<Reference Include="PresentationCore" />
295+
<Reference Include="PresentationFramework" />
296+
<Reference Include="System.Runtime.Caching" />
297+
<Reference Include="System.Windows.Forms" />
298+
<Reference Include="System.Xaml" />
299+
<Reference Include="WindowsBase" />
300+
</ItemGroup>
301+
302+
<ItemGroup>
303+
<PackageReference Include="EnvDTE80" Version="$(EnvDTE80Version)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
304+
<PackageReference Include="Microsoft.CodeAnalysis.EditorFeatures" Version="$(MicrosoftCodeAnalysisEditorFeaturesVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
305+
<PackageReference Include="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="$(MicrosoftCodeAnalysisEditorFeaturesTextVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
306+
<PackageReference Include="Microsoft.CodeAnalysis.EditorFeatures.Wpf" Version="$(MicrosoftCodeAnalysisEditorFeaturesWpfVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
307+
<PackageReference Include="Microsoft.CodeAnalysis.ExternalAccess.FSharp" Version="$(MicrosoftCodeAnalysisExternalAccessFSharpVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
308+
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="$(MicrosoftCodeAnalysisWorkspacesCommonVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
309+
<PackageReference Include="Microsoft.Composition" Version="$(MicrosoftCompositionVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
310+
<PackageReference Include="Microsoft.VisualStudio.ComponentModelHost" Version="$(MicrosoftVisualStudioComponentModelHostVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
311+
<PackageReference Include="Microsoft.VisualStudio.Editor" Version="$(MicrosoftVisualStudioEditorVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
312+
<PackageReference Include="Microsoft.VisualStudio.Language" Version="$(MicrosoftVisualStudioLanguageVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
313+
<PackageReference Include="Microsoft.VisualStudio.Language.Intellisense" Version="$(MicrosoftVisualStudioLanguageIntellisenseVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
314+
<PackageReference Include="Microsoft.VisualStudio.Language.StandardClassification" Version="$(MicrosoftVisualStudioLanguageStandardClassificationVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
315+
<PackageReference Include="Microsoft.VisualStudio.LanguageServices" Version="$(MicrosoftVisualStudioLanguageServicesVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
316+
<PackageReference Include="Microsoft.VisualStudio.Package.LanguageService.15.0" Version="$(MicrosoftVisualStudioPackageLanguageService150Version)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
317+
<PackageReference Include="Microsoft.VisualStudio.ProjectAggregator" Version="$(MicrosoftVisualStudioProjectAggregatorVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
318+
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem" Version="$(MicrosoftVisualStudioProjectSystemVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
319+
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.Managed" Version="$(MicrosoftVisualStudioProjectSystemManagedVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
320+
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" Version="$(MicrosoftVisualStudioShell150Version)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
321+
<PackageReference Include="Microsoft.VisualStudio.Shell.Design" Version="$(MicrosoftVisualStudioShellDesignVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
322+
<PackageReference Include="Microsoft.VisualStudio.Shell.Immutable.10.0" Version="$(MicrosoftVisualStudioShellImmutable100Version)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
323+
<PackageReference Include="Microsoft.VisualStudio.Shell.Immutable.11.0" Version="$(MicrosoftVisualStudioShellImmutable110Version)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
324+
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.11.0" Version="$(MicrosoftVisualStudioShellInterop110Version)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
325+
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.12.0" Version="$(MicrosoftVisualStudioShellInterop120Version)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
326+
<PackageReference Include="Microsoft.VisualStudio.Text.UI" Version="$(MicrosoftVisualStudioTextUIVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
327+
<PackageReference Include="Microsoft.VisualStudio.Text.UI.Wpf" Version="$(MicrosoftVisualStudioTextUIWpfVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
328+
<PackageReference Include="Microsoft.VisualStudio.TextManager.Interop" Version="$(MicrosoftVisualStudioTextManagerInteropVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
329+
<PackageReference Include="Microsoft.VisualStudio.TextManager.Interop.12.0" Version="$(MicrosoftVisualStudioTextManagerInterop120Version)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
330+
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="$(MicrosoftVisualStudioThreadingVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
331+
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
332+
<PackageReference Include="System.Design" Version="$(SystemDesignVersion)" />
333+
<PackageReference Include="System.ValueTuple" Version="$(SystemValueTupleVersion)" />
334+
<PackageReference Include="VSSDK.VSLangProj" Version="$(VSSDKVSLangProjVersion)" PrivateAssets="all" ExcludeAssets="runtime;contentFiles;build;analyzers;native" />
335+
<PackageReference Include="StreamJsonRpc" Version="$(StreamJsonRpcVersion)" />
336+
</ItemGroup>
337+
338+
<ItemGroup>
339+
<AssemblyAttribute Include="Microsoft.VisualStudio.Shell.ProvideCodeBaseAttribute">
340+
<AssemblyName>FSharp.Editor</AssemblyName>
341+
<Version>$(VSAssemblyVersion)</Version>
342+
<CodeBase>$PackageFolder$\FSharp.Editor.dll</CodeBase>
343+
</AssemblyAttribute>
344+
<AssemblyAttribute Include="Microsoft.VisualStudio.Shell.ProvideCodeBaseAttribute">
345+
<AssemblyName>FSharp.UIResources</AssemblyName>
346+
<Version>$(VSAssemblyVersion)</Version>
347+
<CodeBase>$PackageFolder$\FSharp.UIResources.dll</CodeBase>
348+
</AssemblyAttribute>
277349
</ItemGroup>
278350
<ProjectExtensions>
279351
<MonoDevelop>

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
@@ -203,10 +203,6 @@ type internal FSharpAsyncQuickInfoSource
203203
// This method can be called from the background thread.
204204
// Do not call IServiceProvider.GetService here.
205205
override __.GetQuickInfoItemAsync(session:IAsyncQuickInfoSession, cancellationToken:CancellationToken) : Task<QuickInfoItem> =
206-
// The following lines should be disabled for branch `release/dev16.2`, enabled otherwise
207-
//// if using LSP, just bail early
208-
//if settings.Advanced.UsePreviewTextHover then Task.FromResult<QuickInfoItem>(null)
209-
//else
210206
let triggerPoint = session.GetTriggerPoint(textBuffer.CurrentSnapshot)
211207
match triggerPoint.HasValue with
212208
| false -> Task.FromResult<QuickInfoItem>(null)

0 commit comments

Comments
 (0)