Awesome
intellij-awk
The missing IntelliJ IDEA language support plugin for AWK
Motivation
- At the moment there
iswas no AWK plugin for IDEA, whichiswas a pity. - Help me develop some of my own projects in AWK.
- Interested to sharpen my Java skills and learn some IDEA internals.
Goals v0.0.1 [done]
- Support basic AWK code highlighting
- Support basic AWK code navigations
- show structure
- go to declaration
- find usages
- Support completion
- function names
- variable names
- keywords
- Support only POSIX subset (aka BWK), w/o Gawk additions (this can be added later)
- Refactoring support
- rename variable
- rename function
- Basic auto-format
Goals v0.2.0 [done]
- Add GAWK parsing mode
Goals v0.3.0 [done]
- Enforce variable naming convention (the idea taken from How I Write AWK Code)
-
name
for local -
Name
for global
-
- Showing parameter hints for functions (Ctrl-P)
- Showing documentation for built-in functions
- Showing documentation for built-in variables (
NR
/NF
/etc.)
Parser quirks
Please note, due to very ad-hoc nature of AWK syntax (namely some inherent ambiguities in its grammar) the implemented IntelliJ IDEA AWK parser has some minor limitations.
More details in parser_quirks.md
Implementation details
The chosen approach to variables resolution described in variables_resolution.md
Useful links
- BWK https://github.com/onetrueawk/awk
- Custom language support JetBrains tutorial
- Grammar-Kit tutorial
- JFlex manual
- Grammar:
- Some other language plugins