You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [More On Prefix Operations](#more-on-prefix-operations)
49
+
-[More On Prefix Operations](#more-on-prefix-operations)
50
50
51
51
<!-- /MarkdownTOC -->
52
52
@@ -286,6 +286,7 @@ This can be convenient when you want to delete one alternative, write some new c
286
286
287
287
Furthermore, similarly to selecting alternatives, you can simultaneously delete more than one alternatives! you just need to specify more than one colors!
288
288
289
+
289
290

290
291
291
292
@@ -545,6 +546,7 @@ for the most part pretty straightforward I think
545
546
"[smart] swap <color> with <color2>"
546
547
```
547
548
549
+
548
550

549
551
550
552
Do keep in mind that alternatives do persist, though they of course get updated
@@ -676,7 +678,7 @@ Was introduced
676
678
677
679
678
680
679
-
### More On Prefix Operations
681
+
## More On Prefix Operations
680
682
681
683
682
684
When we talked earlier about prefix operations, it was briefly mentioned that these are executed silently. But what does it mean? It means that actions can be taken such as selecting some text, inserting or removing some text but at the end of the day these double queries do not change the state the way simple selection queries do. They do notset
Copy file name to clipboardExpand all lines: doc/SubIndexing.md
+24-34
Original file line number
Diff line number
Diff line change
@@ -35,8 +35,8 @@ The core idea behind it is that most regions of interest can be conceptually bro
35
35
- [Attributes](#attributes)
36
36
- [Subscript](#subscript)
37
37
- [Old Name As New Name](#old-name-as-new-name)
38
-
- [Forwarding Nodes](#forwarding-nodes)
39
-
- [new with 0.0.4](#new-with-004)
38
+
- [Range Of Elements](#range-of-elements)
39
+
- [Looking Deeper Nodes](#looking-deeper-nodes)
40
40
41
41
<!-- /MarkdownTOC -->
42
42
@@ -45,7 +45,10 @@ The core idea behind it is that most regions of interest can be conceptually bro
45
45
46
46
## Introduction
47
47
48
-
you can find more information about what parts you can extract [below](#selectable).
48
+
You can find more information about what parts you can extract [below](#selectable). In general,I have tried to make sub indexing work as naturally as possible,because I really want you to be able to approach these commands as intuitively as possible without trying to remember all of the various rules. Nonetheless there were cases where design decisions need to be made. And also compromises needed to be reached regarding the issue that you can view code both in a more linear fashion (tokens one after the other) as well as more treelike fashion (like how it is represented in the AST). I hope that my end decisions are not too far away from what you consider as natural thing to do!
49
+
50
+
51
+
49
52
50
53
Now there are two ways in which the sub indexing functionality becomes available to the end-user:
51
54
@@ -280,7 +283,7 @@ I chose to include them commended.
280
283
281
284
## Selectable
282
285
283
-
We have hopefully clarified the syntax and you have already probably seen some examples of what parts you can pickup from a selection. But it is time to go through them and lead to bead Maureen dictate
286
+
We have hopefully clarified the syntax and you have already probably seen some examples of what parts you can pickup from a selection. But it is time to go through some of them, though you should keep in mind that there are more variable!
284
287
285
288
### Multiple Values
286
289
@@ -363,7 +366,7 @@ Compared to want to use to be the case in 0.0.4, this means that you can easily
363
366
364
367
* or combination of the above,
365
368
366
-
in order to grab the individual items,you need to go to level deep
369
+
in order to grab the individual items,you need to go 2 levels deep,which is of course an additional cost compared to 0.0.4
367
370
368
371

369
372
@@ -377,56 +380,43 @@ in order to grab the individual items,you need to go to level deep
377
380
378
381

379
382
380
-
### Forwarding Nodes
381
-
382
-
383
-
384
-

385
-
386
-
387
-
388
-
please note however that we can still pick up such regions as a whole, the whole "forwarding" thing applies only when we try to extract something from them (when we subindex them). To clarify:
389
-
390
-

391
383
384
+
### Range Of Elements
392
385
386
+
Only for dictionaries,sets, lists and tuples
393
387
394
388
389
+

395
390
396
391
397
392
393
+
### Looking Deeper Nodes
398
394
399
-
As illustrated above, you need to pay attention to how the various conditions are bound together
400
-
(or binds weaker causing it to be higher in the AST) in the can only select smaller conditions from the outermost level!
401
395
402
-
This feature existed ever since the initial release but was only documented on 0.0.1 . This release also expanded the feature from applying only to ast.BoolOp nodes to encompass ast.Compare nodes as well! in plain English:
396
+
For certain types of regions such as unary operations, where you have something like
403
397
404
-

398
+
```python
399
+
not some_condition
400
+
```
405
401
406
-
furthermore, big_roi_sub_index can make our lives easier even in cases like the one below:
402
+
sub indexing the unary operation returns the result of sub indexing the
407
403
408
-

404
+
```python
405
+
some_condition
406
+
```
409
407
410
-
where we want to play with the indexes of a subscript!
411
408
412
-
### new with 0.0.4
413
409
414
-
Sub indexing functionality has been expanded to include picking up parts of strings :
415
410
416
-

411
+
please note however that we can still pick up such regions as a whole, the whole "looking deeper" thing applies only when we try to extract something from them (when we subindex them). To clarify:
417
412
418
-
We can pick up parts from the URL, individual words or letters, or part of a camel or snake case. this feature is still immatur and needs more work, but I am planning to improve and also expand it with the ability to select a whole range.
413
+

419
414
420
-
Also something that was kind of missing,you can now select a subset of an arithmetic expression :
421
415
422
-

416
+
you can find more examples that are similar to this one in the [big ROI](./SelectBigROI.md) documentation. Please note also that though partly arbitrarily,partly for compatibility with `caller`, partly because there are already many options for arguments, something similar applies for function calls , as sub indexing them yields the same result see if we walked only with the calling function part!
423
417
424
-
Once again you need to pay attention to operator precedence and as you can see there are some edge cases that need to be fixed.
425
418
426
-
Finally, we clarify one more thing! What about relative vertical offsets when using above? We know that these abstract vertical keywords only count interesting lines, but what do we count as interesting here? To stay compatible with all of the above, we count all lines containing our desired big region of interest regardless of whether we can extract or not from them information with the sub index! As an example:
419
+

427
420
428
-

429
421
430
422
431
-
please note however that there are limitations and sub indexes are more of a solution to make the simplest case faster
432
-
rather than a systematic way of handling complex code!
0 commit comments