ScreepsAutocomplete icon indicating copy to clipboard operation
ScreepsAutocomplete copied to clipboard

creep.moveTo function

Open xephael opened this issue 8 years ago • 10 comments

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?

xephael avatar Sep 04 '16 00:09 xephael

Hey mate. You closed this issue about four hours after opening. Did you find a fix? Was it not an issue?

Garethp avatar Sep 04 '16 22:09 Garethp

I closed it because it seemed to fix itself, However, I do seem to get this kind of issue with other things too, it seems to happen with some self-defined functions and modules? I'm not entirely sure. It also seems to underline "_". At this point, I'm kind of just at a loss for what causes it.

(This is using Webstorm by the way. It's set up as an external library.)

xephael avatar Sep 05 '16 00:09 xephael

Hm... if you're able to re-produce this at some point, can you paste your code here, or as a gist? Maybe I can see what's going on then

Garethp avatar Sep 05 '16 01:09 Garethp

I've got the same issue with moveTo not being recognized anywhere in PhpStorm

for example:

https://gist.github.com/Amadox/25addf96c2002f984d636baa3b5a05ea

underlining happens both in line 15 and 27.

marartner avatar Sep 17 '16 12:09 marartner

Hey, can you take a look at this issue and tell me if it fixes your problem?

Garethp avatar Sep 29 '16 23:09 Garethp

I have the same problem and the workarounds did not really work... but I try to find out more later

bastianh avatar Nov 29 '16 13:11 bastianh

ok .. I have used jsdoc to create a documentation for dash (https://kapeli.com/dash) .. and it also misses the moveTo function.

It worked after I deleted the * @alias moveTo(target, [opts]) row from the documentation of the function

bastianh avatar Nov 29 '16 14:11 bastianh

I have created a branch with a fix, but I need to test it more in the afternoon. It is working for me with the jsdoc generator and it looks like it is working in webstorm.

https://github.com/bastianh/ScreepsAutocomplete/commit/7fd04f23e692fc84f6ff05c5b0c070b3cb1bf313

bastianh avatar Nov 29 '16 15:11 bastianh

@bastianh Took a look at your changes and tried them out... seems to work as long as the @param annotation is in the format /** @param {Creep} creep **/ in Webstorm 2017.1

One contributing factor seems to be in the fact that Webstorm operates in an ambiguous fashion when asserting the attribute against the jsdocs. Trying other combinations such as /** @param {Creep} Creep **/ seems to make moveTo() work but then breaks others (i.e. harvest()).

nholms avatar Mar 29 '17 02:03 nholms

I can't really help with this anymore... I switched to using typescript in december ,)

bastianh avatar Mar 29 '17 08:03 bastianh