8000 doc: Copilot Code Formatting by MarcinVaadin · Pull Request #4377 · vaadin/docs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

doc: Copilot Code Formatting #4377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: latest
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions articles/tools/copilot/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,26 @@ public class User {
}
----

== Code Formatting

Copilot does not format code it outputs, it relies on your project having a formatter set up. The following sections describe common ways to ensure consistent formatting in your project.

=== Enabling Format on Save in IDEs

Most modern IDEs support automatic code formatting on file save. To enable this feature, follow the instructions for your environment:

- *IntelliJ IDEA*: Go to `Settings -> Tools -> Actions on Save` and enable _Reformat Code_.
- *VS Code*: Set the `Editor: Format on Save` property in your workspace or user settings.
- *Eclipse*: Navigate to `Window -> Preferences -> Java -> Code Style` and configure formatting settings.

=== Formatting via Build Tool Plugins

If your project is based on Vaadin starter project (like <<{articles}/getting-started/start#,Walking Skeleton>>), it is likely already configured with the https://github.com/diffplug/spotless[Spotless] plugin.

You can apply formatting manually via:

- Maven: `mvn spotless:apply`
- Gradle: `./gradlew spotlessApply`

== Limitations

Expand All @@ -273,8 +293,6 @@ It's best to know the limitations of software that you use. These are some known
- Not all views or hierarchies can be edited via drag-and-drop. In particular, parts of the UI created programmatically (e.g., loops) can cause problems.
- AI makes mistakes.
- AI is currently limited to smaller one-view tasks.
- Code formatting is dependent on user IDE configuration. If the user has configured formatting on a file save, Vaadin IntelliJ plugin triggers it. Otherwise, running code format manually is required.


=== Additional Notes

Expand Down
Loading
0