Making Eclipse's Java code formatter ignore block comments

后端 未结 11 539
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 13:20

Is there a way to make Eclipse\'s built-in Java code formatter ignore comments? Whenever I run it, it turns this:

    /*
     * PSEUDOCODE
     * Read in us         


        
11条回答
  •  猫巷女王i
    2020-12-04 14:00

    It is language-dependent.

    For example, if working with javascript, you would go to "Window -> Preferences -> Javascript -> Code Style -> Formatter" and then edit the formatter options.

    Edit (reflecting changesin OP Questions

    For editing java code formatting, go to "Window -> Preferences -> Java -> Code Style -> Formatter"

    At the top of the panel you will see

    Active Profile:
    Eclipse [built-in]

    From there you have one button to the right, "Edit", and two below, "New..." and "Import...". I would recommend Editing the existing profile.

    In the edit profile dialog, there are a series of tabs along the top. The last tab is "Comments". To completely disable comment formatting, uncheck "Enable Javadoc comment formatting", "Enable block comment formatting", "Enable line comment formatting", and "Enable header comment formatting".

提交回复
热议问题