Skip to content

Commit 75b9808

Browse files
committed
Yeah
1 parent 1c55c1e commit 75b9808

File tree

11 files changed

+68
-9
lines changed

11 files changed

+68
-9
lines changed

README.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ In particular, navigation through the code sometimes felt a little bit too mecha
1818
need to be taken to get there. What if you could instead simply describe (syntactically) what you want to select?
1919

2020
PythonVoiceCodingPlugin tries to enable you to do just that!
21-
As implementing such functionality requires the analysis of source code,a task far more suitable to editors.
21+
To provide this functionality, it ships with bundles the implement a grammar, hopefully expressive enough for describing regions of interest, while running on the voice coding macro system side and
22+
cooperate with the core plugin, running on the editor side, arguably the more suitable of the two environments
23+
for analyzing source code and decoding the meaning of queries within the given context.
24+
25+
26+
2227

2328
I want to be honest. This is not exactly the best code ever written. It is far from it:) And it is far from the full functionality i would want it to offer. Nonetheless, I still think that PythonVoiceCodingPlugin is a tool that :
2429

@@ -42,6 +47,7 @@ I want to be honest. This is not exactly the best code ever written. It is far f
4247
* is partly customizable. If you find yourself using certain commands with some given parameters often and want a shorthand smaller command, you can always follow my commented banana example:)
4348

4449

50+
As I said, far from perfect but nonetheless an out-of-the-box solution which I hope to be helpful for beginners to get up to speed and a step towards the right direction. I hope you enjoy using it as much as I have enjoyed coding it:)
4551

4652
## Release and Version
4753

@@ -52,9 +58,9 @@ Currently in preparation of the initial 0.0.0 release , probably between 5-10/11
5258

5359
## Limitations
5460

55-
There are of course certain limitations:
61+
There are of course certain limitations which I would like to make clear from the start:
5662

57-
* Currently I do not fully support python > 3.3 (Still, you can work on code that contains some new features such as async and await keywords, f-strings). That's because Sublime uses python 3.3.6 and I rely on the standard library´s ast module to parse the code. An alternative could have been astroid but it itself uses typed_ast, which contains C code, something which I wanted to avoid. The plugin will most likely eventually change to a client server architecture and simply use an up to date ast module from python 3.7 or the new 3.8.
63+
* Currently I do not fully support python > 3.3 (Still, you can work on code that contains some new features such as async and await keywords, f-strings). That's because Sublime uses python 3.3.6 and I rely on the standard library´s ast module to parse the code. An alternative could have been astroid but it itself uses typed_ast, which contains C code, something which I wanted to avoid. The plugin will most likely eventually change to a client server architecture and simply use an up to date ast module from python 3.7 or the new 3.8. please note that this restriction only concerns the users of new syntactical features. There is no problem , for instance, if you use a new standard library function.
5864

5965
![](gif/l1.gif)
6066

@@ -179,7 +185,7 @@ For specific versions be sure to check the requirements.txt
179185

180186
## Acknowledgements
181187

182-
### Resources
188+
### Useful Learning Resources
183189

184190
The following resources proved very helpfull for the success of the project. Many thanks to all the authors!
185191

@@ -191,4 +197,21 @@ The following resources proved very helpfull for the success of the project. Man
191197

192198
* [sublime 3 unofficial documentation]( http://docs.sublimetext.info/en/latest/index.html )
193199

194-
* the python [grammar]() specification
200+
* the python [grammar]() specification
201+
202+
* of course [the sublime forum]()
203+
204+
205+
### Development tools
206+
207+
Many thanks to all of the developers that have put their time and effort behind projects such as
208+
209+
* Natspeak
210+
211+
* Dragonfly
212+
213+
* Caster
214+
215+
216+
needless to say, while coding PythonVoiceCodingPlugin I used PythonVoiceCodingPlugin :)
217+

doc/README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Choice("adjective",{
3434

3535
} )
3636
```
37-
![](./gif/arg3.gif)
37+
![](./gif/big3.gif)
3838

3939
and
4040

@@ -51,9 +51,11 @@ Choice("vertical_direction",{
5151
```
5252

5353
usually followed by an integer. Beware the difference between up and above! As a rule of thumb, above only takes "interesting" lines into consideration:)
54-
![](./gif/big4.gif)
54+
55+
![](./gif/arg5.gif)
5556

5657
* in certain cases you can combine these two approaches:)
58+
5759
![](./gif/big5.gif)
5860

5961
Details vary but that is the. spirit! Ok , what else?
@@ -128,10 +130,12 @@ Choice("index_collectable",{
128130
"(variable|variables)":"variable",
129131
"( parameter | parameters)":"parameter",
130132
"(module|modules)":"module",
131-
"(import|imported) (value|item|object|element)":"import value",
133+
"imported (value|object)":"import value",
132134
"function ( name |names)":"function name",
133135
}
134136
```
137+
please note that these items are collected from the whole source code.
138+
135139
### Insert Item
136140

137141
These "items" can then be inserted in the current cursor position by means of the
@@ -143,3 +147,18 @@ command. Item_index specifies which item from the collection you want
143147

144148
![](./gif/d5.gif)
145149

150+
### index collectible
151+
152+
certain collectible items such as variables and parameters can be index collected by means of a query like
153+
154+
```python
155+
"[smart] variable <collect_index>"
156+
```
157+
In such a case, items will only be collected from the current function and in item will be inserted
158+
based on the index specified and their order of appearance
159+
160+
![](./gif/d6.gif)
161+
162+
163+
164+

doc/SelectArgument.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Argument Selection Command
22

3+
![](./gif/arg0.gif)
4+
35
This is a SelectionQuery that enables you to select an argument from a function call.
46
It supports the following syntaxes:
57

@@ -115,8 +117,17 @@ now let's see something different:
115117

116118
in this example we use the command:
117119

120+
```python
121+
"[smart] [<adjective>] <level> [<level_index>] argument <argument_index>"
122+
```
118123
For the time being, the only available option for the level parameter is
119124

125+
```python
126+
Choice("level",{
127+
"inside":"inside",
128+
}
129+
),
130+
```
120131
by means of the keyword inside , we can specify that we want an argument from a function call that is nested inside another function call! The level_index parameter
121132

122133
Specifies the index of the argument of the outer function call our desired ROI lies in. In order to specify which outer function goal we are referring to we can optionally use an adjective :
@@ -132,6 +143,9 @@ This, looks very similar to the previous one. However, instead of using the adje
132143

133144
As you can see, the syntax looks like:
134145

146+
```python
147+
"[smart] <level> [<level_index>] <adjective> argument <argument_index>"
148+
```
135149

136150

137151

doc/SelectBigROI.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
These commands are responsible for selecting "big" regions of interest. By "big" we refer to things like "if condition" or "assignment right" in contrast to say the first entry of a dictionary.
44

5+
![](./gif/big0.gif)
6+
7+
58
In particular, the currently offered "big roi´s" are :
69

710
```python
@@ -83,7 +86,7 @@ you should probably be already familiar with adjectives, so here is an example o
8386

8487
![](./gif/big3.gif)
8588

86-
as with case one, only the current function searched.
89+
as with case one, only the current function searched. ( pay attention to my last example where alternatives are only offered from the nested function definition!)
8790

8891

8992

doc/gif/arg6.gif

160 KB
Loading

doc/gif/arg7.gif

168 KB
Loading

doc/gif/arg8.gif

156 KB
Loading

doc/gif/big3.gif

382 KB
Loading

doc/gif/d4.gif

243 KB
Loading

doc/gif/d5.gif

184 KB
Loading

0 commit comments

Comments
 (0)