Skip to content

Commit

Permalink
Code Vision: enable if inlay hints are disabled (#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
DedSec256 authored Dec 3, 2024
1 parent 3509a65 commit 5f7806a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ open JetBrains.Application.Settings
open JetBrains.Application.UI.Components
open JetBrains.Application.UI.PopupLayout
open JetBrains.Application.UI.Tooltips
open JetBrains.ProjectModel
open JetBrains.RdBackend.Common.Platform.CodeInsights
open JetBrains.ReSharper.Daemon.CodeInsights
open JetBrains.ReSharper.Feature.Services.Daemon
open JetBrains.RdBackend.Common.Features.Services
open JetBrains.ReSharper.Plugins.FSharp
open JetBrains.ReSharper.Plugins.FSharp.Psi.Daemon.Options
open JetBrains.ReSharper.Plugins.FSharp.Psi.Daemon.Resources
open JetBrains.ReSharper.Plugins.FSharp.Psi.Features.Daemon.Stages
open JetBrains.ReSharper.Plugins.FSharp.Psi.Features.Util
Expand All @@ -27,6 +24,7 @@ open JetBrains.ReSharper.Resources.Shell
open JetBrains.Rider.Model
open JetBrains.TextControl.DocumentMarkup
open JetBrains.TextControl.DocumentMarkup.Adornments
open JetBrains.TextControl.DocumentMarkup.Adornments.IntraTextAdornments
open JetBrains.Util

module FSharpInferredTypeHighlighting =
Expand Down Expand Up @@ -143,6 +141,8 @@ and InferredTypeCodeVisionProviderProcess(fsFile, settings, daemonProcess, provi
not Shell.Instance.IsTestShell &&

settingsStore.GetIndexedValue((fun (key: CodeInsightsSettings) -> key.DisabledProviders), FSharpInferredTypeHighlighting.providerId) ||

settingsStore.GetValue(fun (key: GeneralInlayHintsOptions) -> key.EnableInlayHints) &&
settingsStore.GetValue(fun (key: FSharpTypeHintOptions) -> key.ShowTypeHintsForTopLevelMembers)
.EnsureInlayHintsDefault(settingsStore) <> PushToHintMode.Never

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Module

let x = 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Module

let |x|(0) = 1

---------------------------------------------------------
(0): CodeInsights: int
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ open JetBrains.ReSharper.Plugins.FSharp.Psi.Daemon.Stages
open JetBrains.ReSharper.Plugins.FSharp.Settings
open JetBrains.ReSharper.TestFramework
open JetBrains.TextControl.DocumentMarkup.Adornments
open JetBrains.TextControl.DocumentMarkup.Adornments.IntraTextAdornments
open NUnit.Framework

[<TestSetting(typeof<FSharpTypeHintOptions>, "ShowTypeHintsForTopLevelMembers", PushToHintMode.Never)>]
Expand All @@ -25,3 +26,7 @@ type InferredTypeCodeVisionProviderTest() =
[<Test>] member x.``Binding - As 01``() = x.DoNamedTest()
[<Test>] member x.``Binding - As 02 - Tuple``() = x.DoNamedTest()
[<Test>] member x.``Binding - Paren 01``() = x.DoNamedTest()

[<TestSetting(typeof<GeneralInlayHintsOptions>, "EnableInlayHints", false)>]
[<TestSetting(typeof<FSharpTypeHintOptions>, "ShowTypeHintsForTopLevelMembers", PushToHintMode.Always)>]
[<Test>] member x.``Availability - Disabled inlay hints 01``() = x.DoNamedTest()

0 comments on commit 5f7806a

Please sign in to comment.