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

QuickFix for ValueNotContainedMutabilityLiteralConstantValuesDiffer #546

Draft
wants to merge 25 commits into
base: net233
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b5f622a
Quickfix for difference in mutability in signature file.
nojaf Jul 5, 2023
676ef15
Update error message in the ID.
nojaf Jul 5, 2023
3e7d62e
Start working on quickfix for ValueNotContainedMutabilityLiteralConst…
dawedawe Jul 6, 2023
b94f311
rename
dawedawe Jul 7, 2023
243dc20
refactor
dawedawe Jul 7, 2023
9c36e72
update type in signature file if needed
dawedawe Jul 7, 2023
d6b0b5e
add test case with inline comments
dawedawe Jul 7, 2023
3139293
rename error to LiteralConstantValuesDifferError, no need to use the …
dawedawe Jul 10, 2023
1cd7b7c
format changes
dawedawe Jul 10, 2023
215b53a
check if type of impl can be resolved in sig before making fix available
dawedawe Jul 10, 2023
38dd977
- handle Literals with other Literals as their expression
dawedawe Jul 10, 2023
c2461c2
add test for complex expressions fom lang preview
dawedawe Jul 10, 2023
12c4470
improve naming of tests
dawedawe Jul 11, 2023
eb494d3
add overload of ResolveWithFcs that takes a context node
dawedawe Jul 12, 2023
cf75f65
add test with parens in the pattern
dawedawe Jul 12, 2023
3b96855
- improve naming
dawedawe Jul 12, 2023
119aca3
Add validation of binary expressions
dawedawe Jul 12, 2023
e8d43c8
the FCS error can also mean that the impl side lacks the Literal attr…
dawedawe Jul 13, 2023
4cf1127
- use IgnoreInnerParens()
dawedawe Jul 13, 2023
fc3f30a
tighten match of expression
dawedawe Jul 14, 2023
9b12f36
rename "UpdateLiteralConstantFix" to "UpdateLiteralConstantInSignatur…
dawedawe Jul 14, 2023
71d8675
rename error from "LiteralConstantValuesDiffer" to "LiteralConstantVa…
dawedawe Jul 14, 2023
18b5e8c
for the time being, don't offer the fix for measure constants
dawedawe Jul 26, 2023
35a4825
Support validation checks for Constants with units of measure types
dawedawe Jul 27, 2023
884e2a6
Don't update the return type for UoM as FSharpType.Format is currentl…
dawedawe Aug 23, 2023
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
Prev Previous commit
Next Next commit
- use IgnoreInnerParens()
- pass opName to ResolveWithFcs
- pass true as resolveExpr to ResolveWithFcs
- pass true as qualified to ResolveWithFcs
  • Loading branch information
dawedawe committed Aug 22, 2023
commit 4cf1127e28d8a6bf8f24b95a45131c18527f1a6b
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace JetBrains.ReSharper.Plugins.FSharp.Psi.Features.Daemon.QuickFixes

open FSharp.Compiler.Symbols
open JetBrains.ReSharper.Plugins.FSharp.Psi
open JetBrains.ReSharper.Plugins.FSharp.Psi.Impl
open JetBrains.ReSharper.Plugins.FSharp.Psi.Tree
open JetBrains.ReSharper.Plugins.FSharp.Psi.Features.Daemon.Highlightings
open JetBrains.ReSharper.Plugins.FSharp.Psi.Features.Util
Expand Down Expand Up @@ -46,9 +47,10 @@ type UpdateLiteralConstantFix(error: LiteralConstantValuesDifferError) =
let mutable sigRefPat = null

let rec isImplExprValidInSig (implExpression: IFSharpExpression) =
match implExpression with
match implExpression.IgnoreInnerParens() with
| :? IReferenceExpr as refExpr ->
refExpr.Reference.ResolveWithFcs(sigRefPat, System.String.Empty, false, refExpr.IsQualified)
refExpr.Reference.ResolveWithFcs(
sigRefPat, $"{nameof UpdateLiteralConstantFix}.IsAvailable", true, true)
|> Option.isSome
| :? IBinaryAppExpr as binExpr ->
isImplExprValidInSig binExpr.LeftArgument && isImplExprValidInSig binExpr.RightArgument
Expand Down