Skip to content

Commit 2c4d273

Browse files
authored
Stop using end of range as inference source (#301)
* One attempt * More inference fixes
1 parent c5f0cb8 commit 2c4d273

File tree

2 files changed

+58
-3
lines changed

2 files changed

+58
-3
lines changed

src/core/inferFullTargets.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,6 @@ function getPreviousTarget(
176176
}
177177
break;
178178
case "range":
179-
if (useTarget(target.end)) {
180-
return target.end;
181-
}
182179
if (useTarget(target.start)) {
183180
return target.start;
184181
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
spokenForm: bring line bat past end of funk to this
2+
languageId: typescript
3+
command:
4+
actionName: replaceWithTarget
5+
partialTargets:
6+
- type: range
7+
start:
8+
type: primitive
9+
selectionType: line
10+
mark: {type: decoratedSymbol, symbolColor: default, character: b}
11+
end:
12+
type: primitive
13+
position: after
14+
insideOutsideType: inside
15+
modifier: {type: containingScope, scopeType: namedFunction, includeSiblings: false}
16+
excludeStart: false
17+
excludeEnd: false
18+
- type: primitive
19+
mark: {type: cursor}
20+
extraArgs: []
21+
marks:
22+
default.b:
23+
start: {line: 1, character: 8}
24+
end: {line: 1, character: 11}
25+
initialState:
26+
documentContents: |
27+
function foo() {
28+
const bar = "hello";
29+
30+
const baz = "hi";
31+
}
32+
33+
const bongo = "bazman";
34+
selections:
35+
- anchor: {line: 6, character: 20}
36+
active: {line: 6, character: 20}
37+
finalState:
38+
documentContents: |
39+
function foo() {
40+
const bar = "hello";
41+
42+
const baz = "hi";
43+
}
44+
45+
const bar = "hello";
46+
47+
const baz = "hi";
48+
}
49+
selections:
50+
- anchor: {line: 6, character: 20}
51+
active: {line: 6, character: 20}
52+
thatMark:
53+
- anchor: {line: 6, character: 0}
54+
active: {line: 9, character: 1}
55+
sourceMark:
56+
- anchor: {line: 1, character: 2}
57+
active: {line: 4, character: 1}
58+
fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: b}, selectionType: line, position: contents, insideOutsideType: null, modifier: {type: identity}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: b}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: containingScope, scopeType: namedFunction, includeSiblings: false}}}, {type: primitive, mark: {type: cursor}, selectionType: line, position: contents, insideOutsideType: null, modifier: {type: identity}}]

0 commit comments

Comments
 (0)