-
Notifications
You must be signed in to change notification settings - Fork 55
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
Daemon/Stages/Patterns: add inlay type hints #733
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ce6b5b4
wip
DedSec256 797a692
fix
DedSec256 96eeeea
fix
DedSec256 2f055c5
Mode tests
DedSec256 7cfa0be
cleanup
DedSec256 b8aad0b
fix
DedSec256 400405d
review fixes 1
DedSec256 d4f52b9
review fixes 2
DedSec256 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
ReSharper.FSharp/src/FSharp/FSharp.Common/Resources/Strings.Designer.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// <auto-generated/> | ||
namespace JetBrains.ReSharper.Plugins.FSharp.Resources | ||
|
||
open System | ||
open JetBrains.Application.I18n | ||
open JetBrains.DataFlow | ||
open JetBrains.Diagnostics | ||
open JetBrains.Lifetimes | ||
open JetBrains.Util | ||
open JetBrains.Util.Logging | ||
open JetBrains.Application.I18n.Plurals | ||
|
||
[<global.System.Diagnostics.DebuggerNonUserCode>] | ||
[<global.System.Runtime.CompilerServices.CompilerGenerated>] | ||
type public Strings() = | ||
static let logger = Logger.GetLogger("JetBrains.ReSharper.Plugins.FSharp.Resources.Strings") | ||
|
||
static let mutable resourceManager = null | ||
|
||
static do | ||
CultureContextComponent.Instance.Change.Advise(Lifetime.Eternal, fun (args:PropertyChangedEventArgs<CultureContextComponent>) -> | ||
let instance = if args.HasNew then args.New else null | ||
if instance <> null then | ||
resourceManager <- Lazy<JetResourceManager>(fun _ -> | ||
instance.CreateResourceManager("JetBrains.ReSharper.Plugins.FSharp.Resources.Strings", | ||
typeof<Strings>.Assembly)) | ||
else | ||
resourceManager <- null) | ||
|
||
[<global.System.ComponentModel.EditorBrowsable(global.System.ComponentModel.EditorBrowsableState.Advanced)>] | ||
static member ResourceManager: JetResourceManager = | ||
match resourceManager with | ||
| null -> ErrorJetResourceManager.Instance | ||
| _ -> resourceManager.Value | ||
|
||
static member Choice(format: string, [<ParamArray>] args: Object array): string = | ||
match Strings.ResourceManager.ChoiceFormatter with | ||
| null -> "???" | ||
| formatter -> String.Format(formatter, format, args) | ||
|
||
static member FSharpTypeHints_TopLevelMembers_Description = Strings.ResourceManager.GetString("FSharpTypeHints_TopLevelMembers_Description") | ||
static member FSharpTypeHints_LocalBindings_Description = Strings.ResourceManager.GetString("FSharpTypeHints_LocalBindings_Description") |
25 changes: 25 additions & 0 deletions
25
ReSharper.FSharp/src/FSharp/FSharp.Common/Resources/Strings.resx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<root> | ||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | ||
<xsd:element name="root" msdata:IsDataSet="true"> | ||
</xsd:element> | ||
</xsd:schema> | ||
<resheader name="resmimetype"> | ||
<value>text/microsoft-resx</value> | ||
</resheader> | ||
<resheader name="version"> | ||
<value>1.3</value> | ||
</resheader> | ||
<resheader name="reader"> | ||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
<resheader name="writer"> | ||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
<data name="FSharpTypeHints_TopLevelMembers_Description" xml:space="preserve"> | ||
<value>Type hints for top-level bindings and type members</value> | ||
</data> | ||
<data name="FSharpTypeHints_LocalBindings_Description" xml:space="preserve"> | ||
<value>Type hints for local bindings</value> | ||
</data> | ||
</root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
ReSharper.FSharp/src/FSharp/FSharp.Psi.Daemon/src/Options/FSharpTypeHintOptionsPage.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
namespace JetBrains.ReSharper.Plugins.FSharp.Psi.Daemon.Options | ||
|
||
open System.Runtime.InteropServices | ||
open JetBrains.Application.UI.Options | ||
open JetBrains.Application.UI.Options.OptionsDialog | ||
open JetBrains.IDE.UI.Options | ||
open JetBrains.Lifetimes | ||
open JetBrains.ReSharper.Feature.Services.InlayHints | ||
open JetBrains.ReSharper.Plugins.FSharp.Psi.Daemon.Resources | ||
open JetBrains.ReSharper.Plugins.FSharp.Settings | ||
|
||
[<OptionsPage(nameof(FSharpInlayHintsPage), | ||
"F#", | ||
null, | ||
Sequence = 3., | ||
ParentId = InlayHintsOptionsPage.PID, | ||
NameResourceType = typeof<Strings>, | ||
NameResourceName = nameof(Strings.FSharpOptionPageTitle))>] | ||
type FSharpInlayHintsPage(lifetime: Lifetime, optionsPageContext: OptionsPageContext, optionsSettingsSmartContext: OptionsSettingsSmartContext, [<Optional; DefaultParameterValue(false)>] wrapInScrollablePanel) = | ||
inherit BeSimpleOptionsPage(lifetime, optionsPageContext, optionsSettingsSmartContext, wrapInScrollablePanel) | ||
|
||
|
||
[<OptionsPage(nameof(FSharpTypeHintsOptionsPage), | ||
"Type Hints", | ||
null, | ||
ParentId = nameof(FSharpInlayHintsPage), | ||
NestingType = OptionPageNestingType.Child, | ||
Sequence = 1., | ||
NameResourceType = typeof<Strings>, | ||
NameResourceName = nameof(Strings.FSharpTypeHints_OptionsPage_Title))>] | ||
type FSharpTypeHintsOptionsPage(lifetime: Lifetime, optionsPageContext: OptionsPageContext, | ||
optionsSettingsSmartContext: OptionsSettingsSmartContext) as this = | ||
inherit InlayHintsOptionPageBase(lifetime, optionsPageContext, optionsSettingsSmartContext, optionsPageContext.IsReSharper) | ||
auduchinok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
do | ||
this.AddVisibilityHelpText() | ||
|
||
this.AddHeader(Strings.FSharpTypeHints_TopLevelMembersSettings_Header) |> ignore | ||
this.AddVisibilityOption(fun (s: FSharpTypeHintOptions) -> s.ShowTypeHintsForTopLevelMembers) | ||
this.AddCommentText(Strings.FSharpTypeHints_TopLevelMembersSettings_Comment) | ||
|
||
this.AddHeader(Strings.FSharpTypeHints_LocalBindingsSettings_Header) |> ignore | ||
this.AddVisibilityOption(fun (s: FSharpTypeHintOptions) -> s.ShowTypeHintsForLocalBindings) |
13 changes: 13 additions & 0 deletions
13
...rper.FSharp/src/FSharp/FSharp.Psi.Daemon/src/Options/FSharpTypeHintsOptionsRegistrator.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace JetBrains.ReSharper.Plugins.FSharp.Psi.Daemon.Options | ||
|
||
open JetBrains.Application.Parts | ||
open JetBrains.Application.Settings | ||
open JetBrains.ProjectModel | ||
open JetBrains.ReSharper.Feature.Services.InlayHints | ||
open JetBrains.ReSharper.Plugins.FSharp.Settings | ||
|
||
[<SolutionComponent(InstantiationEx.LegacyDefault)>] | ||
type FSharpTypeHintsOptionsRegistrator(inlayHintsOptionsStore: InlayHintsOptionsStore, settingsStore: ISettingsStore) = | ||
do | ||
let settingsKey = settingsStore.Schema.GetKey<FSharpTypeHintOptions>() | ||
inlayHintsOptionsStore.RegisterSettingsKeyToRehighlightVisibleDocumentOnItsChange(settingsKey) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can make a different default here, but this one seemed most appropriate to me