D
D
DeusModus2012-09-13 12:35:43
Node.js
DeusModus, 2012-09-13 12:35:43

Autocomplete for native modules?

Hello.

There is a simple module, something like:

var _counters = {};<br>
<br>
this.createCounter = function (counterName, initialValue) {<br>
    _counters[counterName] = initialValue;<br>
    return this;<br>
}<br>
<br>
this.removeCounter = function (counterName) {<br>
    delete _counters[counterName];<br>
    return this;<br>
}<br>
<br>
this.increment = function (counterName, incrementValue) {<br>
    if (typeof  incrementValue == 'undefined') {<br>
        incrementValue = 1;<br>
    }<br>
    _counters[counterName] += 1;<br>
}<br>
<br>
this.decrement = function (counterName, incrementValue) {<br>
    if (typeof  incrementValue == 'undefined') {<br>
        incrementValue = 1;<br>
    }<br>
    _counters[counterName] -= incrementValue;<br>
}<br>


This goodness lies in the modules/counter/Counter.js

folder. Included:
var Counter = require('./modules/counter/Counter.js');<br>


Question - how to make autocomplete work in phpstorm 5 for Counter?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
avalak, 2012-09-13
@DeusModus

Hmm, why don't you follow the best practices for writing Nodejs Modules ?

K
Konstantin Kitmanov, 2012-09-13
@k12th

JsDoc write

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question