Giter VIP home page Giter VIP logo

screepsautocomplete's Introduction

Screeps Autocomplete

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

How to Install

Webstorm (Or Other Jetbrains IDE's)

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

Adding it as a library

Instead of copying the ScreepsAutocomplete folder to each and every project folder, you can add it as a global library.

  • Create a new project in Webstorm if you don't already have one and open it.
  • In the menu bar at the top of the screen, navigate to File -> Settings -> Languages & Frameworks -> JavaScript -> Libraries
  • Click Add.
  • Name the Library whatever you want.
  • Set Framework type to custom, if it is not already so. Version can be left blank.
  • Change Visibility to Global.
  • Click the green plus sign to the right of the listbox below Visibility, then choose "Attach Directories...".
  • Navigate to the ScreepsAutocomplete folder, select the folder itself and click OK.
  • Click OK at the bottom of the "Edit Library" dialog.
  • Click the Enabled checkbox on the library you just created, make sure it's checked before continuing.
  • Click OK at the bottom of the "Settings" dialog.

Webstorm should automatically detect the library and add it to the autocompletion.

Visual Studio

  1. Create a new empty web site (File -> New -> Web Site -> ASP.NET Empty Web Site) and set the location to the location of your program.
  2. Copy the ScreepsAutocomplete folder into your project and create a new file called _references.js (right click in solution explorer -> Add New Item -> _references.js).
  3. Right click within the empty file and select Update JavaScript References which will populate the file and make autocomplete avaliable.

Video

Sublime Text

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

Atom

Integration with Atom is done through use of the atom-ternjs package. Here's the steps

  • Copy ScreepsAutocomplete in to your project folder
  • Install the atom-ternjs package
  • Put the following in your .tern-project file
{
  "ecmaVersion": 6,
  "libs": [],
  "loadEagerly": [
    "ScreepsAutocomplete/**/*.js"
  ]
}
  • Restart and Enjoy

screepsautocomplete's People

Contributors

alextd avatar arsn avatar baptistepillot avatar eldorandev avatar garethp avatar greenfrogs avatar jacudibu avatar kaiheilos avatar laxader avatar leftler avatar madarauchiha avatar marartner avatar mrceej avatar nickgarvey avatar nmaggioni avatar poma avatar proximitron avatar rbryson74 avatar riftlurker avatar sebbi08 avatar shibdib avatar texaswilliam avatar thomaskneisel avatar threenplusone avatar winrid avatar zinal001 avatar zsw007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

screepsautocomplete's Issues

Sublime Text 3, SublimeCodeIntel Issue

I placed the ScreepsAutocomplete directory into my projects folder but it doesn't seem to work. When I move the files from the ScreepsAutocomplete folder into my projects folder it works just fine. I don't like having all the Screeps autocomplete files in the same directory as my screeps code. Is there a configuration in the package settings I can change to have it read from the ScreepsAutocomplete directory?

PhpStorm code completion not working.

I made a test file to test the behavior of the autocomplete, and it's clearly not working.

See here.

Plus, the autocomplete itself does not work with any of the objects when using Only type-based completion option in File > Settings > Languages & Frameworks > JavaScript.

I have no idea how this was working in WebStorm for you. I have spent 2 full days trying to make it work. Any ideas?

visual studio trouble

im trying to get this to work with the visual studio IDE but i cant seem to find any of the buttons to press in the readme, but when i found something that said ASP.NET visual studio said there was no relevant results, i would really appreciate some help

[Feature Request] Notepad++ Support

I really like notepad++ for it's simple and lightweight interface. It would be awesome if there was some auto completion for Screeps in it.

Sublime Text 3, plugin refuses to work.

It seems like the plugin has broken again, despite my best effort following the given instructions it doesn't install the autocomplete. I have tried both options. Did something change that broke it?

Install Guide.

I'm pretty new to this. Only used Visual Studio before so I'm not sure how to go about this.
Could you explain what IDE's are supported and how to install this?

Thank you.

Overload missing 'terrain' @ room

I think the 'terrain' entry is missing in the room.js.

I added this to my local file:
/**
* plain, wall or swamp
*
* @Terrain {PLAIN|WALL|SWAMP}
*/
terrain: 'plain',

I'am not sure if I fixed this right, I am not familiair with this, but it works for me.
Now my IDE is happy :-)

Ty for this Screeps Autocomplete repo.

Help with Atom ScreepsAutocomplete

So I have followed the steps for the tern install and everything except the last step. Where do i put in this code in the file?? please help
{
"ecmaVersion": 6,
"libs": [],
"loadEagerly": [
"ScreepsAutocomplete/**/*.js"
]
}

Issue with creep.moveTo() in WebStorm

Hi there!

It seems that WebStorm doesn't correctly detect the moveTo() defintion for creep instance. I've tried the following forms:

creep.moveTo(sources[0], {reusePath: cache});
creep.moveTo(targets[0]);
creep.moveTo(12,114);
creep.moveTo(12,114,{});

For all of them WebStorm will highlights the moveTo with explanation: Unresolved function or method moveTo(). Here is a full code sample:

var roleTest = {

    /** @param {Creep} creep **/
    run: function(creep) {
        creep.moveTo(sources[0], {reusePath: cache});
        creep.moveTo(targets[0]);
        creep.moveTo(12,114);
        creep.moveTo(12,114,{});
    }
};

module.exports = roleTest;

Any help would be highly appreciated!

Visual Studio Integration

image
I'm getting the above error when attempting to integrate the ScreepsAutocomplete into Visual Studio 2015. The only thing that is successfully being autocompleted is Game. I followed the instructions and added the _references.js file correctly. I also followed instructions from another site that makes Intellisense recognize the _references.js as a proper reference file.

Using with neovim

Any pointers on how to use this with neovim? I am currently using deoplete as an auto-complete plugin, and I have LanguageClient that uses language server protocol (this is where I get javascript support from right now).

I am a little new with the above tools, and could use a little guidance. Also (neo)vim seems to be missing from your set of supported editors.

creep.moveTo function

For some reason, everything seems to work except when I use the creep.moveTo(); function "moveTo" gets underlined as an "unresolved function or method". Any idea why?

Creep.moveTo in WebStorm

Hi,

the method moveTo of Creep is not recognize by webstorm when used in a function with:
/** @param {Creep} creep **/
declared at top ...
any solution ?

Add Game.market.getAllOrders()

I'm not really an expert on how to do this, but this mostly seems to work for me.

         * Get other players' orders currently active on the market.
         *
         * See: http://support.screeps.com/hc/en-us/articles/207928635-Market.
         *
         * @type {function}
         *
         * @param {function} filter (optional) object, function
         *         An object or function that will filter the resulting list using the lodash.filter method.
         *         Return value
         * @return
         An orders array in the following form:
         id - The unique order ID.
         created - The order creation time in game ticks.
         type - Either ORDER_SELL or ORDER_BUY.
         resourceType - Either one of the RESOURCE_* constants or SUBSCRIPTION_TOKEN.
         roomName - The room where this order is placed.
         amount - Currently available amount to trade.
         remainingAmount - How many resources are left to trade via this order. When it becomes equal to zero, the order is removed.
         *
         */
        getAllOrders: function(filter = null) {}

Constants not working with autocomplete in webstorm

I cannot get the constants in Global/Constant.js to work with webstorm.
If I just copy the constants into main.js it will autocomplete but when the ScreepsAutocomplete folder is set up as global library or just copied into the project directory the constants are not picked up by webstorm.

spawnCreep seems to not be working

I get Unresolved method or function spawnCreep() when I use it in my code, despite it being the recommended replacement for createCreep which is now deprecated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.