ionide / ionide/FsAutoComplete

unnecessary parentheses analyzer trigger in chained function call

Open
#1,362 8 comments 1 reaction 0 assignees View on GitHub
bug needs investigation
Dominant language
F#
Stars
486
Forks
169
Avg merge
2d 8h
Merged PRs (30d)
5

Description

### Version

v0.77.2

### Dotnet Info

.NET SDK:
Version: 8.0.403
Commit: c64aa40a71
Workload version: 8.0.400-manifests.e0880c5d
MSBuild version: 17.11.9+a69bbaaf5

Runtime Environment:
OS Name: Mac OS X
OS Version: 15.0
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/8.0.403/

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
Version: 9.0.0
Architecture: arm64
Commit: 9d5a6a9aa4

.NET SDKs installed:
6.0.427 [/usr/local/share/dotnet/sdk]
7.0.410 [/usr/local/share/dotnet/sdk]
8.0.303 [/usr/local/share/dotnet/sdk]
8.0.403 [/usr/local/share/dotnet/sdk]
9.0.101 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.35 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.31 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.32 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.35 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-preview.6.24327.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-rc.2.24473.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

### Steps to reproduce

Call a member function that takes at least one argument with parens that is followed by another function:

```fsharp
bg.lighten(0.2).hexa ()
```

The `Parentheses can be removed` warning is triggered for the `(0.2)` argument, even thought applying the quick fix will result in the invalid expression

```fsharp
bg.lighten 0.2.hexa ()
```

### Details

- Expected behavior: on warning should be triggered when a function application in a chain of calls requires parens to disambiguate it
- Actual behavior: a warning is issues for a valid expression, and an invalid quick fix is applied

### Logs

_No response_

### Checklist

- [x] I have looked through existing issues to make sure that this bug has not been reported before
- [x] I have provided a descriptive title for this issue
- [x] I have made sure that that this bug is reproducible on the latest version of the package
- [x] I have provided all the information needed to reproduce this bug as efficiently as possible
- [x] I or my company would be willing to contribute this fix

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.