Commit Graph

60 Commits

Author SHA1 Message Date
Daniel Mathiot
518515be3e (lua) Add ldoc annotation convention 2021-08-29 18:43:11 +02:00
Daniel Mathiot
460d022cc1 (c) Add support for functions that return pointers 2021-08-28 15:28:14 +02:00
Daniel Mathiot
c9ea7ee461 (c) Support for params with unlimited amount of pointers
I created a new option in tree called : 'first_recursive' that will find
the first node matching the node_type recursively.
Closes #10
2021-08-28 13:39:27 +02:00
Daniel Mathiot
ad5ed45205 Typo 2021-08-28 10:25:03 +02:00
Daniel Mathiot
e22c69a265 (c) Fix cursor in c configuration 2021-08-28 01:44:54 +02:00
Daniel Mathiot
499a4301fa Fix first time insert mode
I did a silly workaround because when at normal mode and going to insert
mode, it is not the same as being in insert mode and going to insert
mode. Somehow the cursor jumping is broken.

So what i did was to call a insert_mode a first time before any actual
jumping.
2021-08-28 01:31:51 +02:00
Daniel Mathiot
56b20fcd11 Fix default behaviour when no input after cursor 2021-08-28 00:39:13 +02:00
Daniel Mathiot
e9cc44266e Add jumpable method 2021-08-27 23:29:44 +02:00
Daniel Mathiot
c5bc73cb27 Add jump mapping to configuration 2021-08-27 22:36:44 +02:00
Daniel Mathiot
95d2368ccc (python, js, c) Add support for multiple cursor 2021-08-27 22:21:43 +02:00
Daniel Mathiot
c9ba1dcc5d Created wrapped around jump + Doc
You can now jump to next annotation field with:

require('neogen').jump_next()

