ionide / FsAutoComplete

F# language server using Language Server Protocol
Other
385 stars 151 forks source link

`get ()` should not be renamed when renaming a property #1269

Open MangelMaxime opened 2 months ago

MangelMaxime commented 2 months ago

Version

Ionide v7.18.2

Dotnet Info

.NET SDK: Version: 8.0.204 Commit: c338c7548c Workload version: 8.0.200-manifests.9f663350

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

.NET workloads installed: There are no installed workloads to display.

Host: Version: 8.0.4 Architecture: arm64 Commit: 2d7eea2529

.NET SDKs installed: 6.0.416 [/usr/local/share/dotnet/sdk] 7.0.403 [/usr/local/share/dotnet/sdk] 8.0.100-rc.2.23502.2 [/usr/local/share/dotnet/sdk] 8.0.100 [/usr/local/share/dotnet/sdk] 8.0.204 [/usr/local/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 6.0.24 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.0-rc.2.23480.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.24 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0-rc.2.23479.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found: None

Environment variables: Not set

global.json file: Not found

Learn more: https://aka.ms/dotnet/info

Download .NET: https://aka.ms/dotnet/download

Steps to reproduce

  1. Code:

    [<RequireQualifiedAccess>]
    type Reproduction =
        | Value
    
        member this.UnsafeValue
            with get () =
                failwith ""
    
    let x = Reproduction.Value
    
    x.UnsafeValue
  2. Put your cursor inside UnsafeValue on the last line

  3. Apply the Rename symbol action for example rename it to Test

  4. See that the code is changed to:

    [<RequireQualifiedAccess>]
    type Reproduction =
        | Value
    
        member this.Test
            with Test () = // This line is wrong it should stay "get ()"
                failwith ""
    
    let x = Reproduction.Value
    
    x.Test

Details

Only the name of property should be renamed no the get declaration

Logs

No response

Checklist