DeusModus
@DeusModus

Autocomplete для собственных модулей?

Привет.



Есть простой модуль, что-то вроде:
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>




Лежит это добро в папке modules/counter/Counter.js



Инклудится:

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




Вопрос — как заставить работать autocomplete в phpstorm 5 для Counter?
  • Вопрос задан
  • 3632 просмотра
Решения вопроса 1
avalak
@avalak
Хм, а почему вы не следуете рекомендациям по написанию модулей Nodejs Modules?
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
k12th
@k12th
console.log(`You're pulling my leg, right?`);
JsDoc напишите
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы