Scratch files
A scratch file is a throwaway file in any language: a place to try a snippet, keep notes or paste a response, without adding anything to the project.1
Create one
Choose File › New Scratch File… (or Scratch File at the top of the Project view’s New menu).
2
Pick a language
Type to filter the language list and press
↵ / Enter.3
Edit
The file opens in a normal editor tab. It is named
scratch.<ext>, then scratch_1.<ext>, scratch_2.<ext> and so on. For C, C++, Go, Java, Kotlin and Rust the file starts with an empty main function.scratches folder in OpenIDEA’s application data directory, not in the project, so they are shared by all projects and are not seen by Git:
They are listed under Scratches in the Project view, where you can open, rename and delete them like other files.
Because a scratch file is outside every project, some language servers give it only syntax checks; completion and navigation may be limited. A banner at the top of the editor says so when the server reports it.
TODO
OpenIDEA collects comments that containTODO, FIXME, HACK or XXX in the TODO tool window and highlights them in the editor, each pattern in its own colour.
The TODO tool window
Open it from View › Tool Windows › TODO, or with Show TODO Items in Current File in Find Action. Its tabs are:- Project: every TODO item in the project.
- Current File: the items in the active editor, updated as you type.
- Scope Based: the items in a scope you choose, including custom scopes (Edit Scopes…).
- Changes: the items in files with uncommitted changes, optionally for one changelist.
Patterns
Settings › Editor › TODO controls what counts as a TODO item:- Patterns: add, remove, enable or recolour keywords. Restore Defaults brings back
TODO,FIXME,HACKandXXX. - Case sensitive: on by default, so
tododoes not matchTODO. - Only in comments: on by default; a match counts only when it follows a comment marker on its line.
Before committing
The commit dialog’s Check TODO option warns aboutTODO and FIXME comments in the lines you added or changed. See Version control.