Jetbrains - GradedJestRisk/tools-training GitHub Wiki
Covers: IntelliJ, Webstorm
intellij-idea-ultimate . disableNonBundledPlugins nosplash &>/dev/null
intellij-idea-ultimate . disableNonBundledPlugins nosplash </dev/null &>/dev/null &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
To disable inspection of Hibernate column/table mapping Go to Editor/Inspections/JPA and uncheck rule "Unresolved database references in annotations"
Select sub-words:
- use camelHumps
- honor camelHumps
Keep tools pinned on left: Show tools windows bar (Appearance / Windows options / Show tools windows bar)
Always Select Opened File
Always Select Opened statement
Presentation mode: tpm (Toogle Presentation Mode)
- go fullscren (hide OS bar)
- hide all tools windows
- increase zoom level
Zoom:
- in: Ctrl Alt Shift = (no Numpad)
- out: Ctrl Alt Shift - (no Numpad)
Change font size: Ctrl + Wheel Changing font size only modifies current window (editor, terminal) font size.
Go to panel: Alt + Number (1 - 9)
Find:
- all (file, actions), by name: Shift Shift (you can provide initials, eg
fbforFooBar.js) - file, by name: Ctrl Shift N (you can provide initials, eg
fbforFooBar.js) - actions, by name: Ctrl Shift A
- string, in all files: Ctrl Shift F
Go to : Ctrl Shift
- brace: M
- panel: Alt + Number (1 - 9)
- last edit: Backspace (Loop)
Previous location in source : Alt Shift
- forward: Right
- backward: Left
Fold/collapse
- recursively : Ctrl Alt +
- all : Ctrl Maj +
-
Action: Ctrl Shift A
-
Rename file: Shift F6
-
Replace in all files: Ctrl Shift R
-
Select:
- enclosing: Ctrl W
- next: Alt J (unselect: Shift)
Move selection: Ctrl Shift
- up: Up
- down: Down
Find:
- this: Ctrl F
- next: F3
- previous: Shift F3
Paste history: Ctrl Shift V
Refactor : Ctrl Alt Shift T
Extract: Ctrl Alt
- constant: C
- method: M
- variable: V
- parameter: P
List:
- close: Shift Esc
- maximize: Ctrl Shift 4
Test:
- go to test (matching with code): T
- rerun last test: Ctrl F5
- run all test from file: ?
List:
- [suggest shortcuts](https://plugins.jetbrains.com/plugin/9792-key-promoter-x Key promoter)
- Limited WIP: Limit change size
- select sub-words
- Git toolbox: inline blame
- Color incorrect indentation (life-saver in YAML)
[https://www.jetbrains.com/help/idea/running-and-debugging-node-js.html#ws_node_debug_from_run_tw Guide]
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
Alternatively:
- 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"
You may consider option "Do not step into scripts" and add "internals*" to avoid Node.js code, but it's not working that well for me
Use bundled plugin
Use EnvFile plugin.
In Run.debug configuration, check "Environment variables section"
Check "Enable EnvFile".
Check "Enable experimental integrations" (mandatory for SpringBoot).
Add line, select .envfile.
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
When come against a rule violation, they can work in 2 mode :
- alert: warn, keep code as-is.
- fix
IntelliJ offer support in both categories:
- 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 [https://editorconfig.org/ .editorconfig]
- can be set manually in Code Style specific section
- can be set manually in Code Style, section "Other file type"
Fix
- with Reformat (Ctrl Alt R)
- with "Fix ESLint problems" contextual menu (launch eslint -fix)
- with [https://prettier.io/docs/en/webstorm.html Prettier]
EditorConfig properties:
- indent_style
- indent_size
- tab_width
- end_of_line
- charset
- trim_trailing_whitespace
- insert_final_newline
Scope:
- general (all files)
- specific, on file extension
Below a sample for 2 file types
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