> Markdown version of [Eclipse Editor Settings](https://vaadin.com/docs/v23/contributing/editor-settings-eclipse). Section index: [llms.txt](https://vaadin.com/docs/v23/contributing/llms.txt)

# Eclipse Editor Settings

This page describes the noticeable changes made to the default code formatting settings in Eclipse. This is also a chance to review some of these changes and tweak them if necessary. None of these are essential for a pull request, but they all help. They can also be added after the original pull request but before a merge.

## <a id="general"></a>General

- Line length is 80 characters

- Use spaces instead of tabs for indentation

- Use UTF-8 encoding

- Use unix-style line endings (`\n`)

## <a id="code-conventions"></a>Code Conventions

1. Open **Window** **›** **Preferences** (Windows) or **Eclipse** **›** **Preferences** (Mac)

2. On the **Java** **›** **Code Style** **›** **Formatter** page, import your local copy of [VaadinJavaConventions.xml](https://github.com/vaadin/flow/blob/master/eclipse/VaadinJavaConventions.xml)

3. On the **Java** **›** **Code Style** **›** **Organize Imports** page, import your local copy of [flow.importorder](https://github.com/vaadin/flow/blob/master/eclipse/flow.importorder)

4. On the **Editor** **›** **Save Actions** tab, make sure that in case Format source code is active, the Format edited lines option is selected. Never use the Format all lines option, as that may introduce loads of unnecessary code changes, making code reviews a nightmare.

5. Go to **General** **›** **Workspace**

   1. Set Text file encoding to **UTF-8**

   2. Set New text file line delimiter to **Unix**

6. Go to **XML** **›** **XML Files** **›** **Editor** and ensure the settings are configured as follows:

   - Line width: **72**

   - Format comments: **true**

   - Join lines: **true**

   - Insert whitespace before closing empty end-tags: **true**

   - Indent using spaces: **true**

   - Indentation size: **4**

## <a id="copyright"></a>Copyright

1. Open **Window** **›** **Preferences** (Windows) or **Eclipse** **›** **Preferences** (Mac)

2. On the **Java** **›** **Code Style** **›** **Code Templates** page, edit the **Comments** **›** **Files** template to add the copyright text:

   ```
   Copyright 2000-${currentDate:date('yyyy')} Vaadin Ltd.

   Licensed under the Apache License, Version 2.0 (the "License"); you may not
   use this file except in compliance with the License. You may obtain a copy of
   the License at

   https://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   License for the specific language governing permissions and limitations under
   the License.
   ```

`A0EF8ED7-DED5-454E-A5D0-DA4F9669F650`
