-
Notifications
You must be signed in to change notification settings - Fork 0
Add inferred type hint stage #1
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
Conversation
saul
commented
Apr 2, 2020
Unfortunately Rider doesn’t (yet) support rich text hints or click interactivity, so the style must stay as it is now. |
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.
@saul It looks really great, thank you!
ReSharper.FSharp/src/FSharp.Psi.Features/src/Daemon/Stages/InferredTypeHintStage.fs
Outdated
Show resolved
Hide resolved
| :? ILocalBinding as localBinding when localBinding.ReturnTypeInfo <> null -> () | ||
| _ -> | ||
|
||
match localRefPat.Identifier.As<FSharpIdentifierToken>() with |
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.
This is fine and is used in some places already, though, I'm trying to shape up some API for easier getting the identifier. Something like the following could work well too.
NameIdentifier may be compound here, like for active patterns or type parameters.
if isNull localRefPat.NameIdentifier.IdentifierToken then () else
| null -> () | ||
| symbolUse -> | ||
|
||
let symbolUse = symbolUse :?> FSharpSymbolUse |
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.
I think I should really add an overload taking a properly typed outref parameter here. :)
* Update InferredTypeCodeVisionProvider.fs * Split into PipeChainCodeVisionProvider * Create Multi line.fs.gold * Hook into the tooltip for the |> operator * Update Multi line.fs.gold * Add TypeHintsAdornmentProvider * Update TypeHintsAdornmentProvider.fs * Update TypeHintsAdornmentProvider.fs * Markups * Update TypeHintsAdornmentProvider.fs * Add more tests * Add new lines * Add setting * Update TypeHintAdornmentStage.fs * Add option to 'Hide when |> is on same line as argument' * Invalidate highlighting on type hint setting change * Update TypeHintAdornmentStage.fs * Update TypeHintAdornmentStage.fs * Use {HideSameLine:All} in tests * Reorganisation * Delete ReSharper.FSharp.sln.DotSettings.user * Code style * More code style changes * Markups
…pat-hints # Conflicts: # ReSharper.FSharp/src/FSharp.Common/src/Settings/FSharpOptions.fs # ReSharper.FSharp/src/FSharp.Psi.Features/FSharp.Psi.Features.fsproj # ReSharper.FSharp/test/src/FSharp.Tests/FSharp.Tests.fsproj
The initial name comes from Ast.SynExpr used in FCS for syntax tree expressions nodes. F# PSI expressions were initially made to have an identical structure to the FCS ones and having similar names helped too. Over the time F# PSI expression nodes have changed and no longer correspond to the FCS expression structure closely. Having names similar to ReSharper ones seems to be better at this point.
* Change grammar rules for enum declaration * Add alignment rules For match clauses, union cases, enum cases and seq expressions * Add rule for binary expr alignment * Add tests for alignment rules * Add tests for ToRecursive actions * Add more tests for seq expr * Add indenting rules for match expressions * Mark union case list, add indenting rule for cases in union representation * Add alignment rule for union representation node * Remove unnecessary check for modifier
* StaticSeverityHighlighting * RegisterHighlighterGroup * RegisterHighlighter * JetBrains.Application.UI.Icons.Images.TiImage -> JetBrains.Util.Icons.TiImage * CodeFormatterBase * FormatterInfoProviderWithFluentApi * IHighlightingsCleanupItem
* Listen to PSI changes instead of project model * Mark modules to invalidate dirty, don't process during the change * Store references to module to invalidate when creating FCS project * Rename FSharpProjectOptionsProvider -> FcsProjectProvider * Rename FSharpProjectOptionsBuilder -> FcsProjectBuilder
* Move element factory to FSharp.Psi * Cleanup utils
Splitting back to separate parameters would be great, but it also needs support for abstract members and accessors
* WIP improve reactor monitor * Add trace scenario, add busy delay registry setting * Oops * Remove unused type * Markups * Fix dodgy rebase * Monitor more operations
* Cover SynType.Paren * Fix indexer arg range
I see this PR is now here: JetBrains#118 |