zhwguest
V2EX  ›  Android

为什么 AndroidStudio 给我添加多余的花括号?

  •  
  •   zhwguest · Mar 1, 2024 · 11239 views
    This topic created in 807 days ago, the information mentioned may be changed or developed.

    正常情况下,假设我有了左花括号,那么回车给我自动添加右花括号,这个我能理解。

    但是现在诡异的,经常出现这种情况,我先输入左花括号,比如 when(xxx) {,它先帮我自动补齐为when(xxx) {I},这里面的I表示我的光标。

    我回一下车,它又帮我补齐一个右花括号,变成了两个右花括号:

    when(xxx) {
        I 
    }    }
    

    其中 I 是我的光标。我知道 smart key 中可以修改是否自动补齐右花括号,以及回车是否添加右花括号,但是这两个组合在一起也不能给我搞两个啊。

    其实好像是最近才开始的。

    5 replies    2024-03-02 09:23:08 +08:00
    Vindroid
        1
    Vindroid  
       Mar 1, 2024
    是不是 CodeGeeX 这类 AI 插件给你自动生成的?
    SilentOrFight
        2
    SilentOrFight  
       Mar 1, 2024
    试了一下并不会
    ZhuZhuQianJin
        3
    ZhuZhuQianJin  
       Mar 1, 2024
    Android Studio Hedgehog | 2023.1.1 Patch 1

    并不会

    看看是不是插件问题
    markgor
        4
    markgor  
       Mar 1, 2024   ❤️ 1
    盲猜有標籤未閉合
    liuzhaowei55
        5
    liuzhaowei55  
       Mar 2, 2024 via Android
    前两天 vscode 写 ts import 时也出现过类似情况
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   925 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 19:00 · PVG 03:00 · LAX 12:00 · JFK 15:00
    ♥ Do have faith in what you're doing.