Added docs for cursor utilities
2021-08-27 22:10:14 +02:00
Daniel Mathiot
1e1b780877 Add space after input field 2021-08-27 22:02:50 +02:00
Daniel Mathiot
6c89fd0714 Delete previous marks before adding new ones
It was causing some issues when there were still extmarks left and we
generated annotation just after
2021-08-27 21:46:19 +02:00
Daniel Mathiot
1d97f1415e Add default value for template 2021-08-27 21:19:19 +02:00
Daniel Mathiot
2c9936781f Add multiple cursor positioning to template 2021-08-27 20:23:48 +02:00
Daniel Mathiot
80383b7004 Remove unused condition for input_after_comment
It should fix the issue #8
2021-08-27 13:35:03 +02:00
Daniel Mathiot
b525173cd7 Fix behavior when calling different types
This Closes #5 and exposes something that I was not aware of:
lua seems to perform shallow copies when doing table assignments
2021-08-27 13:17:27 +02:00
Daniel Mathiot
4cebcbcfdf (c) Fix return_statement in tree
As the return statement in inside the body (aka compound_statement in TS), it was not being recognized.
I added it and return_statement is now being retrieved.
2021-08-27 12:09:35 +02:00
Andreas Schneider
29679840d6 Add support for C-doxygen 2021-08-27 12:00:07 +02:00
Daniel Mathiot
fddd50553e (lua) types are now guessed for type annotations
This made me to do small adjustments to the tree extractor, and it now
can retrieve fixed positions from the tree. If no node_type name is
specified, it will put all nodes fetched from fixed positions to ["_"]
= values
2021-08-26 12:28:46 +02:00
Daniel Mathiot
d90b697104 Only append annotation if there's one 2021-08-26 12:27:56 +02:00
Daniel Mathiot
48f8f4dd65 (lua) Full specs for type annotations 2021-08-26 11:03:41 +02:00
Daniel Mathiot
93797725e6 (js) Add support for class 2021-08-25 15:49:26 +02:00
Daniel Mathiot
b57e833e32 Fix template not rendering with no opts.type 2021-08-25 14:29:26 +02:00
Daniel Mathiot
a8954178da (lua) add type annotation for variables 2021-08-25 14:13:32 +02:00
Daniel Mathiot
1002ae5948 Add support for multiple types, see Readme:Usage 2021-08-25 13:39:55 +02:00
Daniel Mathiot
f5390e1c1f Refactor of default generator 2021-08-25 12:32:17 +02:00
Daniel Mathiot
ce765cc43c (lua) Add support for returns in local_functions
The extractor function being the same, I refactored the lua config file
a little bit
2021-08-25 12:22:36 +02:00
Daniel Mathiot
85cd80f8e6 If blank line is specified, do not add indentation
Closes #4
2021-08-24 22:11:54 +02:00
Daniel Mathiot
b58292f71f Add default comments when no results (python, lua) 2021-08-24 17:06:32 +02:00
Daniel Mathiot
bf66cb12b5 (js) Add support for functions in var_declarations 2021-08-24 12:52:16 +02:00
Daniel Mathiot
14424a0887 (js) Add support for functions in statements 2021-08-24 12:44:33 +02:00
Daniel Mathiot
3a40a1d111 Add support for empty jsdoc comment 2021-08-24 12:09:43 +02:00
Daniel Mathiot
98329fcf77 Add basic support for javascript
At the moment, it recognizes simple functions, their params and their
direct return statements.
2021-08-24 11:43:45 +02:00
Daniel Mathiot
77515a574d Refactor to a simpler tree parsing
You can now parse the syntax tree more efficiently with the new
utilities functions.
For examples, please check out the lua and python configurations
2021-08-24 09:41:15 +02:00
Daniel Mathiot
790c98edf1 Removed return if body is not found (python) 2021-08-23 20:03:14 +02:00
Daniel Mathiot
ee1e1a491c Add support for numpydoc 2021-08-23 19:11:44 +02:00
Daniel Mathiot
88c4d40078 Support for optional params in python 2021-08-23 18:31:22 +02:00
Daniel Mathiot
969c0342af Add typed parameters support in python 2021-08-23 18:19:24 +02:00
Daniel Mathiot
82b943ccdf Add return statement for python function 2021-08-23 17:54:01 +02:00
Daniel Mathiot
3272811aa7 Add support for attributes in python class 2021-08-23 17:30:19 +02:00
Daniel Mathiot
52128c1bd5 Add utilities
After a refactoring of utilities, I added a function to get the first
child node that matches the node name.

Documentation is provided in neogen.utilities.nodes
2021-08-23 16:00:43 +02:00
Daniel Mathiot
6b08b2297c Delete unused FIXME 2021-08-23 15:24:48 +02:00
Daniel Mathiot
46febe447c Use child name to append text after parent
Instead of providing the number of childs to append after the parent, it
will append the comment just after the first child encountered with
child_name
2021-08-23 15:23:27 +02:00
Daniel Mathiot
03781f23d6 Make comment in after position more resilient 2021-08-23 15:08:41 +02:00
Daniel Mathiot
40616b25d7 Add python support
At the moment, only supports params for function definitions.
I added more options to configure the default generator (please see the
templates field in configuration/python.lua)
2021-08-23 12:53:27 +02:00
Daniel Mathiot
2eb4f76cc9 Make template.annotation_convention a standard
The default generator will now use the annotation_convention field in
template in order to use the requested template
2021-08-23 11:33:08 +02:00
Daniel Mathiot
dd54ea7708 Specify template convention in lua 2021-08-23 10:51:29 +02:00
Daniel Mathiot
96319356fa Add input_after_comment configuration
When set to true (default true), the cursor will go back to the start of
the added comments and trigger insert mode
2021-08-21 18:20:29 +02:00
Daniel Mathiot
ec09985e9d Add return statement for lua
At the moment, it only extracts return statements from direct children
of the function_definition
2021-08-21 18:05:03 +02:00