Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Visual Studio F# Rename corrupts record update expressions

オープン
#20,791 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@T-Gro がすでに取り組んでいます。

2026年10月16日 から。

  • #20797 @T-Gro による — オープン

評価

この issue はまだ評価されていません。

説明

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
主要言語
F#
スター
4.3k
フォーク
881
平均マージ
3日 20時間
マージ済み PR(30日)
108

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dotnet/fsharp のほかの issue

dotnet/fsharp の issue をすべて見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。