Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 521320 - Function parameter JSDoc assist does not work when type …
…is {?} (#158)
  • Loading branch information
mrennie committed Aug 29, 2017
1 parent ee564a2 commit 3504f96
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Expand Up @@ -354,7 +354,7 @@ define([
proposals.push(createProposal(_name, Messages['funcProposalDescription'], prefix));
}
}
} else if((val = /\s*\*\s*\@param\s*(?:\{[\w.]*\})?\s*(\w*)/ig.exec(line.line)) !== null) {
} else if((val = /\s*\*\s*\@param\s*(?:\{.*\})?\s*(\w*)/ig.exec(line.line)) !== null) {
if(val[1] === prefix) {
node = Finder.findNodeAfterComment(comment, file.ast);
if(node) {
Expand Down
Expand Up @@ -4552,7 +4552,24 @@ define([
['c', 'c - Function parameter']
]);
});

/**
* Tests function parameter name completion with the any type
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=521320
* @since 16.0
*/
it("test param name completion with any type", function(done) {
var options = {
buffer: "/**\n* @param {?} \n*/ function a(a, b, c){}",
line: '* @param {?} ',
prefix: "",
offset: 13,
callback: done};
testProposals(options, [
['a', 'a - Function parameter'],
['b', 'b - Function parameter'],
['c', 'c - Function parameter']
]);
});
/**
* Tests func decl param name proposals no prefix, no type
* @since 10.0
Expand Down

0 comments on commit 3504f96

Please sign in to comment.