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
26 changes: 26 additions & 0 deletions data/fixtures/recorded/languages/markdown/changePair.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
languageId: markdown
command:
version: 7
spokenForm: change pair
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: surroundingPair, delimiter: any}
usePrePhraseSnapshot: false
initialState:
documentContents: |-
```python
a = 2
```
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
marks: {}
finalState:
documentContents: ""
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export const simpleSurroundingPairNames = [
"parentheses",
"singleQuotes",
"squareBrackets",
"tripleBacktickQuotes",
"tripleDoubleQuotes",
"tripleSingleQuotes",
] as const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const surroundingPairsDelimiters: Record<
backtickQuotes: ["`", "`"],
squareBrackets: ["[", "]"],
singleQuotes: ["'", "'"],
tripleBacktickQuotes: ["```", "```"],
tripleDoubleQuotes: ['"""', '"""'],
tripleSingleQuotes: ["'''", "'''"],
whitespace: [" ", " "],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ type DelimiterMap = Record<
| [IndividualDelimiterText, IndividualDelimiterText, Options]
>;

// Note that the order here is important since we are creating a regex from the key order.
// For example triple quotes need to come before single quotes.
const delimiterToText: DelimiterMap = Object.freeze({
angleBrackets: [
["</", "<"],
[">", "/>"],
],
backtickQuotes: ["`", "`"],
curlyBrackets: [["{", "${"], "}"],
tripleBacktickQuotes: [[], []],
tripleDoubleQuotes: [[], []],
tripleSingleQuotes: [[], []],
doubleQuotes: ['"', '"', { isSingleLine: true }],
Expand All @@ -37,6 +39,7 @@ const delimiterToText: DelimiterMap = Object.freeze({
escapedSquareBrackets: ["\\[", "\\]"],
escapedSingleQuotes: ["\\'", "\\'", { isSingleLine: true }],
parentheses: [["(", "$("], ")"],
backtickQuotes: ["`", "`"],
singleQuotes: ["'", "'", { isSingleLine: true }],
squareBrackets: ["[", "]"],
});
Expand All @@ -63,6 +66,10 @@ const delimiterToTextOverrides: Record<string, Partial<DelimiterMap>> = {
tripleDoubleQuotes: ['"""', '"""'],
},

markdown: {
tripleBacktickQuotes: ["```", "```"],
},

ruby: {
tripleDoubleQuotes: ["%Q(", ")"],
},
Expand All @@ -84,6 +91,7 @@ export const complexDelimiterMap: Record<
string: [
"tripleDoubleQuotes",
"tripleSingleQuotes",
"tripleBacktickQuotes",
"doubleQuotes",
"singleQuotes",
"backtickQuotes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const defaultSpokenFormMapCore: DefaultSpokenFormMapDefinition = {
singleQuotes: "twin",
tripleDoubleQuotes: isPrivate("triple quad"),
tripleSingleQuotes: isPrivate("triple twin"),
tripleBacktickQuotes: isPrivate("triple skis"),
any: "pair",
string: "string",
whitespace: "void",
Expand Down
Loading