Comments (8)
This is the output i get when i run.
Can you please be more specific and point out the error, gif or screenshot would be helpful
/**
* [get_function_return_type description]
* @param {[type]} name [description]
* @param {[type]} retval [description]
* @return {[type]} [description]
*/
DocsParser.prototype.get_function_return_type = function(name, retval) {
return 123;
};
from docblockr.
I am having the same issue, and seem to have narrowed down the problem. Both function expressions and declarations do not get a return value in the doc block if the name contains a capital letter.
This gets a return value in the doc block:
var a = function () {
return;
};
This doesn't:
var A = function () {
return;
};
This doesn't either:
var aA = function () {
return;
};
from docblockr.
I'm getting the same issue in PHP:
Lower-case method name:
/**
* [dosomething description]
*
* @param [type] $xray [description]
* @param array $yankee [description]
* @param [type] $zulu [description]
*
* @return [type] [description]
*/
public function dosomething($xray, array $yankee = array(), $zulu)
{
return 1;
}
Method name containing an upper-case character:
/**
* [doSomething description]
*
* @param [type] $xray [description]
* @param array $yankee [description]
* @param [type] $zulu [description]
*/
public function doSomething($xray, array $yankee = array(), $zulu)
{
return 1;
}
from docblockr.
I'm getting the exact same results as @chriscollinsboxuk in PHP.
from docblockr.
Ditto, in JS.
from docblockr.
The offending method is DocsParser.prototype.get_function_return_type
: https://github.com/NikhilKalige/docblockr/blob/master/lib/docsparser.js#L202
It's trying to infer a return
type.
if(name.search(/[A-Z]/) > -1)
return null; // no return, but should add a class
is the statement causing it to fail.
Anybody have any thoughts on what this method should actually be checking for?
from docblockr.
From the README:
In Javascript, if the function begins with an uppercase letter then it is assumed that the function is a class definition. No @return tag is added.
search()
returns the index of the first match, so if set our condition to only match for the 0th index then it won't trigger for caps throughout the function name. This should fix it:
- if(name.search(/[A-Z]/) > -1)
+ if(name.search(/[A-Z]/) === 0)
PR here: #91
from docblockr.
merged for next release thx
from docblockr.
Related Issues (20)
- Not generating type information for Typescript HOT 1
- working with multi-cursor HOT 1
- 请修复ATOM中不能使用逗号的问题 HOT 10
- ///, //!, and // not extending to new line HOT 3
- Uncaught TypeError: self.event.abortKeyBinding is not a function
- Uncaught TypeError: Cannot read property 'getCursors' of null
- PHP class variables HOT 1
- Enhancement: Add support to remove/undo multiline comment blocks HOT 2
- Request of improvement: customised text width when wrapping comments HOT 1
- Request of improvement: When pasting multiple lines, also prepend them with comment chars HOT 1
- Cannot seem to figure out how to get the spacing right… HOT 1
- Suggestion: Add option to indent items with tabs instead of spaces HOT 2
- Use `@type` for getter values, not `@returns`
- Decorate does nothing HOT 6
- When a function has an object param HOT 1
- Rustdoc support doesn't seem to be working HOT 1
- Create docs without description [FeatureRequest] HOT 1
- Do not continue comments after newline! HOT 1
- per-project Configuration file HOT 1
- Replace type by parameter name (C++) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docblockr.