0

我一直在阅读文档,但无法弄清楚如何在 VS 2013 中将项目添加到 javascript intellisense 的完成列表中。我知道这些项目可以通过 event.items 访问,但推送到这个数组不会似乎影响完成列表。

intellisense.addEventListener('statementcompletion', function (event) {

    var attempt = new Object();
    attempt.name = "helllo";
    attempt.value = function() {console.log("helllooo");
    attempt.kind = "function";
    attemp.scope = "global";

    event.items.push(attempt);
});
4

1 回答 1

0

kind的可能值有:“method”、“field”、“property”、“parameter”、“variable”和“reserved”。

以下代码片段应该可以工作。

intellisense.addEventListener('statementcompletion', function (e) {

    e.items.push({name:'Hello', kind:'method'});

});

于 2014-10-13T17:06:06.007 回答