Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Visual Studio F# Rename corrupts record update expressions

Abierto
#20,791 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 3 días

@T-Gro ya está trabajando en esto.

Desde el 16/10/2026.

  • #20797 de @T-Gro — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Area-LangService-RenameSymbol Bug

Visual Studio's F# Rename operation corrupts record update expressions when renaming a record type. The rename preview already shows incorrect edits before they are applied.

Repro steps

  1. Create a new F# console application in Visual Studio.
  2. Replace the source code with the following:
module Main

type State = { Count: int }

type Msg =
    | Increment
    | Decrement

type Cmd = | NoOp

let update msg (state: State) =
    match msg with
    | Increment -> { state with Count = state.Count + 1 }, Cmd.NoOp
    | Decrement -> { state with Count = state.Count - 1 }, Cmd.NoOp
  1. Place the cursor on the record type name State.
  2. Invoke Rename (Ctrl+R, R) and rename State to Model.
  3. Inspect the rename preview.

Expected behavior

Only references to the record type State should be renamed to Model. The Count field accesses and surrounding record update expressions should remain unchanged.

Actual behavior

The rename preview incorrectly includes parts of the record update expressions as rename targets.

After applying the rename, the code becomes corrupted:

module Main

type Model = { Count: int }

type Msg =
    | Increment
    | Decrement

type Cmd = | NoOp

let update msg (state: Model) =
    match msg with
    | Increment -> { state with Count = state.Model, Cmd.NoOp
    | Decrement -> { state with Count = state.Model, Cmd.NoOp

The expressions state.Count + 1 and state.Count - 1 are incorrectly replaced with state.Model, and parts of the surrounding expressions are deleted.

The issue reproduces in a minimal F# console application and does not require third-party libraries. It does not reproduce in VS Code.

Known workarounds

No workaround has been identified yet, other than avoiding Rename for this scenario and changing the references manually.

Related information

  • Operating system: Windows 11 26H2 (Build 26300.9711)
  • Editing tool: Visual Studio 2026, version 18.11.0
  • Project type: F# console application
  • Potentially related issue: #14057
Lenguaje dominante
F#
Estrellas
4.3k
Forks
881
Merge medio
3 d 20 h
PR fusionados (30 d)
108

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de dotnet/fsharp

Todos los issues de dotnet/fsharp

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.