Comments (4)
I am looking at replacing my current regex-based function parsing with Simn's haxeparser. That should help deal with these scenarios.
Any thoughts on what should go in the comment? Outputting the whole struct definition there?
from codedox.
It should probably be the whole definition, since that's what the "type" is. In practice, you probably wouldn't want that (well, personally I wouldn't use ${type}
for @param
docs anyway) or use a typedef to begin with.
Note that with haxeparser, you will start to run into issues with conditional compilation - it behaves exactly like the Haxe compiler's parser, in that it throws away any #if
blocks that are not active. It should still be more solid than what you currently have though. :)
from codedox.
And of course, the file actually needs to be parsable (which might not always be the case in a code editor context).
We need something that can a) deal with conditional compilation and b) is error robust as well for vshaxe eventually - @nadako has started working on something for that: https://github.com/nadako/crazyparser (not usable yet afaik)
from codedox.
I did run into the "code has to be parsable" issue already. So now I'm experimenting with extracting just the function to be documented, inserting that into a phony class declaration, and give that to the parser (since it does no seem to expose any ability to parse parts of documents).
If that fails parsing because the function is body is not valid yet then I will then replace the function body with something bogus and lose the ability to determine return type when not specified in the signature.
Thanks for the heads up on the #if
issue.
We'll see how it goes.
from codedox.
Related Issues (20)
- "commentend" has a hardcoded space? HOT 3
- Spaces added for non-function docs HOT 2
- Extension needs to run once before picking up key commands HOT 5
- No selection with \n in commentdescription HOT 7
- Enable Travis CI HOT 2
- Haxe comment conventions for dox HOT 4
- Is it possible to use this for other syntaxes? HOT 3
- is @return only auto insert for ts files? HOT 1
- File name and base file name Parameters HOT 3
- Suggest including License name at the top of default license template.
- Header-Width
- onEnter rules with empty prefix break auto-indent
- Support for function expressions HOT 7
- Publish extension to open-vsx.org
- Was causing lag issues HOT 6
- Populating incorrect signatures.
- Incorrect doc template created when function takes a function as a parameter
- ${type} is inserted as-is without type hints HOT 1
- Function body of braceless function used as return type 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 codedox.