我的常用Eclipse Coding Style設定

來源:互聯網
上載者:User

使用Eclipse的時候通常對coding style有一定的要求,通常最主要的就是Java和xml檔案中tab和空格,Java格式的一些約定俗成的東西,把自己的常用設定儲存在github上面,留個備份:Workspace設定


Windows->Preferences->General->Workspace text file encoding: UTF-8 New text file line delimiter: Unix Windows->Preferences->General->Editors->Text Editors select insert spaces for tabs select Show print margin (update pring margin column to 150) select Show line numbers select Show whitespace characters Windows->Preferences->XML->XML Files->Editor

For insert whitespace before closing empty end-tags, select Indent using psaces, change size to 4 Windows->Preferences->Java->Code Style->Formatter click New, input profile name click edit, change Tab policy to Space only, set Indentation/tab size to 4 Windows->Preferences->Java->Editor->Save Actions select Perform the selected actions on save select Format source code Format edited lines for old projects and Format al lines for new projects select Addional actions, click configure In Code Organizing select Remove trailing whitespace select correct indentation In Code Style select blocks in if/while/for/do with Always except for single return or throw select convert 'for' loops to enhanced select use parentheses in expressions select use modifier 'final' where possible select convert funtional interface instances with use lambda where possible In Member Accesses: select user 'this' qualifier for field accesses select user 'this' qualifier for method accesses select qualify field access and qualify method access In Unnecessary Code select Remove unused imports select Remove unused private members Remove unused local variables

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.