Code Completion for jetbrains IDEs

Tools, that are useful for mod-development.
Post Reply
asdff45
Inserter
Inserter
Posts: 48
Joined: Sun Aug 07, 2016 1:23 pm
Contact:

Code Completion for jetbrains IDEs

Post 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
Last edited by asdff45 on Mon Jan 20, 2020 2:56 pm, edited 3 times in total.

asdff45
Inserter
Inserter
Posts: 48
Joined: Sun Aug 07, 2016 1:23 pm
Contact:

Re: Code Completion for jetbrains IDEs

Post 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

asdff45
Inserter
Inserter
Posts: 48
Joined: Sun Aug 07, 2016 1:23 pm
Contact:

Re: Code Completion for jetbrains IDEs

Post 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.

User avatar
AmatorPhasma
Fast Inserter
Fast Inserter
Posts: 126
Joined: Sat Aug 05, 2017 8:20 pm
Contact:

Re: Code Completion for jetbrains IDEs

Post by AmatorPhasma »

Hi,

thanks for this plugin :)

asdff45
Inserter
Inserter
Posts: 48
Joined: Sun Aug 07, 2016 1:23 pm
Contact:

Re: Code Completion for jetbrains IDEs

Post 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.

asdff45
Inserter
Inserter
Posts: 48
Joined: Sun Aug 07, 2016 1:23 pm
Contact:

Re: Code Completion for jetbrains IDEs

Post 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

Post Reply

Return to “Development-Tools”

Who is online

Users browsing this forum: No registered users