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
Expand Up @@ -24,8 +24,9 @@ initialState:
finalState:
documentContents: |-
- values
- 0- 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol that before

- 0
- 1
- 2
selections:
- anchor: {line: 1, character: 7}
active: {line: 1, character: 7}
- anchor: {line: 2, character: 4}
active: {line: 2, character: 4}
5 changes: 3 additions & 2 deletions data/fixtures/recorded/languages/markdown/chuckItem4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ finalState:
documentContents: |-
- values
- 0

selections:
- anchor: {line: 1, character: 7}
active: {line: 1, character: 7}
- anchor: {line: 2, character: 4}
active: {line: 2, character: 4}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ initialState:
end: {line: 0, character: 5}
finalState:
documentContents: |
- (aaa)
- bbb
- (aaa
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You now need to use line item to get the old behavior

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to include the children by default (the new way) because you can easily narrow the scope but it's harder to widen it arbitrarily

- bbb)
selections:
- anchor: {line: 2, character: 0}
active: {line: 2, character: 0}
69 changes: 69 additions & 0 deletions data/fixtures/scopes/markdown/collectionItem.unenclosed.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
- This is the first level of a list.
- This is the second level of a list.
- This is the first level of a list again.
---

[#1 Content] = 0:2-1:39
>----------------------------------
0| - This is the first level of a list.
1| - This is the second level of a list.
---------------------------------------<

[#1 Removal] = 0:0-2:0
>------------------------------------
0| - This is the first level of a list.
1| - This is the second level of a list.
2| - This is the first level of a list again.
<

[#1 Trailing delimiter] = 1:39-2:0
>
1| - This is the second level of a list.
2| - This is the first level of a list again.
<

[#1 Domain] = 0:0-1:39
>------------------------------------
0| - This is the first level of a list.
1| - This is the second level of a list.
---------------------------------------<

[#1 Insertion delimiter] = "\n"


[#2 Content] = 1:4-1:39
>-----------------------------------<
1| - This is the second level of a list.

[#2 Removal] = 1:0-1:39
>---------------------------------------<
1| - This is the second level of a list.

[#2 Leading delimiter] = 1:0-1:2
>--<
1| - This is the second level of a list.

[#2 Domain] = 1:2-1:39
>-------------------------------------<
1| - This is the second level of a list.

[#2 Insertion delimiter] = "\n"


[#3 Content] = 2:2-2:42
>----------------------------------------<
2| - This is the first level of a list again.

[#3 Removal] = 2:0-2:42
>------------------------------------------<
2| - This is the first level of a list again.

[#3 Leading delimiter] = 2:0-2:0
><
2| - This is the first level of a list again.

[#3 Domain] = 2:0-2:42
>------------------------------------------<
2| - This is the first level of a list again.

[#3 Insertion delimiter] = "\n"
1 change: 1 addition & 0 deletions packages/common/src/scopeSupportFacets/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = {
"comment.block": supported,
section: supported,
notebookCell: supported,
"collectionItem.unenclosed": supported,
};
21 changes: 8 additions & 13 deletions queries/markdown.scm
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,17 @@
;;! ^
;;! ---
(list
(list_item
(paragraph
(inline) @_.leading.endOf
)
)?
(list_item)? @collectionItem.leading.endOf
.
(list_item
(_) @_.prefix
(paragraph
(inline) @collectionItem
)
) @_.domain
(_) @collectionItem.prefix
(paragraph) @collectionItem.start.startOf
) @collectionItem.end.endOf @collectionItem.domain
.
(list_item)? @_.trailing.startOf
(#trim-end! @_.domain)
(#insertion-delimiter! @collectionItem "\n")
(list_item)? @collectionItem.trailing.startOf
(#trim-end! @collectionItem.end.endOf)
(#trim-end! @collectionItem.domain)
(#insertion-delimiter! @collectionItem.start.startOf "\n")
)

(list) @collectionItem.iteration
Expand Down
Loading