V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
zhwguest
V2EX  ›  Android

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

  •  
  •   zhwguest · 57 天前 · 2726 次点击
    这是一个创建于 57 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

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

    when(xxx) {
        I 
    }    }
    

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

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

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

    并不会

    看看是不是插件问题
    markgor
        4
    markgor  
       57 天前   ❤️ 1
    盲猜有標籤未閉合
    liuzhaowei55
        5
    liuzhaowei55  
       56 天前 via Android
    前两天 vscode 写 ts import 时也出现过类似情况
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2875 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 07:27 · PVG 15:27 · LAX 00:27 · JFK 03:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.