Skip to content

Commit 692b938

Browse files
authored
Add files via upload
1 parent b2a0f48 commit 692b938

File tree

1 file changed

+76
-3
lines changed

1 file changed

+76
-3
lines changed

doc/SelectBigROI.md

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,86 @@ Choice("big_roi",{
2828
"assignment full" : "assignment full",
2929

3030
"import statement":"import statement",
31-
"(import|imported) (value|item|object|element)":"import value",
32-
"module" : "module",
3331

3432
"(expression statement|expression)" : "expression statement",
3533

3634
"iterator" : "iterator", "iterable" : "iterable",
3735
} ),
3836
```
3937

40-
I think most of them are pretty aelf explanatory,
38+
I think most of them should be pretty self explanatory.
39+
40+
There are four syntaxes for this command:
41+
42+
```python
43+
"smart <big_roi> [<big_roi_sub_index>]"
44+
45+
"[smart] <adjective> <big_roi> [<big_roi_sub_index>]"
46+
47+
"[smart] <vertical_abstract_only_direction> [<ndir>] <big_roi> [<big_roi_sub_index>]"
48+
49+
"[smart] <vertical_abstract_only_direction> [<ndir>] <block> [<adjective>] <big_roi> [<big_roi_sub_index>]"
50+
```
51+
52+
# Case one
53+
54+
Ok lets start with the simple one, namely queries of the form:
55+
56+
```python
57+
"smart <big_roi>"
58+
```
59+
60+
As you might expect, the plugin will try to find matches to big roi description , prioritizing ones "nearer" in the AST with respect to the current selection.
61+
62+
![](./gif/big1.gif)
63+
64+
However,there are cases where you are interested in only a portion of this whole ROI. For instance there may be multiple targets in the left hand of an assignment and you want to select only one of them. Or your function may return multiple values. In those cases the
65+
66+
```python
67+
IntegerRefST("big_roi_sub_index",0,10),
68+
```
69+
comes in useful:
70+
71+
![](./gif/big2.gif)
72+
73+
74+
# Case two
75+
76+
# Case three
77+
Once again you can use information about the relative vertical position of your ROI with a command like that:
78+
79+
```python
80+
"[smart] <vertical_abstract_only_direction> [<ndir>] <big_roi> [<big_roi_sub_index>]"
81+
```
82+
The only difference compared to argument selection is that you can only use the more "abstract", 'above' and 'below' keywords:
83+
84+
```python
85+
Choice("vertical_abstract_only_direction",{
86+
"above":"above",
87+
"below":"below",
88+
} ),
89+
```
90+
As an example:
91+
92+
![](./gif/big4.gif)
93+
94+
# Case four
95+
96+
Ok this is a bit different:)
97+
This variant combines vertical ans positional order information.
98+
99+
```python
100+
"[smart] <vertical_abstract_only_direction> [<ndir>] <block> [<adjective>] <big_roi> [<big_roi_sub_index>]"
101+
```
102+
What on earth is that "block" thing over there? Well for the time being there is only one option available:
103+
104+
```python
105+
Choice("block",{
106+
"(function|functions)" :"function",
107+
}
108+
),
109+
```
110+
111+
So essentially, we can specify a function using a relative vertical desciption. The command will then work just like cases one and two but will search inside that function!
112+
113+
![](./gif/big5.gif)

0 commit comments

Comments
 (0)