IntelliJ - GradedJestRisk/tools GitHub Wiki
Also covers: Webstorm
In addition to Code Style
List:
- activate Node.js code assistance
- node_modules - Mark as Excluded
- exclude library for code search/debug
List:
- import project
- synchronize maven
- mark directories with test/source
- create test configuration Junit, running all tests
- enable auto-build
List:
- select sub-words:
- use camelHumps
- honor camelHumps
Must-know
- Find:
- file, by name: Shift Shift (you can provide initials, eg foo bar for FoozzzzBariton)
- string: Ctrl Shift F
- Go to : Ctrl Shift
- brace: M
- panel: Alt + Number (1 - 9)
- last edit: Backspace (Loop)
- Action: Ctrl Shift A
- Rename file: Shift F6
- Replace in all files: Ctrl Shift R
- Select:
- enclosing: Ctrl W
- next: Alt J (unselect: Shift)
- up: Up
- down: Down
- forward: Right
- backward: Left
- this: Ctrl F
- next: F3
- previous: Shift F3
Refactor:
- this: Ctrl Alt Shift T
- extract: Ctrl Alt
- constant: C
- method: M
- variable: V
- parameter: P
- go to test (matching with code): T
- rerun last test: Ctrl F5
- run all test from file: ?
List:
- Key promoter: suggest shortcuts
- Limited WIP: Limit change size
- CamelHumps: select sub-words (IntelliJ only)
- Git toolbox: inline blame
- Color incorrect indentation (life-saver in YAML)
List:
- close: Shift Esc
- maximize: Ctrl Shift 4
- keep tools pinned on left: Show tools windows bar (Appearance / Windows options / Show tools windows bar)
Steps:
- add breakpoint
- open package.json, scroll on start task
- click Debug in the gutter: it will run the script and link it to the debugger
- perform an action that would enter breakpoint
- check breakpoint is reached in call stack
- start anywhere with
node --inspect-brk bin/www
- attach debugger (how ?)
List (eg., for knex, acquireConnection method in client.js):
- disable search exclusion on library: node_module / knex - Mark Directory as / Cancel exclusion
- add breakpoints : search acquireConnection and add breakpoint
- enable stepping-in libraries: Setting / Build, Execution / Debugger / Stepping / Uncheck "Do not step into library scripts"
Use bundled plugin
Use [EnvFile](https://github.com/Ashald/EnvFile) plugin. In Run.debug configuration, check "Environment variables section" Check "Enable EnvFile". Check "Enable experimental integrations" (mandatory for SpringBoot). Add line, select `.env`file.
Lint rules fall into 2 categories:
- formatting, eg indent (make code easier to read) - does not affect the AST
- code-quality rules, eg no-unused-var (avoid bug introduction) - affect the AST
- alert: warn, keep code as-is.
- fix
- read configuration file to implement rule, eg. it keys in the appropriate indent when hitting tab
- read configuration file detect rule violation "after-the-fact", eg. by underlining it or through Code inspection (Problem Window)
- fix rule violation, eg. in Reformat (formatting only)
Setting:
- can be imported from Eslint rules (eg, indent)
- can be imported from .editorconfig
- can be set manually in Code Style specific section
- can be set manually in Code Style, section "Other file type"
- with Reformat (Ctrl Alt R)
- with "Fix ESLint problems" contextual menu (launch eslint -fix)
- with Prettier
EditorConfig properties:
- indent_style
- indent_size
- tab_width
- end_of_line
- charset
- trim_trailing_whitespace
- insert_final_newline
- general (all files)
- specific, on file extension
root = true [*] end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.js] spaces_around_brackets = both [*.hbs] insert_final_newline = false