You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio连续注释及代码折叠行为改变,3.1.1后如何恢复?

Fixing Continuous Comment Folding Behavior in Android Studio 3.1.1

Hey there! I totally get how frustrating it is when code folding behavior shifts unexpectedly after an IDE update. Let’s walk through some targeted fixes to get back to your preferred folding logic—since you already tried resetting the general Code Folding settings without luck, these steps focus on more specific angles:

1. Check Language-Specific Code Folding Settings

Global settings can sometimes get overridden by language-specific configurations. Here’s what to check:

  • Open Preference > Editor > General > Code Folding
  • Expand the section for your project’s language (e.g., Java or Kotlin)
  • Look for options like Comment Blocks or Continuous Comments—ensure these are disabled, then restart Android Studio to apply changes.

2. Invalidate Caches & Restart

Android Studio’s cached data often causes weird, unaccounted-for glitches. This is a go-to fix for most IDE oddities:

  • Go to File > Invalidate Caches / Restart...
  • Select Invalidate and Restart from the pop-up. Wait for the IDE to fully restart and reindex your project, then test the folding behavior again.

3. Revert to Old IDE Settings (If You Have a Backup)

If you exported your Android Studio settings before the 3.1.1 update:

  • Go to File > Import Settings
  • Select your old settings file (usually a .jar or .zip archive)
  • Make sure to check the Code Folding option during import, then restart the IDE to roll back to your previous configuration.

4. Disable Third-Party Plugins

Some non-official plugins can quietly modify code folding logic. Let’s rule this out:

  • Open Preference > Plugins
  • Disable all non-Google plugins
  • Restart Android Studio and test the folding. If it works, re-enable plugins one by one to identify which one was causing the conflict.

5. Manually Edit IDE Configuration Files (Advanced)

If none of the above works, you can tweak the underlying config files directly:

  • Mac: Navigate to ~/Library/Preferences/AndroidStudio3.1/options/codeStyleSettings.xml
  • Windows: Go to C:\Users\<Your Username>\.AndroidStudio3.1\config\options\codeStyleSettings.xml
  • Open the file in a text editor, find the <component name="CodeStyleSettingsManager"> section
  • Look for entries related to comment folding (e.g., <option name="COMMENT_BLOCKS" value="false"/>) and adjust them to match your desired behavior. Save the file, then restart Android Studio.

内容的提问来源于stack exchange,提问作者Tim Autin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 08:03:00