redhat-developer / redhat-developer/vscode-java

Renaming a Java object to change the case without changing the name does not result in a properly renamed file

未关闭
#3,629 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug
主要语言
TypeScript
星标
2.3k
派生
546
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

If you have a class, say someClassIWrote, tied to a file someClassIWrote.java and you rename the class using the F2 refactor command changing only the case, to, say, SomeClassIWrote, the filename's case does not change to match. This causes the error "The public type SomeClassIWrote must be defined in its own fileJava(16777541)" to be emitted. Renaming the file itself fixes the problem. (Interestingly, the Tab filename does not change to match.) This is probably due to a mismatch between the case sensitivity of the Linux OS vs the case insensitivity of the Windows OS.

Environment
  • Operating System: Windows 10
  • JDK version:
    openjdk version "17.0.8.1" 2023-08-24
    OpenJDK Runtime Environment Temurin-17.0.8.1+1 (build 17.0.8.1+1)
    OpenJDK 64-Bit Server VM Temurin-17.0.8.1+1 (build 17.0.8.1+1, mixed mode, sharing)
  • Visual Studio Code version: 1.85.1 (WPILib FIRST Robotics edition)
  • Java extension version: v1.30.2024042308
Steps To Reproduce
  1. Create an object
  2. Change the case of a single letter via the F2 command

I'm somewhat inexperienced with this IDE, so I will go after logs on request. I figure checking for this behavior is extremely easy.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 VS Code Java extension 中的 F2 重命名命令开始,在 Windows 上复现仅大小写发生变化的类重命名。跟踪重命名如何更新 Java 文件和编辑器选项卡;完成标准是两者都与新类名的大小写一致,并且不存在 public 类型诊断。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, vscode
领域
developer-experience, tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。