-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #968 from savetheclocktower/tree-sitter-april
Tree-sitter fixes (1.116 edition)
- Loading branch information
Showing
25 changed files
with
385 additions
and
425 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
packages/language-gfm/grammars/modern-tree-sitter-gfm-inline.cson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
scopeName: 'source.gfm.inline' | ||
type: 'modern-tree-sitter' | ||
parser: 'tree-sitter-markdown_inline' | ||
|
||
injectionRegex: '^(markdown-inline-internal)$' | ||
|
||
treeSitter: | ||
parserSource: 'github:MDeiml/tree-sitter-markdown/tree-sitter-markdown-inline#28aa3baef73bd458d053b613b8bd10fd102b4405' | ||
grammar: 'tree-sitter-markdown-inline/tree-sitter-markdown-inline.wasm' | ||
highlightsQuery: 'tree-sitter-markdown-inline/highlights.scm' |
30 changes: 0 additions & 30 deletions
30
packages/language-gfm/grammars/modern-tree-sitter-gfm-with-frontmatter.cson
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
packages/language-gfm/grammars/tree-sitter-markdown-inline/highlights.scm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
; BOLD/ITALIC/OTHER | ||
; =============== | ||
|
||
(emphasis) @markup.italic.gfm | ||
|
||
(emphasis | ||
. (emphasis_delimiter) @punctuation.definition.emphasis.begin.gfm) | ||
|
||
(emphasis | ||
(emphasis_delimiter) @punctuation.definition.emphasis.end.gfm .) | ||
|
||
(strong_emphasis) @markup.bold.gfm | ||
((strong_emphasis) @punctuation.definition.emphasis.begin.gfm | ||
(#set! adjust.endAfterFirstMatchOf "^\\*\\*")) | ||
((strong_emphasis) @punctuation.definition.emphasis.end.gfm | ||
(#set! adjust.startBeforeFirstMatchOf "\\*\\*$")) | ||
|
||
(strikethrough) @markup.strike.gfm | ||
|
||
((strikethrough) @punctuation.definition.strike.begin.gfm | ||
(#set! adjust.endAfterFirstMatchOf "^~~")) | ||
((strikethrough) @punctuation.definition.strike.end.gfm | ||
(#set! adjust.startBeforeFirstMatchOf "~~$")) | ||
|
||
|
||
; INLINE/REPLACED | ||
; =============== | ||
|
||
((uri_autolink) @markup.underline.link | ||
(#set! adjust.startAfterFirstMatchOf "^<") | ||
(#set! adjust.endBeforeFirstMatchOf ">$")) | ||
|
||
((uri_autolink) @punctuation.definition.begin.uri-autolink.gfm | ||
(#set! adjust.endAfterFirstMatchOf "^<")) | ||
|
||
((uri_autolink) @punctuation.definition.end.uri-autolink.gfm | ||
(#set! adjust.startBeforeFirstMatchOf ">$")) | ||
|
||
((link_text (image (image_description))) @_IGNORE_ | ||
(#set! capture.final)) | ||
|
||
[(link_text) (image_description)] @string.unquoted.gfm @meta.link.text | ||
|
||
; The text inside []s in anchors/image syntax. | ||
(full_reference_link | ||
(link_label) @markup.underline.link.gfm | ||
(#set! adjust.startAfterFirstMatchOf "^\\[") | ||
(#set! adjust.endBeforeFirstMatchOf "]$")) | ||
|
||
(image | ||
(link_destination) @markup.underline.link.gfm) | ||
|
||
(inline_link | ||
(link_destination) @markup.underline.link.gfm) | ||
|
||
(link_title) @string.quoted.link-title.gfm | ||
|
||
|
||
; CODE SPANS | ||
; ========== | ||
|
||
(code_span) @meta.embedded.line.inline-code.gfm @markup.raw.inline.gfm | ||
|
||
(code_span | ||
. (code_span_delimiter) @punctuation.definition.begin.string.inline-code.gfm) | ||
|
||
(code_span | ||
(code_span_delimiter) @punctuation.definition.end.string.inline-code.gfm | ||
.) | ||
|
||
|
||
; MISC | ||
; ==== | ||
|
||
(backslash_escape) @constant.character.escape.gfm | ||
|
||
(numeric_character_reference) @constant.character.entity.gfm |
Binary file added
BIN
+368 KB
packages/language-gfm/grammars/tree-sitter-markdown-inline/tree-sitter-markdown-inline.wasm
Binary file not shown.
11 changes: 11 additions & 0 deletions
11
packages/language-gfm/grammars/tree-sitter-markdown/folds.scm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
; Each individual list item can be folded if it's hard-wrapped. | ||
((list_item) @fold | ||
(#set! fold.endAt endPosition) | ||
(#set! fold.adjustToEndOfPreviousRow true)) | ||
|
||
; Each section represents a heading and all the content underneath it until the | ||
; next heading of equivalent or higher importance. | ||
((section) @fold | ||
(#set! fold.endAt endPosition) | ||
(#set! fold.adjustToEndOfPreviousRow true)) |
94 changes: 94 additions & 0 deletions
94
packages/language-gfm/grammars/tree-sitter-markdown/highlights.scm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
; HEADINGS | ||
; ======== | ||
|
||
(setext_heading | ||
heading_content: (_) @markup.heading.heading-1.gfm | ||
(setext_h1_underline) @punctuation.definition.heading-underline.gfm) | ||
|
||
(setext_heading | ||
heading_content: (_) @markup.heading.heading-2.gfm | ||
(setext_h2_underline) @punctuation.definition.heading-underline.gfm) | ||
|
||
(atx_heading | ||
(atx_h1_marker)) @markup.heading.heading-1.gfm | ||
|
||
(atx_heading | ||
(atx_h2_marker)) @markup.heading.heading-2.gfm | ||
|
||
(atx_heading | ||
(atx_h3_marker)) @markup.heading.heading-3.gfm | ||
|
||
(atx_heading | ||
(atx_h4_marker)) @markup.heading.heading-4.gfm | ||
|
||
(atx_heading | ||
(atx_h5_marker)) @markup.heading.heading-5.gfm | ||
|
||
(atx_heading | ||
(atx_h6_marker)) @markup.heading.heading-6.gfm | ||
|
||
|
||
; SECTIONS | ||
; ======== | ||
|
||
(paragraph) @markup.paragraph.gfm | ||
(thematic_break) @markup.horizontal-rule.gfm | ||
|
||
(block_quote) @markup.quote.blockquote.gfm | ||
((block_quote_marker) @punctuation.definition.blockquote.gfm | ||
(#set! adjust.startAndEndAroundFirstMatchOf "\\S")) | ||
|
||
|
||
; LISTS | ||
; ===== | ||
|
||
(list) @meta.list.gfm | ||
|
||
(list_item | ||
(list_marker_dot) @punctuation.definition.list-item.gfm | ||
) @markup.list.numbered | ||
|
||
(list_item | ||
[ | ||
(list_marker_star) | ||
(list_marker_minus) | ||
(list_marker_plus) | ||
] @punctuation.definition.list-item.gfm | ||
) @markup.list.unnumbered | ||
|
||
(task_list_marker_unchecked) @punctuation.definition.task-marker.unchecked.gfm | ||
(task_list_marker_checked) @punctuation.definition.task-marker.unchecked.gfm | ||
|
||
; CODE BLOCKS | ||
; =========== | ||
|
||
(info_string) @storage.modifier.language._TEXT_.gfm | ||
|
||
(fenced_code_block | ||
(code_fence_content) @markup.raw.block.fenced.gfm) @meta.embedded.block.fenced-code.gfm | ||
(indented_code_block) @markup.raw.block.indented.gfm @meta.embedded.block.indented-code.gfm | ||
|
||
|
||
; MISC | ||
; ==== | ||
|
||
(pipe_table) @markup.other.table.gfm | ||
(pipe_table_header | ||
(pipe_table_cell) @markup.other.table-cell.header.gfm) | ||
(pipe_table_row | ||
(pipe_table_cell) @markup.other.table-cell.data.gfm) | ||
(pipe_table_delimiter_row | ||
(pipe_table_delimiter_cell | ||
(_) @punctuation.separator.table-row.gfm) | ||
) | ||
|
||
|
||
; Link definitions | ||
|
||
(link_reference_definition | ||
(link_label) | ||
(link_destination) @markup.underline.link.gfm) | ||
|
||
((link_label) @meta.link.text | ||
(#set! adjust.offsetStart 1) | ||
(#set! adjust.offsetEnd -1)) |
52 changes: 52 additions & 0 deletions
52
packages/language-gfm/grammars/tree-sitter-markdown/tags.scm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
; Each heading counts as a tag for symbol navigation purposes. We'll indicate a | ||
; symbol's heading level with a certain number of dots prepended to the symbol | ||
; name. | ||
|
||
((atx_heading | ||
(atx_h1_marker) | ||
heading_content: (_) @name) @definition.heading | ||
(#set! symbol.strip "(^\\s*|\\s*$)") | ||
(#set! symbol.prepend "· ")) | ||
|
||
((atx_heading | ||
(atx_h2_marker) | ||
heading_content: (_) @name) @definition.heading | ||
(#set! symbol.strip "(^\\s*|\\s*$)") | ||
(#set! symbol.prepend "·· ")) | ||
|
||
((atx_heading | ||
(atx_h3_marker) | ||
heading_content: (_) @name) @definition.heading | ||
(#set! symbol.strip "(^\\s*|\\s*$)") | ||
(#set! symbol.prepend "··· ")) | ||
|
||
((atx_heading | ||
(atx_h4_marker) | ||
heading_content: (_) @name) @definition.heading | ||
(#set! symbol.strip "(^\\s*|\\s*$)") | ||
(#set! symbol.prepend "···· ")) | ||
|
||
((atx_heading | ||
(atx_h5_marker) | ||
heading_content: (_) @name) @definition.heading | ||
(#set! symbol.strip "(^\\s*|\\s*$)") | ||
(#set! symbol.prepend "····· ")) | ||
|
||
((atx_heading | ||
(atx_h6_marker) | ||
heading_content: (_) @name) @definition.heading | ||
(#set! symbol.strip "(^\\s*|\\s*$)") | ||
(#set! symbol.prepend "······ ")) | ||
|
||
((setext_heading | ||
heading_content: (_) @name) @definition.heading | ||
(setext_h1_underline) | ||
(#set! symbol.strip "(^\\s*|\\s*$)") | ||
(#set! symbol.prepend "· ")) | ||
|
||
((setext_heading | ||
heading_content: (_) @name) @definition.heading | ||
(setext_h2_underline) | ||
(#set! symbol.strip "(^\\s*|\\s*$)") | ||
(#set! symbol.prepend "·· ")) |
Binary file added
BIN
+369 KB
packages/language-gfm/grammars/tree-sitter-markdown/tree-sitter-markdown.wasm
Binary file not shown.
Binary file removed
BIN
-3.34 KB
packages/language-gfm/grammars/tree-sitter/tree-sitter-frontmatter.wasm
Binary file not shown.
1 change: 0 additions & 1 deletion
1
packages/language-gfm/grammars/tree-sitter/tree-sitter-frontmatter/highlights.scm
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-413 KB
packages/language-gfm/grammars/tree-sitter/tree-sitter-markdown.wasm
Binary file not shown.
22 changes: 0 additions & 22 deletions
22
packages/language-gfm/grammars/tree-sitter/tree-sitter-markdown/folds.scm
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.