有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (2) 个答案

  1. # 1 楼答案

    作为另一种选择,考虑VSCode 1.59(JUIL 2021),其中包括:

    Automatically Fold Imports

    Use the setting editor.foldingImportsByDefault to have import statements automatically folded.

    The fold state is stored once a file has been opened once.

    The feature works with TypeScript, JavaScript, Java, C# and C++ and with all language that have a folding range provider that annotates import statements with FoldingRangeKind.Imports.

  2. # 2 楼答案

    我使用Red Hat(redhat.java)的VS代码扩展“Java语言支持”,它捆绑在Microsoft(vscjava.vscode-java-pack)的“Java扩展包”中。有了这个扩展,有很多方法可以折叠代码的各个部分,包括导入语句

    侧边栏中的胡萝卜

    在导入语句旁边,我有一个小胡萝卜符号,用于切换导入语句的折叠

    enter image description here

    键盘快捷键

    VS代码还附带了大量可定制的折叠和展开代码的命令。你可以在自己的网站上浏览列表

    `Manage` (the gear icon in the bottom left) -> `Keyboard Shortcuts` -> Search for "fold".
    

    CTRL+K+CTRL+S也会显示相同的菜单)

    enter image description here