diff --git a/data/fixtures/scopes/talon-list/comment.line.scope b/data/fixtures/scopes/talon-list/comment.line.scope new file mode 100644 index 0000000000..42719cdbb8 --- /dev/null +++ b/data/fixtures/scopes/talon-list/comment.line.scope @@ -0,0 +1,10 @@ +# Hello world +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| # Hello world + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/talon-list/key.mapPair.iteration.scope b/data/fixtures/scopes/talon-list/key.mapPair.iteration.scope new file mode 100644 index 0000000000..dd89cf71ee --- /dev/null +++ b/data/fixtures/scopes/talon-list/key.mapPair.iteration.scope @@ -0,0 +1,12 @@ + +foo: bar + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| foo: bar +2| + < diff --git a/data/fixtures/scopes/talon-list/key.mapPair.scope b/data/fixtures/scopes/talon-list/key.mapPair.scope new file mode 100644 index 0000000000..3c8a244c68 --- /dev/null +++ b/data/fixtures/scopes/talon-list/key.mapPair.scope @@ -0,0 +1,14 @@ +not app: vscode +- +--- + +[Content] = +[Removal] = 0:0-0:7 + >-------< +0| not app: vscode + +[Domain] = 0:0-0:15 + >---------------< +0| not app: vscode + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon-list/key.mapPair2.scope b/data/fixtures/scopes/talon-list/key.mapPair2.scope new file mode 100644 index 0000000000..791ecaef96 --- /dev/null +++ b/data/fixtures/scopes/talon-list/key.mapPair2.scope @@ -0,0 +1,13 @@ +foo: bar +--- + +[Content] = +[Removal] = 0:0-0:3 + >---< +0| foo: bar + +[Domain] = 0:0-0:8 + >--------< +0| foo: bar + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon-list/name.iteration.document.scope b/data/fixtures/scopes/talon-list/name.iteration.document.scope new file mode 100644 index 0000000000..dd89cf71ee --- /dev/null +++ b/data/fixtures/scopes/talon-list/name.iteration.document.scope @@ -0,0 +1,12 @@ + +foo: bar + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| foo: bar +2| + < diff --git a/data/fixtures/scopes/talon-list/name.variable.scope b/data/fixtures/scopes/talon-list/name.variable.scope new file mode 100644 index 0000000000..9822c0f598 --- /dev/null +++ b/data/fixtures/scopes/talon-list/name.variable.scope @@ -0,0 +1,21 @@ +not app: vscode +- +--- + +[Content] = 0:4-0:7 + >---< +0| not app: vscode + +[Removal] = 0:3-0:7 + >----< +0| not app: vscode + +[Leading delimiter] = 0:3-0:4 + >-< +0| not app: vscode + +[Domain] = 0:0-0:15 + >---------------< +0| not app: vscode + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon-list/name.variable2.scope b/data/fixtures/scopes/talon-list/name.variable2.scope new file mode 100644 index 0000000000..791ecaef96 --- /dev/null +++ b/data/fixtures/scopes/talon-list/name.variable2.scope @@ -0,0 +1,13 @@ +foo: bar +--- + +[Content] = +[Removal] = 0:0-0:3 + >---< +0| foo: bar + +[Domain] = 0:0-0:8 + >--------< +0| foo: bar + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon-list/statement.iteration.document.scope b/data/fixtures/scopes/talon-list/statement.iteration.document.scope new file mode 100644 index 0000000000..dd89cf71ee --- /dev/null +++ b/data/fixtures/scopes/talon-list/statement.iteration.document.scope @@ -0,0 +1,12 @@ + +foo: bar + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| foo: bar +2| + < diff --git a/data/fixtures/scopes/talon-list/statement.variable.scope b/data/fixtures/scopes/talon-list/statement.variable.scope new file mode 100644 index 0000000000..0c8fd08d97 --- /dev/null +++ b/data/fixtures/scopes/talon-list/statement.variable.scope @@ -0,0 +1,16 @@ +not app: vscode +- +--- + +[Content] = +[Domain] = 0:0-0:15 + >---------------< +0| not app: vscode + +[Removal] = 0:0-1:0 + >--------------- +0| not app: vscode +1| - + < + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/talon-list/statement.variable2.scope b/data/fixtures/scopes/talon-list/statement.variable2.scope new file mode 100644 index 0000000000..b6c14269fb --- /dev/null +++ b/data/fixtures/scopes/talon-list/statement.variable2.scope @@ -0,0 +1,10 @@ +foo: bar +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| foo: bar + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/talon-list/string.singleLine.scope b/data/fixtures/scopes/talon-list/string.singleLine.scope new file mode 100644 index 0000000000..cb3ca88f35 --- /dev/null +++ b/data/fixtures/scopes/talon-list/string.singleLine.scope @@ -0,0 +1,17 @@ +foo: "bar" +--- + +[Content] = +[Domain] = 0:5-0:10 + >-----< +0| foo: "bar" + +[Removal] = 0:4-0:10 + >------< +0| foo: "bar" + +[Leading delimiter] = 0:4-0:5 + >-< +0| foo: "bar" + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon-list/textFragment.comment.line.scope b/data/fixtures/scopes/talon-list/textFragment.comment.line.scope new file mode 100644 index 0000000000..2c362ef415 --- /dev/null +++ b/data/fixtures/scopes/talon-list/textFragment.comment.line.scope @@ -0,0 +1,10 @@ +# Hello world +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| # Hello world + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon-list/textFragment.string.singleLine.scope b/data/fixtures/scopes/talon-list/textFragment.string.singleLine.scope new file mode 100644 index 0000000000..a0025ac673 --- /dev/null +++ b/data/fixtures/scopes/talon-list/textFragment.string.singleLine.scope @@ -0,0 +1,10 @@ +foo: "bar" +--- + +[Content] = +[Removal] = +[Domain] = 0:6-0:9 + >---< +0| foo: "bar" + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon-list/value.iteration.document.scope b/data/fixtures/scopes/talon-list/value.iteration.document.scope new file mode 100644 index 0000000000..dd89cf71ee --- /dev/null +++ b/data/fixtures/scopes/talon-list/value.iteration.document.scope @@ -0,0 +1,12 @@ + +foo: bar + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| foo: bar +2| + < diff --git a/data/fixtures/scopes/talon-list/value.mapPair.iteration.scope b/data/fixtures/scopes/talon-list/value.mapPair.iteration.scope new file mode 100644 index 0000000000..dd89cf71ee --- /dev/null +++ b/data/fixtures/scopes/talon-list/value.mapPair.iteration.scope @@ -0,0 +1,12 @@ + +foo: bar + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| foo: bar +2| + < diff --git a/data/fixtures/scopes/talon-list/value.mapPair.scope b/data/fixtures/scopes/talon-list/value.mapPair.scope new file mode 100644 index 0000000000..b4a5a94286 --- /dev/null +++ b/data/fixtures/scopes/talon-list/value.mapPair.scope @@ -0,0 +1,22 @@ + +foo: bar + +--- + +[Content] = 1:5-1:8 + >---< +1| foo: bar + +[Removal] = 1:4-1:8 + >----< +1| foo: bar + +[Leading delimiter] = 1:4-1:5 + >-< +1| foo: bar + +[Domain] = 1:0-1:8 + >--------< +1| foo: bar + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon-list/value.variable.scope b/data/fixtures/scopes/talon-list/value.variable.scope new file mode 100644 index 0000000000..8794c71370 --- /dev/null +++ b/data/fixtures/scopes/talon-list/value.variable.scope @@ -0,0 +1,20 @@ +foo: bar +--- + +[Content] = 0:5-0:8 + >---< +0| foo: bar + +[Removal] = 0:4-0:8 + >----< +0| foo: bar + +[Leading delimiter] = 0:4-0:5 + >-< +0| foo: bar + +[Domain] = 0:0-0:8 + >--------< +0| foo: bar + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon-list/value.variable2.scope b/data/fixtures/scopes/talon-list/value.variable2.scope new file mode 100644 index 0000000000..9c2ccb956e --- /dev/null +++ b/data/fixtures/scopes/talon-list/value.variable2.scope @@ -0,0 +1,20 @@ +foo: "bar" +--- + +[Content] = 0:5-0:10 + >-----< +0| foo: "bar" + +[Removal] = 0:4-0:10 + >------< +0| foo: "bar" + +[Leading delimiter] = 0:4-0:5 + >-< +0| foo: "bar" + +[Domain] = 0:0-0:10 + >----------< +0| foo: "bar" + +[Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/languageScopeSupport.ts b/packages/common/src/scopeSupportFacets/languageScopeSupport.ts index 31778fa1a2..d1cfc7879b 100644 --- a/packages/common/src/scopeSupportFacets/languageScopeSupport.ts +++ b/packages/common/src/scopeSupportFacets/languageScopeSupport.ts @@ -27,13 +27,17 @@ import { scmScopeSupport } from "./scm"; import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { scssScopeSupport } from "./scss"; import { talonScopeSupport } from "./talon"; +import { talonListScopeSupport } from "./talon-list"; import { typescriptScopeSupport } from "./typescript"; import { typescriptreactScopeSupport } from "./typescriptreact"; import { xmlScopeSupport } from "./xml"; import { yamlScopeSupport } from "./yaml"; +/* eslint-disable @typescript-eslint/naming-convention */ + export const languageScopeSupport: StringRecord = { + "talon-list": talonListScopeSupport, c: cScopeSupport, clojure: clojureScopeSupport, cpp: cppScopeSupport, diff --git a/packages/common/src/scopeSupportFacets/properties.ts b/packages/common/src/scopeSupportFacets/properties.ts index 3a830f6521..0acba4feaa 100644 --- a/packages/common/src/scopeSupportFacets/properties.ts +++ b/packages/common/src/scopeSupportFacets/properties.ts @@ -7,15 +7,16 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { "statement.variable": supported, "statement.iteration.document": supported, - "key.mapPair.iteration": supported, - "key.mapPair": supported, - "name.iteration.document": supported, "name.variable": supported, + "name.iteration.document": supported, + + "key.mapPair": supported, + "key.mapPair.iteration": supported, - "value.iteration.document": supported, - "value.mapPair.iteration": supported, "value.mapPair": supported, + "value.mapPair.iteration": supported, "value.variable": supported, + "value.iteration.document": supported, "comment.line": supported, "textFragment.comment.line": supported, @@ -301,18 +302,21 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { "value.command": notApplicable, "interior.command": notApplicable, - // Miscellaneous statements - "statement.break": notApplicable, - "statement.continue": notApplicable, - "statement.assignment": notApplicable, - "statement.iteration.block": notApplicable, - // Assignment + "statement.assignment": notApplicable, "name.assignment": notApplicable, "value.assignment": notApplicable, - // Miscellaneous + // Block "name.iteration.block": notApplicable, + "value.iteration.block": notApplicable, + "statement.iteration.block": notApplicable, + + // Miscellaneous statements + "statement.break": notApplicable, + "statement.continue": notApplicable, + + // Miscellaneous "statement.misc": notApplicable, "type.cast": notApplicable, "type.iteration.block": notApplicable, @@ -320,7 +324,6 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument.iteration": notApplicable, "type.typeArgument": notApplicable, "type.variable": notApplicable, - "value.iteration.block": notApplicable, disqualifyDelimiter: notApplicable, environment: notApplicable, fieldAccess: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/talon-list.ts b/packages/common/src/scopeSupportFacets/talon-list.ts new file mode 100644 index 0000000000..bb6a7a8ab9 --- /dev/null +++ b/packages/common/src/scopeSupportFacets/talon-list.ts @@ -0,0 +1,337 @@ +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; + +const { supported, notApplicable } = ScopeSupportFacetLevel; + +export const talonListScopeSupport: LanguageScopeSupportFacetMap = { + "statement.variable": supported, + "statement.iteration.document": supported, + + "name.variable": supported, + "name.iteration.document": supported, + + "key.mapPair": supported, + "key.mapPair.iteration": supported, + + "value.mapPair": supported, + "value.mapPair.iteration": supported, + "value.variable": supported, + "value.iteration.document": supported, + + "string.singleLine": supported, + "textFragment.string.singleLine": supported, + + "comment.line": supported, + "textFragment.comment.line": supported, + + /* NOT APPLICABLE */ + + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + + // Constructor + "statement.constructor": notApplicable, + "namedFunction.constructor": notApplicable, + "functionCall.constructor": notApplicable, + "functionCallee.constructor": notApplicable, + "argument.actual.constructor.singleLine": notApplicable, + "argument.actual.constructor.multiLine": notApplicable, + "argument.actual.constructor.iteration": notApplicable, + "argument.formal.constructor.singleLine": notApplicable, + "argument.formal.constructor.multiLine": notApplicable, + "argument.formal.constructor.iteration": notApplicable, + "argumentList.actual.constructor.empty": notApplicable, + "argumentList.actual.constructor.singleLine": notApplicable, + "argumentList.actual.constructor.multiLine": notApplicable, + "argumentList.formal.constructor.empty": notApplicable, + "argumentList.formal.constructor.singleLine": notApplicable, + "argumentList.formal.constructor.multiLine": notApplicable, + "interior.constructor": notApplicable, + "name.argument.formal.constructor": notApplicable, + "name.argument.formal.constructor.iteration": notApplicable, + "name.constructor": notApplicable, + "type.argument.formal.constructor": notApplicable, + "type.argument.formal.constructor.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + + // Method + "statement.method": notApplicable, + "namedFunction.method": notApplicable, + "argument.actual.method.singleLine": notApplicable, + "argument.actual.method.multiLine": notApplicable, + "argument.actual.method.iteration": notApplicable, + "argument.formal.method.singleLine": notApplicable, + "argument.formal.method.multiLine": notApplicable, + "argument.formal.method.iteration": notApplicable, + "argumentList.actual.method.multiLine": notApplicable, + "argumentList.actual.method.singleLine": notApplicable, + "argumentList.actual.method.empty": notApplicable, + "argumentList.formal.method.empty": notApplicable, + "argumentList.formal.method.singleLine": notApplicable, + "argumentList.formal.method.multiLine": notApplicable, + "interior.method": notApplicable, + "name.argument.formal.method": notApplicable, + "name.argument.formal.method.iteration": notApplicable, + "name.method": notApplicable, + "type.argument.formal.method": notApplicable, + "type.argument.formal.method.iteration": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + "functionCall.method": notApplicable, + "functionCallee.method": notApplicable, + + // Function + namedFunction: notApplicable, + "namedFunction.iteration.document": notApplicable, + "namedFunction.iteration.class": notApplicable, + "statement.function": notApplicable, + "name.function": notApplicable, + "interior.function": notApplicable, + "argument.actual.iteration": notApplicable, + "argument.actual.singleLine": notApplicable, + "argument.actual.multiLine": notApplicable, + "argumentList.actual.empty": notApplicable, + "argumentList.actual.singleLine": notApplicable, + "argumentList.actual.multiLine": notApplicable, + "argumentList.formal.empty": notApplicable, + "argumentList.formal.singleLine": notApplicable, + "argumentList.formal.multiLine": notApplicable, + "argument.formal.singleLine": notApplicable, + "argument.formal.multiLine": notApplicable, + "argument.formal.iteration": notApplicable, + "name.argument.formal": notApplicable, + "name.argument.formal.iteration": notApplicable, + "type.argument.formal": notApplicable, + "type.argument.formal.iteration": notApplicable, + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + functionCall: notApplicable, + functionCallee: notApplicable, + "functionCall.chain": notApplicable, + "functionCallee.chain": notApplicable, + + // Anonymous function / lambda + anonymousFunction: notApplicable, + "argumentList.formal.lambda.empty": notApplicable, + "argumentList.formal.lambda.singleLine": notApplicable, + "argumentList.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.singleLine": notApplicable, + "argument.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.iteration": notApplicable, + "value.return.lambda": notApplicable, + "interior.lambda": notApplicable, + + // Keyword argument + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + + // Return statement + "statement.return": notApplicable, + "type.return": notApplicable, + "value.return": notApplicable, + + // Yield statement + "statement.yield": notApplicable, + "value.yield": notApplicable, + + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, + + // Enum + "statement.enum": notApplicable, + "name.enum": notApplicable, + "name.field.enum": notApplicable, + "name.iteration.enum": notApplicable, + "value.field.enum": notApplicable, + "value.iteration.enum": notApplicable, + "type.enum": notApplicable, + "interior.enum": notApplicable, + + // Try catch + "statement.try": notApplicable, + "branch.try": notApplicable, + "branch.try.iteration": notApplicable, + "interior.try": notApplicable, + "argument.catch": notApplicable, + "name.argument.catch": notApplicable, + "type.argument.catch": notApplicable, + + // If statement + ifStatement: notApplicable, + "statement.if": notApplicable, + "branch.if": notApplicable, + "branch.if.elif.else": notApplicable, + "branch.if.else": notApplicable, + "branch.if.iteration": notApplicable, + "condition.if": notApplicable, + "interior.if": notApplicable, + + // Switch statement + "statement.switch": notApplicable, + "branch.switchCase": notApplicable, + "branch.switchCase.iteration": notApplicable, + "condition.switchCase": notApplicable, + "condition.switchCase.iteration": notApplicable, + "interior.switch": notApplicable, + "interior.switchCase": notApplicable, + "value.switch": notApplicable, + + // Loop + "branch.loop": notApplicable, + "branch.loop.iteration": notApplicable, + + // For loop + "statement.for": notApplicable, + "condition.for": notApplicable, + "interior.for": notApplicable, + + // For-each loop + "statement.foreach": notApplicable, + "interior.foreach": notApplicable, + "name.foreach": notApplicable, + "type.foreach": notApplicable, + "value.foreach": notApplicable, + + // While loop + "statement.while": notApplicable, + "condition.while": notApplicable, + "interior.while": notApplicable, + + // Do-while loop + "statement.doWhile": notApplicable, + "condition.doWhile": notApplicable, + "interior.doWhile": notApplicable, + + // Resource statement + "statement.resource": notApplicable, + "interior.resource": notApplicable, + "name.resource": notApplicable, + "name.resource.iteration": notApplicable, + "type.resource": notApplicable, + "type.resource.iteration": notApplicable, + "value.resource": notApplicable, + "value.resource.iteration": notApplicable, + + // Pattern destruction + "name.assignment.pattern": notApplicable, + "name.variable.pattern": notApplicable, + "value.variable.pattern": notApplicable, + + // String + "string.multiLine": notApplicable, + "textFragment.string.multiLine": notApplicable, + + // Block comment + "comment.block": notApplicable, + "textFragment.comment.block": notApplicable, + + // Static + "statement.static": notApplicable, + "interior.static": notApplicable, + + // Namespace + "statement.namespace": notApplicable, + "interior.namespace": notApplicable, + "name.namespace": notApplicable, + + // Ternary + "branch.ternary": notApplicable, + "branch.ternary.iteration": notApplicable, + "condition.ternary": notApplicable, + + // Section + section: notApplicable, + "section.iteration.document": notApplicable, + "section.iteration.parent": notApplicable, + + // Element + element: notApplicable, + "interior.element": notApplicable, + "textFragment.element": notApplicable, + tags: notApplicable, + startTag: notApplicable, + endTag: notApplicable, + + // Attribute + attribute: notApplicable, + "key.attribute": notApplicable, + "value.attribute": notApplicable, + + // Notebook cell + notebookCell: notApplicable, + "interior.cell": notApplicable, + + // Type alias + "type.alias": notApplicable, + "value.typeAlias": notApplicable, + + // Collection item + "collectionItem.unenclosed.singleLine": notApplicable, + "collectionItem.unenclosed.multiLine": notApplicable, + "collectionItem.unenclosed.iteration": notApplicable, + + // Command + command: notApplicable, + "statement.command": notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, + "interior.command": notApplicable, + + // Assignment + "statement.assignment": notApplicable, + "name.assignment": notApplicable, + "value.assignment": notApplicable, + + // Block + "name.iteration.block": notApplicable, + "value.iteration.block": notApplicable, + "statement.iteration.block": notApplicable, + + // Miscellaneous statements + "statement.break": notApplicable, + "statement.continue": notApplicable, + + // Miscellaneous + "statement.misc": notApplicable, + "type.cast": notApplicable, + "type.iteration.block": notApplicable, + "type.iteration.document": notApplicable, + "type.typeArgument.iteration": notApplicable, + "type.typeArgument": notApplicable, + "type.variable": notApplicable, + disqualifyDelimiter: notApplicable, + environment: notApplicable, + fieldAccess: notApplicable, + list: notApplicable, + map: notApplicable, + pairDelimiter: notApplicable, + regularExpression: notApplicable, + selector: notApplicable, + unit: notApplicable, +}; diff --git a/packages/cursorless-org-docs/src/docs/components/Code.css b/packages/cursorless-org-docs/src/docs/components/Code.css index 775de931e0..994970fe86 100644 --- a/packages/cursorless-org-docs/src/docs/components/Code.css +++ b/packages/cursorless-org-docs/src/docs/components/Code.css @@ -22,7 +22,6 @@ left: -40px; padding-left: 0.5em; padding-right: 0.5em; - width: 1rem; text-align: right; height: 135%; color: rgba(115, 138, 148, 0.4); diff --git a/packages/cursorless-org-docs/src/docs/components/Code.tsx b/packages/cursorless-org-docs/src/docs/components/Code.tsx index 5c14b9eadb..f70ab465b2 100644 --- a/packages/cursorless-org-docs/src/docs/components/Code.tsx +++ b/packages/cursorless-org-docs/src/docs/components/Code.tsx @@ -94,6 +94,8 @@ function getFallbackLanguage(languageId: string): string { return "tsx"; case "scm": return "scheme"; + case "talon-list": + return "talon"; default: return languageId; } diff --git a/packages/cursorless-org-docs/src/docs/user/languages/talon-list.mdx b/packages/cursorless-org-docs/src/docs/user/languages/talon-list.mdx new file mode 100644 index 0000000000..b7ba662726 --- /dev/null +++ b/packages/cursorless-org-docs/src/docs/user/languages/talon-list.mdx @@ -0,0 +1,5 @@ +import { Language } from "./components/Language"; + +# Talon-list + + diff --git a/packages/test-case-recorder/src/ScopeTestRecorder.ts b/packages/test-case-recorder/src/ScopeTestRecorder.ts index d8068bddfc..bb086370dc 100644 --- a/packages/test-case-recorder/src/ScopeTestRecorder.ts +++ b/packages/test-case-recorder/src/ScopeTestRecorder.ts @@ -53,7 +53,7 @@ export class ScopeTestRecorder { async saveActiveDocument() { const text = this.ide.activeTextEditor?.document.getText() ?? ""; - const matchLanguageId = text.match(/^\[\[(\w+)\]\]\n/); + const matchLanguageId = text.match(/^\[\[([\w-]+)\]\]\n/); if (matchLanguageId == null) { throw Error(`Can't match language id`); diff --git a/queries/talon-list.scm b/queries/talon-list.scm new file mode 100644 index 0000000000..e618fe6728 --- /dev/null +++ b/queries/talon-list.scm @@ -0,0 +1,55 @@ +;;!! app: vscode +;;! ^^^^^^^^^^^ +;;!! foo: "bar" +;;! ^^^^^^^^^^ +[ + (match) + (command_declaration) +] @statement + +;;!! not app: vscode +;;! ^^^ +;;!! foo: "bar" +;;! ^^^ +(_ + left: _ @name +) @_.domain + +;;!! not app: vscode +;;! ^^^^^^^ +;;!! foo: "bar" +;;! ^^^^^^^^^^ +(_ + modifiers: (_)? @collectionKey.start + left: _ @collectionKey.end +) @_.domain + +;;!! not app: vscode +;;! ^^^^^^ +;;!! foo: "bar" +;;! ^^^^^ +( + (_ + right: (_) @value + ) @_.domain +) + +;;!! # foo +;;! ^^^^^ +(comment) @comment @textFragment + +;;!! "foo" +;;! ^^^^^ +(string + (string_content) @textFragment +) @string + +( + (source_file) @statement.iteration + (#document-range! @statement.iteration) +) + +( + (source_file) @name.iteration @collectionKey.iteration @value.iteration + (#document-range! @name.iteration @collectionKey.iteration @value.iteration) +)