Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Vision: enable if inlay hints disabled at all #762

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
Loading