The purpose of this is to add screeps autocomplete to IDEs by creating a definition from the documents. People can then add this project as a library in their IDE, and their IDE should be able to start autocompleting their code. Tested somewhat in JetBrain's WebStorm
This can be done by quite simply copying the ScreepsAutocomplete
folder in their project, and Webstorm should automatically
detect it and add it to the autocompletion
Instead of copying the ScreepsAutocomplete
folder to each and every project folder, you can add it as a global library.
File
-> Settings
-> Languages & Frameworks
-> JavaScript
-> Libraries
Add
.Framework type
to custom, if it is not already so. Version
can be left blank.Visibility
to Global
.Visibility
, then choose "Attach Directories...".OK
.OK
at the bottom of the "Edit Library" dialog.Enabled
checkbox on the library you just created, make sure it's checked before continuing.OK
at the bottom of the "Settings" dialog.Webstorm should automatically detect the library and add it to the autocompletion.
ScreepsAutocomplete
folder into your project and create a new file called _references.js
(right click in solution explorer -> Add New Item -> _references.js
).Update JavaScript References
which will populate the file and make autocomplete avaliable.There are two ways to enable Autocomplete in Sublime Text, both of them require installing a plugin through
Package Control
, and copying ScreepsAutocomplete
in to your project.
TernJS
- Install TernJS
through Package Control
, restart Sublime Text and try var room = new Room(); room.lookAt(x, y)
to see if Autocomplete is working. If not, try the next options
SublimeCodeIntel
- Install SublimeCodeIntel
through Package Control
. Go to Preferences > Package Settings > SublimeCodeIntel > Settings -- User
and copy the contents of ScreepsAutocomplete/config/SublimeCodeIntel.json
in to the file that opens. Save and restart Sublime
Text. After waiting for CodeIntel to process JavaScript, Autocomplete should be working
Integration with Atom is done through use of the atom-ternjs
package. Here's the steps
ScreepsAutocomplete
in to your project folderatom-ternjs
package.tern-project
file
{
"ecmaVersion": 6,
"libs": [],
"loadEagerly": [
"ScreepsAutocomplete/**/*.js"
]
}