Page 1 of 1

Code Completion for jetbrains IDEs

Posted: Tue Nov 19, 2019 2:14 pm
by asdff45
I've written a plugin for Intellij, that downloads and parses the Factorio Lua API and adds autocompletion for it.
The factorio Version can be selected in the Settings under `Settings > Languages & Frameworks > Factorio Autocompletion`.
As plugin-dependency, emmyLua is required for the basic LUA integration.

Autocompletion will be added to every LUA file, when activated.
Also a different autocompletion is used for prototype definition.
The info.json has automatically the correct json-schema loaded, so it has autocompletion and error checks.

Source-Code: https://github.com/knoxfighter/intellij ... completion
Plugin-Page: https://plugins.jetbrains.com/plugin/13 ... pi-support

Implemented Features:
  • info.json has a schema
  • Prototype definitions (data:extend) autocompletion
  • Autocompletion for require command (load default LUA libraries, e.g. `mod-gui`)
  • Autocomplete Prototypes for tables (e.g. `LuaForce.recipe[String]LuaRecipe`)
  • Autocomplete Prototypes in data.raw table.
Planned features:
  • Creation of Projects/Files
  • Autocompletion for LocalizedStrings (general translation tools)
Image

Re: Code Completion for jetbrains IDEs

Posted: Mon Dec 30, 2019 11:46 am
by asdff45
Update 1.1.0:
Added:
  • JSON Schema for info.json
  • Autocompletion for Prototypes (other autocompletion mostly deactivated)
    • completion for prototype field (only names)
    • completion for the type literal
  • Compatibility with Jetbrains 2019.3 IDEs
Update 1.1.1:
Fixed:
  • Global Variables where defined local

Re: Code Completion for jetbrains IDEs

Posted: Thu Jan 16, 2020 3:47 pm
by asdff45
Update 1.2.0:
Added:
  • Autocompletion for require statement. (autocompletes the path to lua files)
  • Download the factorio lualib (https://github.com/wube/factorio-data/t ... ore/lualib)
  • Type infer is followed the require statements correctly to files. This is based on the two points above :)
  • Autocomplete Prototypes for tables (e.g. `LuaForce.recipe[String]LuaRecipe`)
  • Autocomplete Prototypes in data.raw table.
Fixed:
  • Removed weird indexing of files (only happens now, when finished downloading)
Changed:
  • Settings will reload Prototypes and Lualib too.
  • Check for updates is only done, when the Project is opened.

Re: Code Completion for jetbrains IDEs

Posted: Thu Jan 16, 2020 5:00 pm
by AmatorPhasma
Hi,

thanks for this plugin :)

Re: Code Completion for jetbrains IDEs

Posted: Mon Jan 20, 2020 2:45 pm
by asdff45
Update 1.2.1:
Fixed:
  • Added missing log() and table_size() functions
  • Defines-Table is now available again (was defined local)
  • functions and variables inside base/core Prototype definitions are not shown in auto-completion anymore.

Re: Code Completion for jetbrains IDEs

Posted: Thu Feb 27, 2020 11:39 pm
by asdff45
These fixes where released a while ago, but i forgot to post it here :)
Update 1.2.2:
Fixed:
  • endless "Download Factorio LuaApi" on startup
  • download of lualib and core prototypes failed

Re: Code Completion for jetbrains IDEs

Posted: Fri Apr 29, 2022 1:13 pm
by onexdrk
Great job!
Could you release a new version for Intellij Idea IC-221, please? :)