Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
languageId: typescript
command:
version: 6
spokenForm: change name
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: name}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
class Foo {
bar
}

selections:
- anchor: {line: 1, character: 4}
active: {line: 1, character: 4}
marks: {}
finalState:
documentContents: |-
class Foo {

}

selections:
- anchor: {line: 1, character: 4}
active: {line: 1, character: 4}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
languageId: typescript
command:
version: 6
spokenForm: change type
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: type}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
class Foo {
bar: string;
}

selections:
- anchor: {line: 1, character: 4}
active: {line: 1, character: 4}
marks: {}
finalState:
documentContents: |-
class Foo {
bar: ;
}

selections:
- anchor: {line: 1, character: 9}
active: {line: 1, character: 9}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
languageId: typescript
command:
version: 6
spokenForm: change type
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: type}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
class Foo {
bar(): string {}
}

selections:
- anchor: {line: 1, character: 4}
active: {line: 1, character: 4}
marks: {}
finalState:
documentContents: |-
class Foo {
bar(): {}
}

selections:
- anchor: {line: 1, character: 11}
active: {line: 1, character: 11}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
languageId: typescript
command:
version: 6
spokenForm: change type
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: type}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
interface Foo {
bar: string;
}
selections:
- anchor: {line: 1, character: 16}
active: {line: 1, character: 16}
marks: {}
finalState:
documentContents: |-
interface Foo {
bar: ;
}
selections:
- anchor: {line: 1, character: 9}
active: {line: 1, character: 9}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
languageId: typescript
command:
version: 6
spokenForm: change value
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: value}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
class Foo {
bar: string = "baz";
}

selections:
- anchor: {line: 1, character: 4}
active: {line: 1, character: 4}
marks: {}
finalState:
documentContents: |-
class Foo {
bar: string = ;
}

selections:
- anchor: {line: 1, character: 18}
active: {line: 1, character: 18}
30 changes: 20 additions & 10 deletions queries/typescript.core.scm
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,14 @@
;;! -------------------------------^^^-------
(public_field_definition
name: (_) @name
) @name.domain.start
type: (_
":"
(_) @type
)?
value: (_)? @value
) @_.domain.start
.
";"? @name.domain.end
";"? @_.domain.end
)

[
Expand Down Expand Up @@ -165,7 +170,9 @@

;;!! function ccc(): string {}
;;! ^^^^^^
(function_declaration
;;!! ccc(): string {}
;;! ^^^^^^
(_
parameters: (_) @type.leading.end.endOf
return_type: (_
":"
Expand Down Expand Up @@ -266,13 +273,16 @@
;;! ^^^^
;;! xxxxxx
;;! ------------
(property_signature
name: (_) @collectionKey @collectionKey.trailing.start.endOf @type.leading.start.endOf
type: (_
":"
(_) @type @collectionKey.trailing.end.startOf @type.leading.end.startOf
)
) @_.domain
(
(property_signature
name: (_) @collectionKey @collectionKey.trailing.start.endOf @type.leading.start.endOf
type: (_
":"
(_) @type @collectionKey.trailing.end.startOf @type.leading.end.startOf
)
) @_.domain.start
";"? @_.domain.end
)

;;!! interface Type { name: string; }
;;! ^^^^^^^^^^^^^^^^^
Expand Down