From 39dffe67e2f81c74a24e11f2222ed77ece275c1a Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sun, 30 Aug 2026 12:21:14 +0200 Subject: [PATCH 1/4] Made dynamic table of content component mobile compatible --- .../src/docs/components/DynamicTOC.tsx | 73 ++++--------------- .../src/docs/components/DynamicTOCContext.tsx | 42 +++++++++++ .../src/theme/DocItem/Layout/index.tsx | 16 ++++ .../src/theme/DocItem/TOC/Desktop/index.tsx | 24 ++++++ .../src/theme/DocItem/TOC/Mobile/index.tsx | 24 ++++++ .../DocItem/TOC/Mobile/styles.module.css | 12 +++ 6 files changed, 134 insertions(+), 57 deletions(-) create mode 100644 packages/app-web-docs/src/docs/components/DynamicTOCContext.tsx create mode 100644 packages/app-web-docs/src/theme/DocItem/Layout/index.tsx create mode 100644 packages/app-web-docs/src/theme/DocItem/TOC/Desktop/index.tsx create mode 100644 packages/app-web-docs/src/theme/DocItem/TOC/Mobile/index.tsx create mode 100644 packages/app-web-docs/src/theme/DocItem/TOC/Mobile/styles.module.css diff --git a/packages/app-web-docs/src/docs/components/DynamicTOC.tsx b/packages/app-web-docs/src/docs/components/DynamicTOC.tsx index d4ffc185e8a..86e18e9bd2b 100644 --- a/packages/app-web-docs/src/docs/components/DynamicTOC.tsx +++ b/packages/app-web-docs/src/docs/components/DynamicTOC.tsx @@ -1,4 +1,5 @@ import { useEffect } from "react"; +import { useDynamicTOC } from "./DynamicTOCContext"; interface Props { minHeadingLevel?: number; @@ -9,76 +10,34 @@ export function DynamicTOC({ minHeadingLevel = 2, maxHeadingLevel = 3, }: Props) { - useEffect(() => { - const row = document.querySelector("main .row"); + const { setDynamicTOC } = useDynamicTOC(); - if (row == null) { - console.error("No row found in the main element"); - return; - } + useEffect(() => { + const headings = getHeaderElements(minHeadingLevel, maxHeadingLevel); - const toc = getTOC(minHeadingLevel, maxHeadingLevel); + setDynamicTOC({ + items: Array.from(headings, (heading) => ({ + id: heading.id, + level: Number.parseInt(heading.tagName[1], 10), + value: heading.textContent ?? "", + })), + minHeadingLevel, + maxHeadingLevel, + }); - // Remove existing TOC if it exists - if (row.childNodes.length > 1) { - row.childNodes[1].replaceWith(toc); - } else { - row.append(toc); - } - }, [minHeadingLevel, maxHeadingLevel]); + return () => setDynamicTOC(undefined); + }, [maxHeadingLevel, minHeadingLevel, setDynamicTOC]); return null; } -function getTOC(minHeadingLevel: number, maxHeadingLevel: number) { - const col = document.createElement("div"); - col.className = "col col--3"; - - const toc = document.createElement("div"); - toc.className = "tableOfContents_TDAO thin-scrollbar"; - - const ul = document.createElement("ul"); - ul.className = "table-of-contents table-of-contents__left-border"; - - const headerElements = getHeaderElements(minHeadingLevel, maxHeadingLevel); - let currentLevel: number | undefined = undefined; - let indent = 0; - - for (const header of headerElements) { - const level = Number.parseInt(header.tagName[1], 10); - - if (level !== currentLevel) { - if (currentLevel != null) { - indent += level < currentLevel ? -1 : 1; - } - currentLevel = level; - } - - const li = document.createElement("li"); - - const a = document.createElement("a"); - a.href = `#${header.id}`; - a.className = "table-of-contents__link"; - a.textContent = header.textContent; - a.style.paddingLeft = `${indent}rem`; - - li.append(a); - ul.append(li); - } - - toc.append(ul); - col.append(toc); - - return col; -} - function getHeaderElements( minHeadingLevel: number, maxHeadingLevel: number, ): NodeListOf { const queryParts = []; for (let i = minHeadingLevel; i <= maxHeadingLevel; i++) { - queryParts.push(`h${i}`); + queryParts.push(`main article h${i}`); } return document.querySelectorAll(queryParts.join(", ")); } diff --git a/packages/app-web-docs/src/docs/components/DynamicTOCContext.tsx b/packages/app-web-docs/src/docs/components/DynamicTOCContext.tsx new file mode 100644 index 00000000000..5dada2e0e47 --- /dev/null +++ b/packages/app-web-docs/src/docs/components/DynamicTOCContext.tsx @@ -0,0 +1,42 @@ +import { createContext, useContext, useMemo, useState } from "react"; +import type { Dispatch, ReactNode, SetStateAction } from "react"; + +export interface DynamicTOCItem { + id: string; + level: number; + value: string; +} + +export interface DynamicTOCState { + items: DynamicTOCItem[]; + minHeadingLevel: number; + maxHeadingLevel: number; +} + +interface DynamicTOCContextValue { + dynamicTOC: DynamicTOCState | undefined; + setDynamicTOC: Dispatch>; +} + +const DynamicTOCContext = createContext( + undefined, +); + +export function DynamicTOCProvider({ children }: { children: ReactNode }) { + const [dynamicTOC, setDynamicTOC] = useState(); + const value = useMemo(() => ({ dynamicTOC, setDynamicTOC }), [dynamicTOC]); + + return ( + + {children} + + ); +} + +export function useDynamicTOC(): DynamicTOCContextValue { + const value = useContext(DynamicTOCContext); + if (value == null) { + throw new Error("useDynamicTOC must be used within DynamicTOCProvider"); + } + return value; +} diff --git a/packages/app-web-docs/src/theme/DocItem/Layout/index.tsx b/packages/app-web-docs/src/theme/DocItem/Layout/index.tsx new file mode 100644 index 00000000000..45e07736ea4 --- /dev/null +++ b/packages/app-web-docs/src/theme/DocItem/Layout/index.tsx @@ -0,0 +1,16 @@ +import OriginalDocItemLayout from "@theme-original/DocItem/Layout"; +import React from "react"; +import type { ComponentProps } from "react"; +import { DynamicTOCProvider } from "../../../docs/components/DynamicTOCContext"; + +// oxlint-disable-next-line import/no-default-export +export default function DocItemLayout( + props: ComponentProps, +) { + return ( + + {/* oxlint-disable-next-line react/jsx-props-no-spreading */} + + + ); +} diff --git a/packages/app-web-docs/src/theme/DocItem/TOC/Desktop/index.tsx b/packages/app-web-docs/src/theme/DocItem/TOC/Desktop/index.tsx new file mode 100644 index 00000000000..1e910ddb79e --- /dev/null +++ b/packages/app-web-docs/src/theme/DocItem/TOC/Desktop/index.tsx @@ -0,0 +1,24 @@ +import { ThemeClassNames } from "@docusaurus/theme-common"; +import OriginalDocItemTOCDesktop from "@theme-original/DocItem/TOC/Desktop"; +import TOC from "@theme/TOC"; +import React from "react"; +import { useDynamicTOC } from "../../../../docs/components/DynamicTOCContext"; + +// oxlint-disable-next-line import/no-default-export +export default function DocItemTOCDesktop() { + const { dynamicTOC } = useDynamicTOC(); + + if (dynamicTOC == null) { + return ; + } + + return ( + // oxlint-disable-next-line react/jsx-pascal-case + + ); +} diff --git a/packages/app-web-docs/src/theme/DocItem/TOC/Mobile/index.tsx b/packages/app-web-docs/src/theme/DocItem/TOC/Mobile/index.tsx new file mode 100644 index 00000000000..db1624a85de --- /dev/null +++ b/packages/app-web-docs/src/theme/DocItem/TOC/Mobile/index.tsx @@ -0,0 +1,24 @@ +import { ThemeClassNames } from "@docusaurus/theme-common"; +import OriginalDocItemTOCMobile from "@theme-original/DocItem/TOC/Mobile"; +import TOCCollapsible from "@theme/TOCCollapsible"; +import React from "react"; +import { useDynamicTOC } from "../../../../docs/components/DynamicTOCContext"; +import styles from "./styles.module.css"; + +// oxlint-disable-next-line import/no-default-export +export default function DocItemTOCMobile() { + const { dynamicTOC } = useDynamicTOC(); + + if (dynamicTOC == null) { + return ; + } + + return ( + + ); +} diff --git a/packages/app-web-docs/src/theme/DocItem/TOC/Mobile/styles.module.css b/packages/app-web-docs/src/theme/DocItem/TOC/Mobile/styles.module.css new file mode 100644 index 00000000000..293d6f07b56 --- /dev/null +++ b/packages/app-web-docs/src/theme/DocItem/TOC/Mobile/styles.module.css @@ -0,0 +1,12 @@ +@media (width >= 997px) { + /* Prevent hydration FOUC, as the mobile TOC needs to be server-rendered */ + .toc-mobile { + display: none; + } +} + +@media print { + .toc-mobile { + display: none; + } +} From 198d142e0e786a0b6daade7d555a1e91025b2a06 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sun, 30 Aug 2026 14:17:14 +0200 Subject: [PATCH 2/4] remove dynamic table of content --- .oxfmtrc.json | 5 + package.json | 2 +- .../src/docs/components/DynamicTOC.tsx | 43 - .../src/docs/components/DynamicTOCContext.tsx | 42 - .../src/docs/components/Header.css | 3 - .../src/docs/components/Header.tsx | 45 - .../src/docs/components/Language.tsx | 19 - .../src/docs/components/ScopeSupport.css | 4 - .../src/docs/components/ScopeVisualizer.tsx | 409 +--- .../src/docs/components/Scopes.tsx | 20 - .../src/docs/components/ScrollToHashId.tsx | 43 - .../app-web-docs/src/docs/components/util.ts | 40 - .../contributing/adding-a-new-language.md | 12 +- .../private-scopes/customRegex.mdx | 4 +- .../private-scopes/disqualifyDelimiter.mdx | 118 +- .../private-scopes/fieldAccess.mdx | 44 +- .../contributing/private-scopes/interior.mdx | 944 +++++++- .../private-scopes/pairDelimiter.mdx | 42 +- .../contributing/private-scopes/string.mdx | 200 +- .../surroundingPairInterior.mdx | 22 +- .../private-scopes/textFragment.mdx | 398 +++- .../src/docs/user/languages/c.mdx | 960 +++++++- .../src/docs/user/languages/clojure.mdx | 192 +- .../src/docs/user/languages/cpp.mdx | 1524 +++++++++++- .../src/docs/user/languages/csharp.mdx | 1586 ++++++++++++- .../src/docs/user/languages/css.mdx | 234 +- .../src/docs/user/languages/dart.mdx | 1462 +++++++++++- .../src/docs/user/languages/go.mdx | 1106 ++++++++- .../src/docs/user/languages/html.mdx | 118 +- .../src/docs/user/languages/java.mdx | 1424 ++++++++++- .../src/docs/user/languages/javascript.mdx | 1558 ++++++++++++- .../docs/user/languages/javascriptreact.mdx | 1558 ++++++++++++- .../src/docs/user/languages/json.mdx | 102 +- .../src/docs/user/languages/jsonc.mdx | 106 +- .../src/docs/user/languages/jsonl.mdx | 108 +- .../src/docs/user/languages/kotlin.mdx | 1634 ++++++++++++- .../src/docs/user/languages/latex.mdx | 186 +- .../src/docs/user/languages/lua.mdx | 778 +++++- .../src/docs/user/languages/markdown.mdx | 94 +- .../src/docs/user/languages/php.mdx | 1420 ++++++++++- .../src/docs/user/languages/plaintext.mdx | 398 +++- .../src/docs/user/languages/properties.mdx | 104 +- .../src/docs/user/languages/python.mdx | 1344 ++++++++++- .../src/docs/user/languages/r.mdx | 668 +++++- .../src/docs/user/languages/ruby.mdx | 994 +++++++- .../src/docs/user/languages/rust.mdx | 1218 +++++++++- .../src/docs/user/languages/scala.mdx | 1408 ++++++++++- .../src/docs/user/languages/scm.mdx | 122 +- .../src/docs/user/languages/scss.mdx | 374 ++- .../src/docs/user/languages/talon-list.mdx | 122 +- .../src/docs/user/languages/talon.mdx | 356 ++- .../src/docs/user/languages/typescript.mdx | 1892 ++++++++++++++- .../docs/user/languages/typescriptreact.mdx | 1958 +++++++++++++++- .../src/docs/user/languages/xml.mdx | 116 +- .../src/docs/user/languages/yaml.mdx | 130 +- .../docs/user/scopes/anonymousFunction.mdx | 106 +- .../src/docs/user/scopes/argumentList.mdx | 1332 ++++++++++- .../docs/user/scopes/argumentOrParameter.mdx | 1392 ++++++++++- .../src/docs/user/scopes/attribute.mdx | 34 +- .../scopes/boundedNonWhitespaceSequence.mdx | 30 +- .../src/docs/user/scopes/boundedParagraph.mdx | 36 +- .../src/docs/user/scopes/branch.mdx | 610 ++++- .../src/docs/user/scopes/chapter.mdx | 4 - .../src/docs/user/scopes/character.mdx | 18 +- .../src/docs/user/scopes/class.mdx | 178 +- .../src/docs/user/scopes/className.mdx | 4 - .../src/docs/user/scopes/collectionItem.mdx | 244 +- .../src/docs/user/scopes/collectionKey.mdx | 180 +- .../src/docs/user/scopes/command.mdx | 20 +- .../src/docs/user/scopes/comment.mdx | 190 +- .../src/docs/user/scopes/condition.mdx | 392 +++- .../src/docs/user/scopes/document.mdx | 18 +- .../src/docs/user/scopes/environment.mdx | 18 +- .../src/docs/user/scopes/fullLine.mdx | 20 +- .../src/docs/user/scopes/functionCall.mdx | 326 ++- .../src/docs/user/scopes/functionCallee.mdx | 326 ++- .../src/docs/user/scopes/functionName.mdx | 4 - .../src/docs/user/scopes/glyph.mdx | 4 - .../src/docs/user/scopes/identifier.mdx | 18 +- .../src/docs/user/scopes/ifStatement.mdx | 82 +- .../src/docs/user/scopes/instance.mdx | 4 - .../src/docs/user/scopes/line.mdx | 20 +- .../src/docs/user/scopes/list.mdx | 110 +- .../app-web-docs/src/docs/user/scopes/map.mdx | 80 +- .../src/docs/user/scopes/name.mdx | 2032 +++++++++++++++- .../src/docs/user/scopes/namedFunction.mdx | 388 ++- .../src/docs/user/scopes/namedParagraph.mdx | 4 - .../user/scopes/nonWhitespaceSequence.mdx | 18 +- .../src/docs/user/scopes/notebookCell.mdx | 20 +- .../src/docs/user/scopes/paragraph.mdx | 18 +- .../src/docs/user/scopes/part.mdx | 4 - .../docs/user/scopes/regularExpression.mdx | 22 +- .../src/docs/user/scopes/section.mdx | 42 +- .../src/docs/user/scopes/sectionLevelFive.mdx | 4 - .../src/docs/user/scopes/sectionLevelFour.mdx | 4 - .../src/docs/user/scopes/sectionLevelOne.mdx | 4 - .../src/docs/user/scopes/sectionLevelSix.mdx | 4 - .../docs/user/scopes/sectionLevelThree.mdx | 4 - .../src/docs/user/scopes/sectionLevelTwo.mdx | 4 - .../src/docs/user/scopes/selector.mdx | 30 +- .../src/docs/user/scopes/sentence.mdx | 24 +- .../src/docs/user/scopes/statement.mdx | 2076 ++++++++++++++++- .../src/docs/user/scopes/subParagraph.mdx | 4 - .../src/docs/user/scopes/subSection.mdx | 4 - .../src/docs/user/scopes/subSubSection.mdx | 4 - .../src/docs/user/scopes/surroundingPair.mdx | 38 +- .../src/docs/user/scopes/token.mdx | 18 +- .../src/docs/user/scopes/type.mdx | 1366 ++++++++++- .../src/docs/user/scopes/unit.mdx | 26 +- .../app-web-docs/src/docs/user/scopes/url.mdx | 24 +- .../src/docs/user/scopes/value.mdx | 1658 ++++++++++++- .../src/docs/user/scopes/word.mdx | 20 +- .../src/docs/user/scopes/xmlBothTags.mdx | 30 +- .../src/docs/user/scopes/xmlElement.mdx | 30 +- .../src/docs/user/scopes/xmlEndTag.mdx | 30 +- .../src/docs/user/scopes/xmlStartTag.mdx | 30 +- .../src/theme/DocItem/Layout/index.tsx | 16 - .../src/theme/DocItem/TOC/Desktop/index.tsx | 24 - .../src/theme/DocItem/TOC/Mobile/index.tsx | 24 - .../DocItem/TOC/Mobile/styles.module.css | 12 - .../src/references/modifierReferences.ts | 2 +- packages/tool-meta-updater/src/metaUpdater.ts | 64 +- .../src/renderScopeVisualizerMdx.ts | 131 ++ .../src/scopeFixtureGroups.ts | 282 +++ .../src/updateLanguageMdx.ts | 27 +- .../src/updatePrivateScopeMdx.ts | 23 - .../src/updateReferenceMdx.ts | 23 +- 127 files changed, 43253 insertions(+), 972 deletions(-) delete mode 100644 packages/app-web-docs/src/docs/components/DynamicTOC.tsx delete mode 100644 packages/app-web-docs/src/docs/components/DynamicTOCContext.tsx delete mode 100644 packages/app-web-docs/src/docs/components/Header.css delete mode 100644 packages/app-web-docs/src/docs/components/Header.tsx delete mode 100644 packages/app-web-docs/src/docs/components/Language.tsx delete mode 100644 packages/app-web-docs/src/docs/components/ScopeSupport.css delete mode 100644 packages/app-web-docs/src/docs/components/Scopes.tsx delete mode 100644 packages/app-web-docs/src/docs/components/ScrollToHashId.tsx delete mode 100644 packages/app-web-docs/src/theme/DocItem/Layout/index.tsx delete mode 100644 packages/app-web-docs/src/theme/DocItem/TOC/Desktop/index.tsx delete mode 100644 packages/app-web-docs/src/theme/DocItem/TOC/Mobile/index.tsx delete mode 100644 packages/app-web-docs/src/theme/DocItem/TOC/Mobile/styles.module.css create mode 100644 packages/tool-meta-updater/src/renderScopeVisualizerMdx.ts create mode 100644 packages/tool-meta-updater/src/scopeFixtureGroups.ts delete mode 100644 packages/tool-meta-updater/src/updatePrivateScopeMdx.ts diff --git a/.oxfmtrc.json b/.oxfmtrc.json index bbd31e5d1d3..37498386cac 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -8,6 +8,11 @@ }, "ignorePatterns": [ + "/packages/app-web-docs/src/docs/contributing/private-scopes/*.mdx", + "/packages/app-web-docs/src/docs/user/actions/*.mdx", + "/packages/app-web-docs/src/docs/user/languages/*.mdx", + "/packages/app-web-docs/src/docs/user/modifiers/*.mdx", + "/packages/app-web-docs/src/docs/user/scopes/*.mdx", "/packages/app-vscode/src/keyboard/grammar/generated/", "/packages/lib-engine/src/customCommandGrammar/generated/", "/packages/lib-engine/src/snippets/vendor/", diff --git a/package.json b/package.json index 4d844aac528..0b1dc0b0a87 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "lint:style": "stylelint --ignore-path .gitignore '**/*.{css,scss}'", "lint:fmt": "oxfmt --check .", "lint": "pnpm typecheck &&pnpm lint:meta && pnpm lint:syncpack && pnpm lint:ts && pnpm lint:style && pnpm lint:fmt", - "fix:meta": "pnpm meta-updater && pnpm -r exec oxfmt tsconfig.json package.json", + "fix:meta": "pnpm meta-updater", "fix:syncpack": "syncpack fix", "fix:ts": "oxlint -c oxlint.config.mts --fix .", "fix:style": "stylelint --ignore-path .gitignore --fix '**/*.{css,scss}'", diff --git a/packages/app-web-docs/src/docs/components/DynamicTOC.tsx b/packages/app-web-docs/src/docs/components/DynamicTOC.tsx deleted file mode 100644 index 86e18e9bd2b..00000000000 --- a/packages/app-web-docs/src/docs/components/DynamicTOC.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { useEffect } from "react"; -import { useDynamicTOC } from "./DynamicTOCContext"; - -interface Props { - minHeadingLevel?: number; - maxHeadingLevel?: number; -} - -export function DynamicTOC({ - minHeadingLevel = 2, - maxHeadingLevel = 3, -}: Props) { - const { setDynamicTOC } = useDynamicTOC(); - - useEffect(() => { - const headings = getHeaderElements(minHeadingLevel, maxHeadingLevel); - - setDynamicTOC({ - items: Array.from(headings, (heading) => ({ - id: heading.id, - level: Number.parseInt(heading.tagName[1], 10), - value: heading.textContent ?? "", - })), - minHeadingLevel, - maxHeadingLevel, - }); - - return () => setDynamicTOC(undefined); - }, [maxHeadingLevel, minHeadingLevel, setDynamicTOC]); - - return null; -} - -function getHeaderElements( - minHeadingLevel: number, - maxHeadingLevel: number, -): NodeListOf { - const queryParts = []; - for (let i = minHeadingLevel; i <= maxHeadingLevel; i++) { - queryParts.push(`main article h${i}`); - } - return document.querySelectorAll(queryParts.join(", ")); -} diff --git a/packages/app-web-docs/src/docs/components/DynamicTOCContext.tsx b/packages/app-web-docs/src/docs/components/DynamicTOCContext.tsx deleted file mode 100644 index 5dada2e0e47..00000000000 --- a/packages/app-web-docs/src/docs/components/DynamicTOCContext.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { createContext, useContext, useMemo, useState } from "react"; -import type { Dispatch, ReactNode, SetStateAction } from "react"; - -export interface DynamicTOCItem { - id: string; - level: number; - value: string; -} - -export interface DynamicTOCState { - items: DynamicTOCItem[]; - minHeadingLevel: number; - maxHeadingLevel: number; -} - -interface DynamicTOCContextValue { - dynamicTOC: DynamicTOCState | undefined; - setDynamicTOC: Dispatch>; -} - -const DynamicTOCContext = createContext( - undefined, -); - -export function DynamicTOCProvider({ children }: { children: ReactNode }) { - const [dynamicTOC, setDynamicTOC] = useState(); - const value = useMemo(() => ({ dynamicTOC, setDynamicTOC }), [dynamicTOC]); - - return ( - - {children} - - ); -} - -export function useDynamicTOC(): DynamicTOCContextValue { - const value = useContext(DynamicTOCContext); - if (value == null) { - throw new Error("useDynamicTOC must be used within DynamicTOCProvider"); - } - return value; -} diff --git a/packages/app-web-docs/src/docs/components/Header.css b/packages/app-web-docs/src/docs/components/Header.css deleted file mode 100644 index 544981480cc..00000000000 --- a/packages/app-web-docs/src/docs/components/Header.css +++ /dev/null @@ -1,3 +0,0 @@ -.anchor-with-sticky-navbar { - scroll-margin-top: calc(var(--ifm-navbar-height) + 0.5rem); -} diff --git a/packages/app-web-docs/src/docs/components/Header.tsx b/packages/app-web-docs/src/docs/components/Header.tsx deleted file mode 100644 index 48ee80aae6d..00000000000 --- a/packages/app-web-docs/src/docs/components/Header.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import React from "react"; -import { uriEncodeHashId } from "@cursorless/lib-common"; -import "./Header.css"; - -interface Props { - className?: string; - id?: string; - title?: string; - children: string; -} - -export function H2(props: Props) { - return renderHeader(2, props); -} - -export function H3(props: Props) { - return renderHeader(3, props); -} - -export function H4(props: Props) { - return renderHeader(4, props); -} - -export function H5(props: Props) { - return renderHeader(5, props); -} - -function renderHeader( - level: 2 | 3 | 4 | 5, - { className, id, title, children }: Props, -): React.JSX.Element { - // oxlint-disable-next-line typescript/no-unnecessary-type-assertion - const Tag = `h${level}` as "h2" | "h3" | "h4" | "h5"; - const encodedId = uriEncodeHashId(id ?? children); - return ( - - {children} - - - ); -} diff --git a/packages/app-web-docs/src/docs/components/Language.tsx b/packages/app-web-docs/src/docs/components/Language.tsx deleted file mode 100644 index d0abdd2648a..00000000000 --- a/packages/app-web-docs/src/docs/components/Language.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from "react"; -import { DynamicTOC } from "./DynamicTOC"; -import { ScopeVisualizer } from "./ScopeVisualizer"; -import { ScrollToHashId } from "./ScrollToHashId"; - -interface Props { - languageId: string; -} - -export function Language({ languageId }: Props) { - return ( - <> - - - - - - ); -} diff --git a/packages/app-web-docs/src/docs/components/ScopeSupport.css b/packages/app-web-docs/src/docs/components/ScopeSupport.css deleted file mode 100644 index 9a9d0fffcdd..00000000000 --- a/packages/app-web-docs/src/docs/components/ScopeSupport.css +++ /dev/null @@ -1,4 +0,0 @@ -.facet-name { - font-weight: 600; - margin: 0; -} diff --git a/packages/app-web-docs/src/docs/components/ScopeVisualizer.tsx b/packages/app-web-docs/src/docs/components/ScopeVisualizer.tsx index b5a2ec69174..4ebee6090f2 100644 --- a/packages/app-web-docs/src/docs/components/ScopeVisualizer.tsx +++ b/packages/app-web-docs/src/docs/components/ScopeVisualizer.tsx @@ -1,340 +1,135 @@ import { usePluginData } from "@docusaurus/useGlobalData"; -import React, { useState } from "react"; -import type { - ScopeSupportFacetInfo, - ScopeTypeType, -} from "@cursorless/lib-common"; -import { - prettifyLanguageName, - prettifyScopeType, - scopeReferences, - serializeScopeType, -} from "@cursorless/lib-common"; +import React, { createContext, useContext, useMemo, useState } from "react"; +import type { Dispatch, ReactNode, SetStateAction } from "react"; import { generateDecorations } from "./calculateHighlights"; import { Code } from "./Code"; -import { H2, H3, H4, H5 } from "./Header"; -import "./ScopeSupport.css"; -import type { FacetValue, Fixture, RangeType, ScopeTests } from "./types"; -import { getFacetInfo, nameComparator, prettifyFacet } from "./util"; - -interface Scopes { - public: Scope[]; - internal: Scope[]; -} - -interface Scope { - scopeTypeType: ScopeTypeType; - name: string; - facets: Facet[]; +import type { Fixture, RangeType, ScopeTests } from "./types"; +import { getFacetInfo } from "./util"; + +interface ScopeVisualizerContextValue { + fixtures: ReadonlyMap; + rangeType: RangeType; + setRangeType: Dispatch>; + renderWhitespace: boolean; + setRenderWhitespace: Dispatch>; } -interface Facet { - facet: FacetValue; - name: string; - info: ScopeSupportFacetInfo; - fixtures: Fixture[]; -} - -interface Props { - languageId?: string; - scopeTypeType?: ScopeTypeType; -} +const ScopeVisualizerContext = createContext< + ScopeVisualizerContextValue | undefined +>(undefined); -export function ScopeVisualizer({ languageId, scopeTypeType }: Props) { +export function ScopeVisualizerProvider({ children }: { children: ReactNode }) { const scopeTests = usePluginData("scope-tests-plugin") as ScopeTests; - // oxlint-disable-next-line react/hook-use-state - const [scopes] = useState( - getScopeFixtures(scopeTests, languageId, scopeTypeType), - ); const [rangeType, setRangeType] = useState("content"); const [renderWhitespace, setRenderWhitespace] = useState(true); + const fixtures = useMemo( + () => + new Map(scopeTests.fixtures.map((fixture) => [fixture.name, fixture])), + [scopeTests.fixtures], + ); + const value = useMemo( + () => ({ + fixtures, + rangeType, + setRangeType, + renderWhitespace, + setRenderWhitespace, + }), + [fixtures, rangeType, renderWhitespace], + ); - if (scopes.internal.length === 0 && scopes.public.length === 0) { - return null; - } - - const renderOptions = () => { - return ( -
- - - -
- ); - }; - - const renderScopes = (scopes: Scope[]) => { - return scopes.map((scope) => - renderScope( - languageId, - scopeTypeType, - rangeType, - renderWhitespace, - scope, - ), - ); - }; - - // Specific language. Public scopes followed by (optional) internal scopes. - if (languageId != null) { - return ( - <> -

- Below are visualizations of all our scope tests for this language. - These were created primarily for testing purposes rather than as - documentation. There are quite a few, and they may feel a bit - overwhelming from a documentation standpoint. -

- - {renderPublicScopesHeader()} - {renderOptions()} - {renderScopes(scopes.public)} - - {scopes.internal.length > 0 && ( - <> - {renderInternalScopesHeader()} - {renderScopes(scopes.internal)} - - )} - - ); - } - - // Specific public scope - if (scopes.public.length > 0) { - return ( - <> - {renderPublicScopesHeader()} - {renderOptions()} - {renderScopes(scopes.public)} - - ); - } - - // Specific internal scope return ( - <> - {renderInternalScopesHeader()} - {renderOptions()} - {renderScopes(scopes.internal)} - + + {children} + ); } -function renderScope( - languageId: string | undefined, - scopeTypeType: ScopeTypeType | undefined, - rangeType: RangeType, - renderWhitespace: boolean, - scope: Scope, -) { +export function ScopeVisualizerOptions() { + const { rangeType, renderWhitespace, setRangeType, setRenderWhitespace } = + useScopeVisualizer(); + return ( -
- {scopeTypeType == null &&

{scope.name}

} - {scope.facets.map((facet, index) => - renderFacet( - languageId, - scopeTypeType, - rangeType, - renderWhitespace, - facet, - index, - ), - )} +
+ + +
); } -function renderPublicScopesHeader() { - return

Scopes

; -} - -function renderInternalScopesHeader() { - return ( - <> -

Internal scopes

- -

- The following are internal scopes. They are not intended for user - interaction or spoken use. These scopes exist solely for internal - Cursorless functionality. -

- - ); +interface ScopeProps { + fixtureName: string; + languageId?: string; } -function renderFacet( - languageId: string | undefined, - scopeTypeType: ScopeTypeType | undefined, - rangeType: RangeType, - renderWhitespace: boolean, - facet: Facet, - index: number, -) { - let previousLanguageId: string | undefined; +export function ScopeVisualizer({ fixtureName, languageId }: ScopeProps) { + const { fixtures, rangeType, renderWhitespace } = useScopeVisualizer(); + const fixture = fixtures.get(fixtureName); - const renderFacetName = () => { - if (scopeTypeType != null) { - return ( -

- {facet.name} -

- ); - } - return ( -

- {`${index + 1}. ${facet.name}`} -

- ); - }; + if (fixture == null) { + throw new Error(`Unknown scope fixture: ${fixtureName}`); + } - const renderLanguageId = (facetLanguageId: string) => { - if (scopeTypeType != null && previousLanguageId !== facetLanguageId) { - previousLanguageId = facetLanguageId; - return ( -
- {prettifyLanguageName(facetLanguageId)} -
- ); - } - return null; - }; + const facetInfo = getFacetInfo(fixture.languageId, fixture.facet); return ( -
- {renderFacetName()} - {facet.info.description} - {facet.fixtures.map((fixture) => ( - - {renderLanguageId(fixture.languageId)} - - {fixture.code} - - - ))} -
+ + {fixture.code} + ); } -function getScopeFixtures( - scopeTests: ScopeTests, - languageId: string | undefined, - scopeTypeType: ScopeTypeType | undefined, -): Scopes { - const scopeMap: Partial> = {}; - const facetMap: Partial> = {}; - const languageIds = new Set( - languageId != null ? (scopeTests.imports[languageId] ?? [languageId]) : [], - ); - - for (const fixture of scopeTests.fixtures) { - const info = getFacetInfo(fixture.languageId, fixture.facet); - const fixtureScopeTypeType = serializeScopeType(info.scopeType); - - if ( - languageId != null && - (!languageIds.has(fixture.languageId) || - fixtureScopeTypeType.startsWith("private.")) - ) { - continue; - } - - if (scopeTypeType != null && fixtureScopeTypeType !== scopeTypeType) { - continue; - } - - if (scopeMap[fixtureScopeTypeType] == null) { - scopeMap[fixtureScopeTypeType] = { - scopeTypeType: fixtureScopeTypeType, - name: prettifyScopeType(info.scopeType), - facets: [], - }; - } - - if (facetMap[fixture.facet] == null) { - const facet = { - facet: fixture.facet, - name: prettifyFacet(fixture.facet), - info, - fixtures: [], - }; - facetMap[fixture.facet] = facet; - scopeMap[fixtureScopeTypeType].facets.push(facet); - } - - switch (fixture.languageId) { - case "javascript.core": - fixture.languageId = "javascript"; - break; - case "typescript.core": - fixture.languageId = "typescript"; - break; - case "javascript.jsx": - fixture.languageId = "javascriptreact"; - break; - // No default - } - - facetMap[fixture.facet]?.fixtures.push(fixture); - } - - const result: Scopes = { public: [], internal: [] }; - const sortedScopes = Object.values(scopeMap).toSorted(nameComparator); - - for (const scope of sortedScopes) { - scope.facets.sort(facetComparator); - for (const f of scope.facets) { - f.fixtures.sort(nameComparator); - } - const scopeRef = scopeReferences[scope.scopeTypeType]; - if ("private" in scopeRef && scopeRef.private) { - result.internal.push(scope); - } else { - result.public.push(scope); - } +function useScopeVisualizer(): ScopeVisualizerContextValue { + const value = useContext(ScopeVisualizerContext); + if (value == null) { + throw new Error( + "Scope visualizer components must be used within ScopeVisualizerProvider", + ); } - - return result; + return value; } -export function facetComparator(a: Facet, b: Facet): number { - if (a.info.isIteration && !b.info.isIteration) { - return 1; - } - if (!a.info.isIteration && b.info.isIteration) { - return -1; +function normalizeLanguageId(languageId: string): string { + switch (languageId) { + case "javascript.core": + return "javascript"; + case "typescript.core": + return "typescript"; + case "javascript.jsx": + return "javascriptreact"; + default: + return languageId; } - return nameComparator(a, b); } diff --git a/packages/app-web-docs/src/docs/components/Scopes.tsx b/packages/app-web-docs/src/docs/components/Scopes.tsx deleted file mode 100644 index 25449284f21..00000000000 --- a/packages/app-web-docs/src/docs/components/Scopes.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from "react"; -import type { ScopeTypeType } from "@cursorless/lib-common"; -import { DynamicTOC } from "./DynamicTOC"; -import { ScopeVisualizer } from "./ScopeVisualizer"; -import { ScrollToHashId } from "./ScrollToHashId"; - -interface Props { - scopeTypeType: ScopeTypeType; -} - -export function Scopes({ scopeTypeType }: Props) { - return ( - <> - - - - - - ); -} diff --git a/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx b/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx deleted file mode 100644 index ae420b1d80f..00000000000 --- a/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { useLocation } from "@docusaurus/router"; -import { useEffect } from "react"; - -/** - * Scrolls to the element with the ID matching the current hash in the URL. - * This is needed when a hash ID is provided in the initial load to scroll to a heading rendered by a react component. - */ -export function ScrollToHashId() { - const location = useLocation(); - - useEffect(() => { - if (location.hash) { - const id = location.hash.replace("#", ""); - const delay = 100; - - const scrollToId = (attemptsLeft: number) => { - const element = document.getElementById(id); - - if (element != null) { - if (isElementAtTop(element)) { - return; - } - element.scrollIntoView(); - } - - if (attemptsLeft > 1) { - setTimeout(() => scrollToId(attemptsLeft - 1), delay); - } - }; - - setTimeout(() => scrollToId(5), delay); - } - // oxlint-disable-next-line eslint-plugin-react-hooks/exhaustive-deps, react/exhaustive-effect-dependencies - }, []); - - return null; -} - -function isElementAtTop(el: HTMLElement, tolerance = 10) { - const rect = el.getBoundingClientRect(); - // 68px is the offset for the navbar - return Math.abs(rect.top - 68) <= tolerance; -} diff --git a/packages/app-web-docs/src/docs/components/util.ts b/packages/app-web-docs/src/docs/components/util.ts index 4202ad8c5a1..39dfa3737da 100644 --- a/packages/app-web-docs/src/docs/components/util.ts +++ b/packages/app-web-docs/src/docs/components/util.ts @@ -4,43 +4,10 @@ import type { ScopeSupportFacetInfo, } from "@cursorless/lib-common"; import { - camelCaseToAllDown, - capitalize, plaintextScopeSupportFacetInfos, scopeSupportFacetInfos, } from "@cursorless/lib-common"; -export function prettifyFacet( - facet: ScopeSupportFacet | PlaintextScopeSupportFacet, -): string { - const parts = facet.split(".").map(camelCaseToAllDown); - - if (parts.length === 1) { - return capitalize(parts[0]); - } - - const iterationIndex = parts.indexOf("iteration"); - - // Capitalize scope - parts[0] = capitalize(parts[0]); - - // Unless the second part is the iteration scope we want to add `:` to the first part - // and capitalize the second part. - if (iterationIndex === -1 || iterationIndex > 1) { - parts[0] += ":"; - parts[1] = capitalize(parts[1]); - } - - // If we have an iteration, we want to put it in parentheses at the end - if (iterationIndex > 0) { - const iteration = parts.slice(iterationIndex).join(" "); - parts.length = iterationIndex; - parts.push(`(${iteration})`); - } - - return parts.join(" "); -} - export function getFacetInfo( languageId: string, facetId: ScopeSupportFacet | PlaintextScopeSupportFacet, @@ -56,10 +23,3 @@ export function getFacetInfo( return facetInfo; } - -export function nameComparator( - a: { name: string }, - b: { name: string }, -): number { - return a.name.localeCompare(b.name, undefined, { numeric: true }); -} diff --git a/packages/app-web-docs/src/docs/contributing/adding-a-new-language.md b/packages/app-web-docs/src/docs/contributing/adding-a-new-language.md index b5104f666e6..d213dd8b1d5 100644 --- a/packages/app-web-docs/src/docs/contributing/adding-a-new-language.md +++ b/packages/app-web-docs/src/docs/contributing/adding-a-new-language.md @@ -40,12 +40,10 @@ Follow the instructions in [Adding a new scope](./adding-a-new-scope.md) to defi ## 5. Document your language -Create a `.mdx` file in [`languages`](../user/languages) with the `Language` react component. The file should be named after your language, eg `java.mdx` +Run the following command from the repository root: -```md -import { Language } from "@site/src/docs/components/Language"; - -# Java - - +```sh +pnpm fix:meta ``` + +Meta Updater will generate the language's `.mdx` page in [`languages`](../user/languages) from its scope support map and scope test fixtures. The generated file is named after the language ID, for example `java.mdx`, and should not be edited manually. diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/customRegex.mdx b/packages/app-web-docs/src/docs/contributing/private-scopes/customRegex.mdx index 1a983c6d685..30e130af930 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/customRegex.mdx +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/customRegex.mdx @@ -1,5 +1,3 @@ -import { Scopes } from "@site/src/docs/components/Scopes"; - # Custom regex - +Cursorless ID: `customRegex` diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/disqualifyDelimiter.mdx b/packages/app-web-docs/src/docs/contributing/private-scopes/disqualifyDelimiter.mdx index 20be4e2e7ea..149caa58bb2 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/disqualifyDelimiter.mdx +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/disqualifyDelimiter.mdx @@ -1,5 +1,119 @@ -import { Scopes } from "@site/src/docs/components/Scopes"; +--- +sidebar_label: Disqualify delimiter +--- + +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Disqualify delimiter - +Cursorless ID: `disqualifyDelimiter` + +## Spoken form + +Default: `disqualify delimiter` + +## Syntax + +- disqualify delimiter - Disqualify delimiter. + +## Examples + +- `"take disqualify delimiter blue air"` - Selects the disqualify delimiter containing the token containing letter 'a' with a blue hat. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + + + +### Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + +##### C + + + +##### Clojure + + + +##### C++ + + + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Latex + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + +##### TypeScript + + + +##### Yaml + + + + diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/fieldAccess.mdx b/packages/app-web-docs/src/docs/contributing/private-scopes/fieldAccess.mdx index 5dc6e35cb82..cda28e177b1 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/fieldAccess.mdx +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/fieldAccess.mdx @@ -1,5 +1,43 @@ -import { Scopes } from "@site/src/docs/components/Scopes"; +--- +sidebar_label: Access +--- -# Field access +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; - +# Access (Field access) + +Cursorless ID: `private.fieldAccess` + +## Spoken form + +Default: `access` + +## Syntax + +- access - Field access. + +## Examples + +- `"take access blue air"` - Selects the field access containing the token containing letter 'a' with a blue hat. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + + + +### Field access + +A field access + +##### JavaScript + + + +##### Python + + + + diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/interior.mdx b/packages/app-web-docs/src/docs/contributing/private-scopes/interior.mdx index ff27b790dbe..de18891a36c 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/interior.mdx +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/interior.mdx @@ -1,5 +1,945 @@ -import { Scopes } from "@site/src/docs/components/Scopes"; +--- +sidebar_label: Interior +--- + +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Interior - +Cursorless ID: `interior` + +## Spoken form + +Default: `interior` + +## Syntax + +- interior - Interior. + +## Examples + +- `"take interior blue air"` - Selects the interior containing the token containing letter 'a' with a blue hat. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + + + +### Interior: Cell + +The body of a code cell in markdown + +##### Markdown + + + + + +### Interior: Class + +The body of a class + +##### C + + + + + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + + + + + +##### Scala + + + +### Interior: Command + +The body of a command, eg Talon spoken command + +##### Talon + + + +### Interior: Constructor + +The body of a constructor declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +### Interior: Do while + +The body of a do-while loop + +##### C + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Scala + + + +### Interior: Element + +The interior/children of a XML element + +##### HTML + + + +##### JavaScript React + + + +##### Latex + + + +##### XML + + + +### Interior: Enum + +The body of an enum + +##### C + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Interior: For + +The body of a for loop + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +### Interior: Foreach + +The body of a for-each loop + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon + + + +### Interior: Function + +The body of a function declaration + +##### C + + + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + + + + + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + +### Interior: If + +The body of an if/elif/else branch + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + + + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + +##### Talon + + + +### Interior: Interface + +The body of a interface + +##### C# + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Scala + + + +##### TypeScript + + + +### Interior: Lambda + +The block body of a lambda/anonymous function + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Interior: Method + +The body of a method declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Interior: Namespace + +the body of a namespace statement + +##### C++ + + + +##### C# + + + +##### PHP + + + +##### Rust + + + +##### Scala + + + +### Interior: Resource + +the body of a 'with' / 'use' / 'using' statement + +##### C# + + + +##### Java + + + +##### Python + + + +### Interior: Static + +the body of a static statement + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +### Interior: Switch + +The body of a switch statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + + + +##### Rust + + + +##### Scala + + + +### Interior: Switch case + +The body of a switch case branch + +##### C + + + + + +##### C# + + + + + +##### Dart + + + + + +##### Go + + + + + +##### Java + + + + + +##### JavaScript + + + + + +##### Kotlin + + + + + +##### PHP + + + + + +##### Python + + + +##### R + + + + + +##### Ruby + + + + + +##### Rust + + + + + +##### Scala + + + + + +### Interior: Try + +The body of a try/catch/finally branch + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + + + +##### R + + + +##### Ruby + + + +##### Scala + + + +### Interior: While + +The body of a while loop + +##### C + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + + diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/pairDelimiter.mdx b/packages/app-web-docs/src/docs/contributing/private-scopes/pairDelimiter.mdx index 6646a4f8771..89add021a19 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/pairDelimiter.mdx +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/pairDelimiter.mdx @@ -1,5 +1,43 @@ -import { Scopes } from "@site/src/docs/components/Scopes"; +--- +sidebar_label: Pair delimiter +--- + +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Pair delimiter - +Cursorless ID: `pairDelimiter` + +## Spoken form + +Default: `pair delimiter` + +## Syntax + +- pair delimiter - Pair delimiter. + +## Examples + +- `"take pair delimiter blue air"` - Selects the pair delimiter containing the token containing letter 'a' with a blue hat. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + + + +### Pair delimiter + +Internally used to add additional language specific surrounding pair delimiters in addition to the text based definitions. eg `r"`. + +##### JavaScript + + + +##### Python + + + + diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/string.mdx b/packages/app-web-docs/src/docs/contributing/private-scopes/string.mdx index a8488ef6a53..3f49351ca86 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/string.mdx +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/string.mdx @@ -1,5 +1,199 @@ -import { Scopes } from "@site/src/docs/components/Scopes"; +--- +sidebar_label: Parse tree string +--- -# String +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; - +# Parse tree string (String) + +Cursorless ID: `string` + +## Spoken form + +Default: `parse tree string` + +## Syntax + +- parse tree string - String. + +## Examples + +- `"take parse tree string blue air"` - Selects the string containing the token containing letter 'a' with a blue hat. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + + + +### String: Multi line + +A multi-line string + +##### Clojure + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Yaml + + + +### String: Single line + +A single-line string + +##### C + + + +##### Clojure + + + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### HTML + + + +##### Java + + + +##### JavaScript + + + +##### JSON + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + + + + + +##### Scala + + + +##### Tree sitter query (SCM) + + + +##### Talon-list + + + +##### Talon + + + + + +##### XML + + + +##### Yaml + + + + + + diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/surroundingPairInterior.mdx b/packages/app-web-docs/src/docs/contributing/private-scopes/surroundingPairInterior.mdx index bf93046cb8c..3630656d37d 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/surroundingPairInterior.mdx +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/surroundingPairInterior.mdx @@ -1,5 +1,23 @@ -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Surrounding pair interior - +Cursorless ID: `surroundingPairInterior` + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + + + +### Interior: Surrounding pair + +The interior scope of a surrounding pair + +##### Plaintext + + + + diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/textFragment.mdx b/packages/app-web-docs/src/docs/contributing/private-scopes/textFragment.mdx index 474c4446838..248a9fe4809 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/textFragment.mdx +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/textFragment.mdx @@ -1,5 +1,399 @@ -import { Scopes } from "@site/src/docs/components/Scopes"; +--- +sidebar_label: Text fragment +--- + +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Text fragment - +Cursorless ID: `textFragment` + +## Spoken form + +Default: `text fragment` + +## Syntax + +- text fragment - Text fragment. + +## Examples + +- `"take text fragment blue air"` - Selects the text fragment containing the token containing letter 'a' with a blue hat. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + + + +### Text fragment: Comment block + +Internally used text fragment consisting of a block comment + +##### C + + + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### HTML + + + +##### Java + + + + + +##### JavaScript + + + + + +##### JSON + + + +##### Kotlin + + + + + +##### Latex + + + +##### Lua + + + +##### Markdown + + + +##### PHP + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### XML + + + +### Text fragment: Comment line + +Internally used text fragment consisting of a line comment + +##### C + + + +##### Clojure + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### JSON + + + +##### Kotlin + + + +##### Latex + + + +##### Lua + + + +##### PHP + + + +##### Properties + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Tree sitter query (SCM) + + + +##### SCSS + + + +##### Talon-list + + + +##### Talon + + + +##### Yaml + + + +### Text fragment: Element + +Internally used text fragment consisting of a xml element interior + +##### HTML + + + +##### JavaScript React + + + + + +##### Latex + + + +##### XML + + + +### Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + +##### Clojure + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Yaml + + + +### Text fragment: String single line + +Internally used text fragment consisting of a single-line string + +##### C + + + +##### Clojure + + + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### HTML + + + +##### Java + + + +##### JavaScript + + + +##### JSON + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + + + + + +##### Scala + + + +##### Tree sitter query (SCM) + + + +##### Talon-list + + + +##### Talon + + + + + +##### XML + + + +##### Yaml + + + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/c.mdx b/packages/app-web-docs/src/docs/user/languages/c.mdx index 3954b55ccd9..fdf48bad6b3 100644 --- a/packages/app-web-docs/src/docs/user/languages/c.mdx +++ b/packages/app-web-docs/src/docs/user/languages/c.mdx @@ -1,5 +1,961 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # C - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Argument list + +#### 1. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 3. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 5. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 7. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + +#### 8. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 9. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual method single line + +A single line argument in a method call + + + +#### 3. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual single line + +A single line argument in a function call + + + +#### 5. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 6. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 7. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 8. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 9. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: Ternary + +A branch in a ternary expression + + + +#### 6. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 7. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 8. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + + + + + + + + + + + +#### 2. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + + + +#### 3. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: Do while + +A condition in a do while loop + + + +#### 2. Condition: For + +A condition in a for loop + + + +#### 3. Condition: If + +A condition in an if statement + + + +#### 4. Condition: Switch case + +A condition in a switch statement + + + +#### 5. Condition: Ternary + +A condition in a ternary expression + + + +#### 6. Condition: While + +A condition in a while loop + + + +#### 7. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + +### Name + +#### 1. Name: Argument formal + +Name of a parameter in a function declaration + + + + + +#### 2. Name: Assignment + +Name (LHS) of an assignment + + + + + +#### 3. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 4. Name: Class + +Name of a class + + + + + + + + + + + + + +#### 5. Name: Constant + +Name (LHS) of a constant declaration + + + +#### 6. Name: Enum + +Name of an enum + + + + + +#### 7. Name: Field class + +Name (LHS) of a field in a class + + + + + +#### 8. Name: Field enum + +Name (LHS) of a field in an enum + + + +#### 9. Name: Function + +Name of a function + + + + + + + + + +#### 10. Name: Type alias + +Name of a type alias + + + +#### 11. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 12. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + +#### 13. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 14. Name (iteration class) + +Iteration scope for names: class bodies. + + + + + + + + + +#### 15. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 16. Name (iteration enum) + +Iteration scope for names: enum bodies. + + + +#### 17. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + + + +### Named function + +#### 1. Named function + +A named function declaration + + + + + + + + + +#### 2. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Break + +A break statement + + + +#### 4. Statement: Class + +A class/struct declaration + + + + + + + + + +#### 5. Statement: Constant + +A constant declaration + + + +#### 6. Statement: Continue + +A continue statement + + + +#### 7. Statement: Do while + +A do-while loop statement + + + +#### 8. Statement: Enum + +An enum declaration + + + +#### 9. Statement: Field class + +A field declaration in a class/struct + + + + + +#### 10. Statement: For + +A for loop statement + + + +#### 11. Statement: Function + +A named function declaration + + + + + + + + + +#### 12. Statement: Function call + +A function call statement + + + +#### 13. Statement: If + +A if/elif/else statement + + + +#### 14. Statement: Import + +An import statement + + + +#### 15. Statement: Return + +A return statement + + + +#### 16. Statement: Switch + +A switch statement + + + +#### 17. Statement: Type alias + +A type alias declaration + + + +#### 18. Statement: Update + +An update statement, eg ++/-- + + + +#### 19. Statement: Variable initialized + +An initialized variable declaration + + + +#### 20. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 21. Statement: While + +A while loop statement + + + +#### 22. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 23. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + + + + + + + +#### 24. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Type + +#### 1. Type: Alias + +A type alias declaration + + + +#### 2. Type: Argument formal + +Type of a formal parameter in a function declaration + + + +#### 3. Type: Cast + +A type cast + + + +#### 4. Type: Class + +A class declaration + + + + + + + + + +#### 5. Type: Constant + +Type of a constant declaration + + + +#### 6. Type: Enum + +An enum declaration + + + + + +#### 7. Type: Field class + +Type of a field in a class + + + + + +#### 8. Type: Return + +Type of a return value in a function declaration + + + +#### 9. Type: Variable initialized + +Type of an initialized variable declaration + + + +#### 10. Type: Variable uninitialized + +Type of an uninitialized variable declaration + + + +#### 11. Type (iteration block) + +Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 12. Type (iteration class) + +Iteration scope for types: class bodies. + + + + + + + + + +#### 13. Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + + + +#### 14. Type: Argument formal (iteration) + +Iteration scope for types of formal parameters in a function declaration: the parameters list. + + + +### Value + +#### 1. Value: Assignment + +Value (RHS) of an assignment + + + + + +#### 2. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 3. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 4. Value: Field enum + +Value (RHS) of a field in an enum + + + +#### 5. Value: Return + +Return value of a function + + + +#### 6. Value: Switch + +The value / subject of a switch statement + + + +#### 7. Value: Type alias + +Value of a type alias declaration + + + +#### 8. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 9. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 10. Value (iteration class) + +Iteration scope for values: class bodies. + + + + + +#### 11. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 12. Value (iteration enum) + +Iteration scope for values: enum bodies. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + + + + + + + +#### 2. Interior: Do while + +The body of a do-while loop + + + +#### 3. Interior: Enum + +The body of an enum + + + + + +#### 4. Interior: For + +The body of a for loop + + + +#### 5. Interior: Function + +The body of a function declaration + + + + + +#### 6. Interior: If + +The body of an if/elif/else branch + + + +#### 7. Interior: Switch + +The body of a switch statement + + + +#### 8. Interior: Switch case + +The body of a switch case branch + + + + + +#### 9. Interior: While + +The body of a while loop + + + +### String + +#### 1. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/clojure.mdx b/packages/app-web-docs/src/docs/user/languages/clojure.mdx index 6b51ad24fd3..b333df856fd 100644 --- a/packages/app-web-docs/src/docs/user/languages/clojure.mdx +++ b/packages/app-web-docs/src/docs/user/languages/clojure.mdx @@ -1,5 +1,193 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Clojure - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + +### Argument list + +#### 1. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual single line + +A single line list of arguments in a function call + + + +### Argument or parameter + +#### 1. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual single line + +A single line argument in a function call + + + +#### 3. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +### Comment + +#### 1. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: If + +A condition in an if statement + + + +### Function call + +#### 1. Function call + +A function call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + + + + + +### Map + +#### 1. Map + +A map/dictionary + + + + + +### Name + +#### 1. Name: Function + +Name of a function + + + +### Named function + +#### 1. Named function + +A named function declaration + + + +#### 2. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 2. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 3. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/cpp.mdx b/packages/app-web-docs/src/docs/user/languages/cpp.mdx index 5a3a028b391..e90dce4a39e 100644 --- a/packages/app-web-docs/src/docs/user/languages/cpp.mdx +++ b/packages/app-web-docs/src/docs/user/languages/cpp.mdx @@ -1,5 +1,1525 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # C++ - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + +### Argument list + +#### 1. Argument list: Actual constructor empty + +An empty list of arguments in a constructor call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual constructor multi line + +A multi line list of arguments in a constructor call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual constructor single line + +A single line list of arguments in a constructor call + + + +#### 4. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 5. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 6. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 7. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 8. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 9. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 10. Argument list: Formal constructor empty + +An empty list of parameters in a constructor declaration. Insertion delimiter should be empty. + + + +#### 11. Argument list: Formal constructor multi line + +A multi line list of parameters in a constructor declaration. Insertion delimiter should include new line. + + + +#### 12. Argument list: Formal constructor single line + +A single line list of parameters in a constructor declaration + + + +#### 13. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + +#### 14. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + +#### 15. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + +#### 16. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + +#### 17. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + +#### 18. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 19. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 20. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 21. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual constructor multi line + +A multi line argument in a constructor call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual constructor single line + +A single line argument in a constructor call + + + +#### 3. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual method single line + +A single line argument in a method call + + + +#### 5. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument: Actual single line + +A single line argument in a function call + + + +#### 7. Argument: Formal catch + +A parameter in a catch clause + + + +#### 8. Argument: Formal constructor multi line + +A multi line parameter in a constructor declaration. Insertion delimiter should include new line. + + + +#### 9. Argument: Formal constructor single line + +A single line parameter in a constructor declaration + + + +#### 10. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 11. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + +#### 12. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 13. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 14. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 15. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 16. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 17. Argument: Actual constructor (iteration) + +Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. + + + +#### 18. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 19. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + +#### 20. Argument: Formal constructor (iteration) + +Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. + + + +#### 21. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + +#### 22. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + +### Attribute + +#### 1. Attribute + +A attribute, eg of a html element or a C++ attribute + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: Ternary + +A branch in a ternary expression + + + +#### 6. Branch: Try + +A try/catch/finally branch + + + +#### 7. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 8. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 9. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +#### 10. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + + + + + + + + + + + + + +#### 2. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + + + +#### 3. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: Do while + +A condition in a do while loop + + + +#### 2. Condition: For + +A condition in a for loop + + + +#### 3. Condition: If + +A condition in an if statement + + + +#### 4. Condition: Switch case + +A condition in a switch statement + + + +#### 5. Condition: Ternary + +A condition in a ternary expression + + + +#### 6. Condition: While + +A condition in a while loop + + + +#### 7. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Constructor + +A constructor call + + + +#### 4. Function call: Generic + +A function call with generic type arguments + + + +#### 5. Function call: Method + +A method call + + + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Constructor + +The class being constructed in a class instantiation, including the `new` keyword. + + + +#### 4. Function callee: Generic + +The function being called in a function call with generic type arguments + + + +#### 5. Function callee: Method + +The function being called in a method call, including parent objects. + + + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + +### Name + +#### 1. Name: Argument catch + +Name of a parameter in a catch clause + + + +#### 2. Name: Argument formal + +Name of a parameter in a function declaration + + + + + + + +#### 3. Name: Argument formal constructor + +The name of a parameter in a constructor declaration + + + +#### 4. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 5. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 6. Name: Assignment + +Name (LHS) of an assignment + + + + + +#### 7. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 8. Name: Class + +Name of a class + + + + + + + + + + + + + + + + + +#### 9. Name: Constant + +Name (LHS) of a constant declaration + + + +#### 10. Name: Constructor + +Name of a constructor + + + + + +#### 11. Name: Enum + +Name of an enum + + + + + + + +#### 12. Name: Field class + +Name (LHS) of a field in a class + + + + + + + +#### 13. Name: Field enum + +Name (LHS) of a field in an enum + + + + + +#### 14. Name: Foreach + +Iteration variable name in a for each loop + + + +#### 15. Name: Function + +Name of a function + + + + + + + + + +#### 16. Name: Method + +Name of a class method + + + +#### 17. Name: Namespace + +Name of a namespace + + + +#### 18. Name: Type alias + +Name of a type alias + + + + + +#### 19. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 20. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + +#### 21. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 22. Name (iteration class) + +Iteration scope for names: class bodies. + + + + + + + + + + + +#### 23. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 24. Name (iteration enum) + +Iteration scope for names: enum bodies. + + + + + +#### 25. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + + + + + +#### 26. Name: Argument formal constructor (iteration) + +Iteration scope for names of formal parameters in a constructor declaration: the parameters list. + + + +#### 27. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 28. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + + + + + + + +#### 2. Named function: Constructor + +A constructor declaration in a class + + + + + +#### 3. Named function: Method + +A named method declaration in a class + + + +#### 4. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 5. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Break + +A break statement + + + +#### 4. Statement: Class + +A class/struct declaration + + + + + + + + + + + +#### 5. Statement: Constant + +A constant declaration + + + +#### 6. Statement: Constructor + +A constructor declaration + + + + + +#### 7. Statement: Continue + +A continue statement + + + +#### 8. Statement: Do while + +A do-while loop statement + + + +#### 9. Statement: Enum + +An enum declaration + + + + + +#### 10. Statement: Field class + +A field declaration in a class/struct + + + + + +#### 11. Statement: For + +A for loop statement + + + +#### 12. Statement: Foreach + +A for-each loop statement + + + +#### 13. Statement: Function + +A named function declaration + + + + + + + + + +#### 14. Statement: Function call + +A function call statement + + + +#### 15. Statement: If + +A if/elif/else statement + + + +#### 16. Statement: Import + +An import statement + + + +#### 17. Statement: Method + +A method declaration + + + +#### 18. Statement: Namespace + +A namespace declaration + + + +#### 19. Statement: Return + +A return statement + + + +#### 20. Statement: Switch + +A switch statement + + + +#### 21. Statement: Throw + +A throw statement + + + +#### 22. Statement: Try + +A try/catch/finally statement + + + +#### 23. Statement: Type alias + +A type alias declaration + + + + + +#### 24. Statement: Update + +An update statement, eg ++/-- + + + +#### 25. Statement: Variable initialized + +An initialized variable declaration + + + +#### 26. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 27. Statement: While + +A while loop statement + + + +#### 28. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 29. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + + + + + + + + + +#### 30. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Type + +#### 1. Type: Alias + +A type alias declaration + + + + + +#### 2. Type: Argument catch + +Type of a parameter in a catch clause + + + +#### 3. Type: Argument formal + +Type of a formal parameter in a function declaration + + + +#### 4. Type: Argument formal constructor + +Type of a formal parameter in a constructor declaration + + + +#### 5. Type: Argument formal lambda + +Type of a formal parameter in a lambda declaration + + + +#### 6. Type: Argument formal method + +Type of a formal parameter in a class method declaration + + + +#### 7. Type: Cast + +A type cast + + + +#### 8. Type: Class + +A class declaration + + + + + + + + + + + +#### 9. Type: Constant + +Type of a constant declaration + + + +#### 10. Type: Enum + +An enum declaration + + + + + + + +#### 11. Type: Field class + +Type of a field in a class + + + + + + + +#### 12. Type: Foreach + +Type of a variable in a for each loop + + + +#### 13. Type: Return + +Type of a return value in a function declaration + + + +#### 14. Type: Return lambda + +Type of a return value in a lambda declaration + + + +#### 15. Type: Return method + +Type of a return value in a method declaration + + + +#### 16. Type: Type argument + +Type argument to a generic / parametrized type + + + +#### 17. Type: Variable initialized + +Type of an initialized variable declaration + + + +#### 18. Type: Variable uninitialized + +Type of an uninitialized variable declaration + + + +#### 19. Type (iteration block) + +Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 20. Type (iteration class) + +Iteration scope for types: class bodies. + + + + + + + + + + + +#### 21. Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + + + +#### 22. Type: Argument formal (iteration) + +Iteration scope for types of formal parameters in a function declaration: the parameters list. + + + +#### 23. Type: Argument formal constructor (iteration) + +Iteration scope for types of formal parameters in a constructor declaration: the parameters list. + + + +#### 24. Type: Argument formal lambda (iteration) + +Iteration scope for types of formal parameters in a lambda declaration: the parameters list. + + + +#### 25. Type: Argument formal method (iteration) + +Iteration scope for types of formal parameters in a method declaration: the parameters list. + + + +#### 26. Type: Type argument (iteration) + +Iteration scope for type arguments to a generic / parametrized type: the type argument list. + + + +### Value + +#### 1. Value: Argument formal + +The (default) value of a argument in a function declaration + + + +#### 2. Value: Argument formal constructor + +The (default) value of a parameter in a constructor declaration + + + +#### 3. Value: Argument formal lambda + +The (default) value of a parameter in a lambda declaration + + + +#### 4. Value: Argument formal method + +The (default) value of a parameter in a method declaration + + + +#### 5. Value: Assignment + +Value (RHS) of an assignment + + + + + +#### 6. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + + + +#### 7. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 8. Value: Field class + +Value (RHS) of a field in a class + + + +#### 9. Value: Field enum + +Value (RHS) of a field in an enum + + + + + +#### 10. Value: Foreach + +Iterable in a for each loop + + + +#### 11. Value: Return + +Return value of a function + + + +#### 12. Value: Switch + +The value / subject of a switch statement + + + +#### 13. Value: Throw + +Value of a throw statement + + + +#### 14. Value: Type alias + +Value of a type alias declaration + + + + + +#### 15. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 16. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 17. Value (iteration class) + +Iteration scope for values: class bodies. + + + + + + + +#### 18. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 19. Value (iteration enum) + +Iteration scope for values: enum bodies. + + + + + +#### 20. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 21. Value: Argument formal constructor (iteration) + +Iteration scope for values of formal parameters in a constructor declaration: the parameters list. + + + +#### 22. Value: Argument formal lambda (iteration) + +Iteration scope for values of formal parameters in a lambda declaration: the parameters list. + + + +#### 23. Value: Argument formal method (iteration) + +Iteration scope for values of formal parameters in a method declaration: the parameters list. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + + + + + + + + + +#### 2. Interior: Constructor + +The body of a constructor declaration + + + +#### 3. Interior: Do while + +The body of a do-while loop + + + +#### 4. Interior: Enum + +The body of an enum + + + + + + + +#### 5. Interior: For + +The body of a for loop + + + +#### 6. Interior: Foreach + +The body of a for-each loop + + + +#### 7. Interior: Function + +The body of a function declaration + + + + + +#### 8. Interior: If + +The body of an if/elif/else branch + + + +#### 9. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 10. Interior: Method + +The body of a method declaration + + + +#### 11. Interior: Namespace + +the body of a namespace statement + + + +#### 12. Interior: Switch + +The body of a switch statement + + + +#### 13. Interior: Switch case + +The body of a switch case branch + + + + + +#### 14. Interior: Try + +The body of a try/catch/finally branch + + + +#### 15. Interior: While + +The body of a while loop + + + +### String + +#### 1. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/csharp.mdx b/packages/app-web-docs/src/docs/user/languages/csharp.mdx index 341cb03e17b..e4317316940 100644 --- a/packages/app-web-docs/src/docs/user/languages/csharp.mdx +++ b/packages/app-web-docs/src/docs/user/languages/csharp.mdx @@ -1,9 +1,1583 @@ ---- -sidebar_label: C# ---- +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; -import { Language } from "@site/src/docs/components/Language"; +# C# + + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + +### Argument list + +#### 1. Argument list: Actual constructor empty + +An empty list of arguments in a constructor call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual constructor multi line + +A multi line list of arguments in a constructor call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual constructor single line + +A single line list of arguments in a constructor call + + + +#### 4. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 5. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 6. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 7. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 8. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 9. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 10. Argument list: Formal constructor empty + +An empty list of parameters in a constructor declaration. Insertion delimiter should be empty. + + + +#### 11. Argument list: Formal constructor multi line + +A multi line list of parameters in a constructor declaration. Insertion delimiter should include new line. + + + +#### 12. Argument list: Formal constructor single line + +A single line list of parameters in a constructor declaration + + + +#### 13. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + +#### 14. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + +#### 15. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + +#### 16. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + +#### 17. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + +#### 18. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 19. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 20. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 21. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual constructor multi line + +A multi line argument in a constructor call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual constructor single line + +A single line argument in a constructor call + + + +#### 3. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual method single line + +A single line argument in a method call + + + +#### 5. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument: Actual single line + +A single line argument in a function call + + + +#### 7. Argument: Formal catch + +A parameter in a catch clause + + + +#### 8. Argument: Formal constructor multi line + +A multi line parameter in a constructor declaration. Insertion delimiter should include new line. + + + +#### 9. Argument: Formal constructor single line + +A single line parameter in a constructor declaration + + + +#### 10. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 11. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + +#### 12. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 13. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 14. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 15. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 16. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 17. Argument: Actual constructor (iteration) + +Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. + + + +#### 18. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 19. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + +#### 20. Argument: Formal constructor (iteration) + +Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. + + + +#### 21. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + +#### 22. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + +### Attribute + +#### 1. Attribute + +A attribute, eg of a html element or a C++ attribute + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: Ternary + +A branch in a ternary expression + + + +#### 6. Branch: Try + +A try/catch/finally branch + + + +#### 7. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 8. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 9. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +#### 10. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + +#### 2. Class (iteration class) + +Iteration scope for classes: class bodies. + + + +#### 3. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + + + +#### 2. Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + + + + + +#### 3. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: Do while + +A condition in a do while loop + + + +#### 2. Condition: For + +A condition in a for loop + + + +#### 3. Condition: If + +A condition in an if statement + + + +#### 4. Condition: Switch case + +A condition in a switch statement + + + +#### 5. Condition: Ternary + +A condition in a ternary expression + + + +#### 6. Condition: While + +A condition in a while loop + + + +#### 7. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Constructor + +A constructor call + + + +#### 4. Function call: Generic + +A function call with generic type arguments + + + +#### 5. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Constructor + +The class being constructed in a class instantiation, including the `new` keyword. + + + +#### 4. Function callee: Generic + +The function being called in a function call with generic type arguments + + + +#### 5. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + +### Map + +#### 1. Map + +A map/dictionary + + + +### Name + +#### 1. Name: Argument actual + +Name of a (keyword) argument in a function call + + + +#### 2. Name: Argument catch + +Name of a parameter in a catch clause + + + +#### 3. Name: Argument formal + +Name of a parameter in a function declaration + + + +#### 4. Name: Argument formal constructor + +The name of a parameter in a constructor declaration + + + +#### 5. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 6. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 7. Name: Assignment + +Name (LHS) of an assignment + + + + + +#### 8. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 9. Name: Class + +Name of a class + + + +#### 10. Name: Constant + +Name (LHS) of a constant declaration + + + +#### 11. Name: Constructor + +Name of a constructor + + + +#### 12. Name: Enum + +Name of an enum + + + +#### 13. Name: Field class + +Name (LHS) of a field in a class + + + +#### 14. Name: Field enum + +Name (LHS) of a field in an enum + + + +#### 15. Name: Field interface + +Name (LHS) of a field in an interface + + + +#### 16. Name: Foreach + +Iteration variable name in a for each loop + + + +#### 17. Name: Function + +Name of a function + + + +#### 18. Name: Interface + +Name of a interface + + + +#### 19. Name: Method + +Name of a class method + + + +#### 20. Name: Method interface + +Name of a interface method + + + +#### 21. Name: Namespace + +Name of a namespace + + + +#### 22. Name: Resource + +Name in a 'with' / 'use' / 'using' statement + + + +#### 23. Name: Type alias + +Name of a type alias + + + +#### 24. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + + + +#### 25. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + +#### 26. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 27. Name (iteration class) + +Iteration scope for names: class bodies. + + + +#### 28. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 29. Name (iteration enum) + +Iteration scope for names: enum bodies. + + + +#### 30. Name (iteration interface) + +Iteration scope for names: interface bodies. + + + +#### 31. Name: Argument actual (iteration) + +Iteration scope for names of (keyword) arguments in a function call: the argument list. + + + +#### 32. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 33. Name: Argument formal constructor (iteration) + +Iteration scope for names of formal parameters in a constructor declaration: the parameters list. + + + +#### 34. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 35. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + +#### 2. Named function: Constructor + +A constructor declaration in a class + + + +#### 3. Named function: Method + +A named method declaration in a class + + + +#### 4. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 5. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Break + +A break statement + + + +#### 4. Statement: Class + +A class/struct declaration + + + +#### 5. Statement: Constant + +A constant declaration + + + +#### 6. Statement: Constructor + +A constructor declaration + + + +#### 7. Statement: Continue + +A continue statement + + + +#### 8. Statement: Do while + +A do-while loop statement + + + +#### 9. Statement: Enum + +An enum declaration + + + +#### 10. Statement: Field class + +A field declaration in a class/struct + + + +#### 11. Statement: Field interface + +A field declaration in a interface + + + +#### 12. Statement: For + +A for loop statement + + + +#### 13. Statement: Foreach + +A for-each loop statement + + + +#### 14. Statement: Function + +A named function declaration + + + +#### 15. Statement: Function call + +A function call statement + + + +#### 16. Statement: If + +A if/elif/else statement + + + +#### 17. Statement: Import + +An import statement + + + +#### 18. Statement: Interface + +An interface declaration + + + +#### 19. Statement: Method + +A method declaration + + + +#### 20. Statement: Method interface + +A method declaration in a interface + + + +#### 21. Statement: Namespace + +A namespace declaration + + + +#### 22. Statement: Resource + +A 'with' / 'use' / 'using' statement + + + +#### 23. Statement: Return + +A return statement + + + +#### 24. Statement: Switch + +A switch statement + + + +#### 25. Statement: Throw + +A throw statement + + + +#### 26. Statement: Try + +A try/catch/finally statement + + + +#### 27. Statement: Type alias + +A type alias declaration + + + +#### 28. Statement: Update + +An update statement, eg ++/-- + + + + + +#### 29. Statement: Variable initialized + +An initialized variable declaration + + + + + +#### 30. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 31. Statement: While + +A while loop statement + + + +#### 32. Statement: Yield + +A yield statement + + + +#### 33. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 34. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + +#### 35. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +#### 36. Statement (iteration interface) + +Iteration scope for statements: interface bodies. + + + +### Type + +#### 1. Type: Alias + +A type alias declaration + + + +#### 2. Type: Argument catch + +Type of a parameter in a catch clause + + + +#### 3. Type: Argument formal + +Type of a formal parameter in a function declaration + + + +#### 4. Type: Argument formal constructor + +Type of a formal parameter in a constructor declaration + + -# C# +#### 5. Type: Argument formal lambda + +Type of a formal parameter in a lambda declaration + + + +#### 6. Type: Argument formal method + +Type of a formal parameter in a class method declaration + + + +#### 7. Type: Cast + +A type cast + + + +#### 8. Type: Class + +A class declaration + + + +#### 9. Type: Constant + +Type of a constant declaration + + + +#### 10. Type: Enum + +An enum declaration + + + +#### 11. Type: Field class + +Type of a field in a class + + + +#### 12. Type: Field interface + +Type of a field in a interface + + + +#### 13. Type: Foreach + +Type of a variable in a for each loop + + + +#### 14. Type: Interface + +An interface declaration + + + +#### 15. Type: Resource + +Type in a 'with' / 'use' / 'using' statement + + + +#### 16. Type: Return + +Type of a return value in a function declaration + + + +#### 17. Type: Return method + +Type of a return value in a method declaration + + + +#### 18. Type: Type argument + +Type argument to a generic / parametrized type + + + +#### 19. Type: Variable initialized + +Type of an initialized variable declaration + + + +#### 20. Type: Variable uninitialized + +Type of an uninitialized variable declaration + + + +#### 21. Type (iteration block) + +Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 22. Type (iteration class) + +Iteration scope for types: class bodies. + + + +#### 23. Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + + + +#### 24. Type (iteration interface) + +Iteration scope for types: interface bodies. + + + +#### 25. Type: Argument formal (iteration) + +Iteration scope for types of formal parameters in a function declaration: the parameters list. + + + +#### 26. Type: Argument formal constructor (iteration) + +Iteration scope for types of formal parameters in a constructor declaration: the parameters list. + + + +#### 27. Type: Argument formal lambda (iteration) + +Iteration scope for types of formal parameters in a lambda declaration: the parameters list. + + + +#### 28. Type: Argument formal method (iteration) + +Iteration scope for types of formal parameters in a method declaration: the parameters list. + + + +#### 29. Type: Type argument (iteration) + +Iteration scope for type arguments to a generic / parametrized type: the type argument list. + + + +### Value + +#### 1. Value: Argument actual + +The value of a (keyword) argument in a function call + + + +#### 2. Value: Argument formal + +The (default) value of a argument in a function declaration + + + +#### 3. Value: Argument formal constructor + +The (default) value of a parameter in a constructor declaration + + + +#### 4. Value: Argument formal lambda + +The (default) value of a parameter in a lambda declaration + + + +#### 5. Value: Argument formal method + +The (default) value of a parameter in a method declaration + + + +#### 6. Value: Assignment + +Value (RHS) of an assignment + + + + + +#### 7. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 8. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 9. Value: Field class + +Value (RHS) of a field in a class + + + +#### 10. Value: Field enum + +Value (RHS) of a field in an enum + + + +#### 11. Value: Field interface + +Value (RHS) of a field in an interface + + + +#### 12. Value: Foreach + +Iterable in a for each loop + + + +#### 13. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 14. Value: Resource + +Value of a 'with' / 'use' / 'using' statement + + + +#### 15. Value: Return + +Return value of a function + + + +#### 16. Value: Return lambda + +Implicit return value from a lambda + + + +#### 17. Value: Switch + +The value / subject of a switch statement + + + +#### 18. Value: Throw + +Value of a throw statement + + + +#### 19. Value: Type alias + +Value of a type alias declaration + + + +#### 20. Value: Variable + +Value (RHS) of a variable declaration + + + + + +#### 21. Value: Yield + +Value of a yield statement + + + +#### 22. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 23. Value (iteration class) + +Iteration scope for values: class bodies. + + + +#### 24. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 25. Value (iteration enum) + +Iteration scope for values: enum bodies. + + + +#### 26. Value: Argument actual (iteration) + +Iteration scope for values of (keyword) arguments in a function call: the arguments list. + + + +#### 27. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 28. Value: Argument formal constructor (iteration) + +Iteration scope for values of formal parameters in a constructor declaration: the parameters list. + + + +#### 29. Value: Argument formal lambda (iteration) + +Iteration scope for values of formal parameters in a lambda declaration: the parameters list. + + + +#### 30. Value: Argument formal method (iteration) + +Iteration scope for values of formal parameters in a method declaration: the parameters list. + + + +#### 31. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + +#### 2. Interior: Constructor + +The body of a constructor declaration + + + +#### 3. Interior: Do while + +The body of a do-while loop + + + +#### 4. Interior: Enum + +The body of an enum + + + +#### 5. Interior: For + +The body of a for loop + + + +#### 6. Interior: Foreach + +The body of a for-each loop + + + +#### 7. Interior: Function + +The body of a function declaration + + + +#### 8. Interior: If + +The body of an if/elif/else branch + + + +#### 9. Interior: Interface + +The body of a interface + + + +#### 10. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 11. Interior: Method + +The body of a method declaration + + + +#### 12. Interior: Namespace + +the body of a namespace statement + + + +#### 13. Interior: Resource + +the body of a 'with' / 'use' / 'using' statement + + + +#### 14. Interior: Switch + +The body of a switch statement + + + +#### 15. Interior: Switch case + +The body of a switch case branch + + + + + +#### 16. Interior: Try + +The body of a try/catch/finally branch + + + +#### 17. Interior: While + +The body of a while loop + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 4. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + - + diff --git a/packages/app-web-docs/src/docs/user/languages/css.mdx b/packages/app-web-docs/src/docs/user/languages/css.mdx index f469005845f..449c60c0250 100644 --- a/packages/app-web-docs/src/docs/user/languages/css.mdx +++ b/packages/app-web-docs/src/docs/user/languages/css.mdx @@ -1,5 +1,235 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # CSS - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Argument list + +#### 1. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual single line + +A single line list of arguments in a function call + + + +### Argument or parameter + +#### 1. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual single line + +A single line argument in a function call + + + + + + + + + +#### 3. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +### Function call + +#### 1. Function call + +A function call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +### Map + +#### 1. Map + +A map/dictionary + + + +### Name + +#### 1. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + +#### 2. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +### Selector + +#### 1. Selector + +A selector in a css rule set + + + + + + + + + + + + + + + +### Statement + +#### 1. Statement: Misc + +A miscellaneous statement + + + +#### 2. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Unit + +#### 1. Unit + +A unit in a css rule set + + + + + + + + + + + +### Value + +#### 1. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + + + +#### 2. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### String + +#### 1. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/dart.mdx b/packages/app-web-docs/src/docs/user/languages/dart.mdx index 89839b3a971..8e9bbd534fc 100644 --- a/packages/app-web-docs/src/docs/user/languages/dart.mdx +++ b/packages/app-web-docs/src/docs/user/languages/dart.mdx @@ -1,5 +1,1463 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Dart - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + +### Argument list + +#### 1. Argument list: Actual constructor empty + +An empty list of arguments in a constructor call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual constructor multi line + +A multi line list of arguments in a constructor call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual constructor single line + +A single line list of arguments in a constructor call + + + +#### 4. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 5. Argument list: Actual enum empty + +An empty list of arguments in an enum constructor call. Insertion delimiter should be empty. + + + +#### 6. Argument list: Actual enum multi line + +A multi line list of arguments in an enum constructor call. Insertion delimiter should include new line. + + + +#### 7. Argument list: Actual enum single line + +A single line list of arguments in an enum constructor call + + + +#### 8. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 9. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 10. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 11. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 12. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 13. Argument list: Formal constructor empty + +An empty list of parameters in a constructor declaration. Insertion delimiter should be empty. + + + +#### 14. Argument list: Formal constructor multi line + +A multi line list of parameters in a constructor declaration. Insertion delimiter should include new line. + + + +#### 15. Argument list: Formal constructor single line + +A single line list of parameters in a constructor declaration + + + +#### 16. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + +#### 17. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + +#### 18. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + +#### 19. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + +#### 20. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + +#### 21. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 22. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 23. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 24. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual constructor multi line + +A multi line argument in a constructor call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual constructor single line + +A single line argument in a constructor call + + + +#### 3. Argument: Actual enum multi line + +A multi line argument in an enum constructor call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual enum single line + +A single line argument in an enum constructor call + + + +#### 5. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 6. Argument: Actual method single line + +A single line argument in a method call + + + +#### 7. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 8. Argument: Actual single line + +A single line argument in a function call + + + +#### 9. Argument: Formal catch + +A parameter in a catch clause + + + +#### 10. Argument: Formal constructor multi line + +A multi line parameter in a constructor declaration. Insertion delimiter should include new line. + + + +#### 11. Argument: Formal constructor single line + +A single line parameter in a constructor declaration + + + +#### 12. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 13. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + +#### 14. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 15. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 16. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 17. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 18. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 19. Argument: Actual constructor (iteration) + +Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. + + + +#### 20. Argument: Actual enum (iteration) + +Iteration scope for arguments in an enum constructor call: the argument list. The domain should be the entire enum constructor call.. + + + +#### 21. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 22. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + +#### 23. Argument: Formal constructor (iteration) + +Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. + + + +#### 24. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + +#### 25. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: Ternary + +A branch in a ternary expression + + + +#### 6. Branch: Try + +A try/catch/finally branch + + + +#### 7. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 8. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 9. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +#### 10. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + +#### 2. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + + + +#### 3. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: Do while + +A condition in a do while loop + + + +#### 2. Condition: For + +A condition in a for loop + + + +#### 3. Condition: If + +A condition in an if statement + + + +#### 4. Condition: Switch case + +A condition in a switch statement + + + +#### 5. Condition: Ternary + +A condition in a ternary expression + + + +#### 6. Condition: While + +A condition in a while loop + + + +#### 7. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Constructor + +A constructor call + + + +#### 4. Function call: Enum + +An enum constructor call + + + +#### 5. Function call: Generic + +A function call with generic type arguments + + + +#### 6. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Constructor + +The class being constructed in a class instantiation, including the `new` keyword. + + + +#### 4. Function callee: Enum + +The enum constructor being called + + + +#### 5. Function callee: Generic + +The function being called in a function call with generic type arguments + + + +#### 6. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + +### Map + +#### 1. Map + +A map/dictionary + + + + + +### Name + +#### 1. Name: Argument actual + +Name of a (keyword) argument in a function call + + + +#### 2. Name: Argument catch + +Name of a parameter in a catch clause + + + +#### 3. Name: Argument formal + +Name of a parameter in a function declaration + + + +#### 4. Name: Argument formal constructor + +The name of a parameter in a constructor declaration + + + +#### 5. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 6. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 7. Name: Assignment + +Name (LHS) of an assignment + + + +#### 8. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 9. Name: Class + +Name of a class + + + +#### 10. Name: Constant + +Name (LHS) of a constant declaration + + + +#### 11. Name: Constructor + +Name of a constructor + + + +#### 12. Name: Enum + +Name of an enum + + + +#### 13. Name: Field class + +Name (LHS) of a field in a class + + + +#### 14. Name: Field enum + +Name (LHS) of a field in an enum + + + +#### 15. Name: Foreach + +Iteration variable name in a for each loop + + + +#### 16. Name: Function + +Name of a function + + + +#### 17. Name: Method + +Name of a class method + + + +#### 18. Name: Type alias + +Name of a type alias + + + +#### 19. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 20. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + +#### 21. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 22. Name (iteration class) + +Iteration scope for names: class bodies. + + + +#### 23. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 24. Name (iteration enum) + +Iteration scope for names: enum bodies. + + + +#### 25. Name: Argument actual (iteration) + +Iteration scope for names of (keyword) arguments in a function call: the argument list. + + + +#### 26. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 27. Name: Argument formal constructor (iteration) + +Iteration scope for names of formal parameters in a constructor declaration: the parameters list. + + + +#### 28. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 29. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + +#### 2. Named function: Constructor + +A constructor declaration in a class + + + +#### 3. Named function: Method + +A named method declaration in a class + + + +#### 4. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 5. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Break + +A break statement + + + +#### 4. Statement: Class + +A class/struct declaration + + + +#### 5. Statement: Constant + +A constant declaration + + + +#### 6. Statement: Constructor + +A constructor declaration + + + +#### 7. Statement: Continue + +A continue statement + + + +#### 8. Statement: Do while + +A do-while loop statement + + + +#### 9. Statement: Enum + +An enum declaration + + + +#### 10. Statement: Field class + +A field declaration in a class/struct + + + +#### 11. Statement: For + +A for loop statement + + + +#### 12. Statement: Foreach + +A for-each loop statement + + + +#### 13. Statement: Function + +A named function declaration + + + +#### 14. Statement: Function call + +A function call statement + + + +#### 15. Statement: If + +A if/elif/else statement + + + +#### 16. Statement: Import + +An import statement + + + +#### 17. Statement: Method + +A method declaration + + + +#### 18. Statement: Return + +A return statement + + + +#### 19. Statement: Switch + +A switch statement + + + +#### 20. Statement: Throw + +A throw statement + + + +#### 21. Statement: Try + +A try/catch/finally statement + + + +#### 22. Statement: Type alias + +A type alias declaration + + + +#### 23. Statement: Update + +An update statement, eg ++/-- + + + +#### 24. Statement: Variable initialized + +An initialized variable declaration + + + +#### 25. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 26. Statement: While + +A while loop statement + + + +#### 27. Statement: Yield + +A yield statement + + + +#### 28. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 29. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + +#### 30. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Type + +#### 1. Type: Alias + +A type alias declaration + + + +#### 2. Type: Argument catch + +Type of a parameter in a catch clause + + + +#### 3. Type: Argument formal + +Type of a formal parameter in a function declaration + + + +#### 4. Type: Argument formal constructor + +Type of a formal parameter in a constructor declaration + + + +#### 5. Type: Argument formal lambda + +Type of a formal parameter in a lambda declaration + + + +#### 6. Type: Argument formal method + +Type of a formal parameter in a class method declaration + + + +#### 7. Type: Cast + +A type cast + + + +#### 8. Type: Class + +A class declaration + + + +#### 9. Type: Constant + +Type of a constant declaration + + + +#### 10. Type: Enum + +An enum declaration + + + +#### 11. Type: Field class + +Type of a field in a class + + + +#### 12. Type: Foreach + +Type of a variable in a for each loop + + + +#### 13. Type: Return + +Type of a return value in a function declaration + + + +#### 14. Type: Return method + +Type of a return value in a method declaration + + + +#### 15. Type: Type argument + +Type argument to a generic / parametrized type + + + +#### 16. Type: Variable initialized + +Type of an initialized variable declaration + + + +#### 17. Type: Variable uninitialized + +Type of an uninitialized variable declaration + + + +#### 18. Type (iteration block) + +Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 19. Type (iteration class) + +Iteration scope for types: class bodies. + + + +#### 20. Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + + + +#### 21. Type: Argument formal (iteration) + +Iteration scope for types of formal parameters in a function declaration: the parameters list. + + + +#### 22. Type: Argument formal constructor (iteration) + +Iteration scope for types of formal parameters in a constructor declaration: the parameters list. + + + +#### 23. Type: Argument formal lambda (iteration) + +Iteration scope for types of formal parameters in a lambda declaration: the parameters list. + + + +#### 24. Type: Argument formal method (iteration) + +Iteration scope for types of formal parameters in a method declaration: the parameters list. + + + +#### 25. Type: Type argument (iteration) + +Iteration scope for type arguments to a generic / parametrized type: the type argument list. + + + +### Value + +#### 1. Value: Argument actual + +The value of a (keyword) argument in a function call + + + +#### 2. Value: Argument formal + +The (default) value of a argument in a function declaration + + + +#### 3. Value: Argument formal constructor + +The (default) value of a parameter in a constructor declaration + + + +#### 4. Value: Argument formal lambda + +The (default) value of a parameter in a lambda declaration + + + +#### 5. Value: Argument formal method + +The (default) value of a parameter in a method declaration + + + +#### 6. Value: Assignment + +Value (RHS) of an assignment + + + +#### 7. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 8. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 9. Value: Field class + +Value (RHS) of a field in a class + + + +#### 10. Value: Foreach + +Iterable in a for each loop + + + +#### 11. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 12. Value: Return + +Return value of a function + + + +#### 13. Value: Return lambda + +Implicit return value from a lambda + + + +#### 14. Value: Switch + +The value / subject of a switch statement + + + +#### 15. Value: Throw + +Value of a throw statement + + + +#### 16. Value: Type alias + +Value of a type alias declaration + + + +#### 17. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 18. Value: Yield + +Value of a yield statement + + + +#### 19. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 20. Value (iteration class) + +Iteration scope for values: class bodies. + + + +#### 21. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 22. Value: Argument actual (iteration) + +Iteration scope for values of (keyword) arguments in a function call: the arguments list. + + + +#### 23. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 24. Value: Argument formal constructor (iteration) + +Iteration scope for values of formal parameters in a constructor declaration: the parameters list. + + + +#### 25. Value: Argument formal lambda (iteration) + +Iteration scope for values of formal parameters in a lambda declaration: the parameters list. + + + +#### 26. Value: Argument formal method (iteration) + +Iteration scope for values of formal parameters in a method declaration: the parameters list. + + + +#### 27. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + +#### 2. Interior: Constructor + +The body of a constructor declaration + + + +#### 3. Interior: Do while + +The body of a do-while loop + + + +#### 4. Interior: Enum + +The body of an enum + + + +#### 5. Interior: For + +The body of a for loop + + + +#### 6. Interior: Foreach + +The body of a for-each loop + + + +#### 7. Interior: Function + +The body of a function declaration + + + +#### 8. Interior: If + +The body of an if/elif/else branch + + + +#### 9. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 10. Interior: Method + +The body of a method declaration + + + +#### 11. Interior: Switch + +The body of a switch statement + + + +#### 12. Interior: Switch case + +The body of a switch case branch + + + + + +#### 13. Interior: Try + +The body of a try/catch/finally branch + + + +#### 14. Interior: While + +The body of a while loop + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 4. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/go.mdx b/packages/app-web-docs/src/docs/user/languages/go.mdx index 81a5223eae9..5eabbcabc52 100644 --- a/packages/app-web-docs/src/docs/user/languages/go.mdx +++ b/packages/app-web-docs/src/docs/user/languages/go.mdx @@ -1,5 +1,1107 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Go - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + +### Argument list + +#### 1. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 3. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 5. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 7. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + +#### 8. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + +#### 9. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + +#### 10. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + +#### 11. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + +#### 12. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 13. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 14. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 15. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual method single line + +A single line argument in a method call + + + +#### 3. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual single line + +A single line argument in a function call + + + +#### 5. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 6. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + +#### 7. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 8. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 9. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 10. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 11. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 12. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 13. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + +#### 14. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + +#### 15. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 6. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + +#### 2. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + + + +#### 3. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: For + +A condition in a for loop + + + +#### 2. Condition: If + +A condition in an if statement + + + +#### 3. Condition: Switch case + +A condition in a switch statement + + + + + +#### 4. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Generic + +A function call with generic type arguments + + + +#### 4. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Generic + +The function being called in a function call with generic type arguments + + + +#### 4. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + + + + + +### Map + +#### 1. Map + +A map/dictionary + + + + + + + +### Name + +#### 1. Name: Argument formal + +Name of a parameter in a function declaration + + + +#### 2. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 3. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 4. Name: Assignment + +Name (LHS) of an assignment + + + +#### 5. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 6. Name: Class + +Name of a class + + + +#### 7. Name: Constant + +Name (LHS) of a constant declaration + + + +#### 8. Name: Field class + +Name (LHS) of a field in a class + + + +#### 9. Name: Foreach + +Iteration variable name in a for each loop + + + +#### 10. Name: Function + +Name of a function + + + +#### 11. Name: Interface + +Name of a interface + + + +#### 12. Name: Method + +Name of a class method + + + +#### 13. Name: Method interface + +Name of a interface method + + + +#### 14. Name: Type alias + +Name of a type alias + + + +#### 15. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + + + +#### 16. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + +#### 17. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 18. Name (iteration class) + +Iteration scope for names: class bodies. + + + +#### 19. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 20. Name (iteration interface) + +Iteration scope for names: interface bodies. + + + +#### 21. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 22. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 23. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + + + + + + + +#### 2. Named function: Method + +A named method declaration in a class + + + +#### 3. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 4. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Break + +A break statement + + + +#### 4. Statement: Class + +A class/struct declaration + + + +#### 5. Statement: Constant + +A constant declaration + + + +#### 6. Statement: Continue + +A continue statement + + + +#### 7. Statement: Field class + +A field declaration in a class/struct + + + +#### 8. Statement: For + +A for loop statement + + + +#### 9. Statement: Foreach + +A for-each loop statement + + + +#### 10. Statement: Function + +A named function declaration + + + +#### 11. Statement: Function call + +A function call statement + + + +#### 12. Statement: If + +A if/elif/else statement + + + +#### 13. Statement: Import + +An import statement + + + +#### 14. Statement: Interface + +An interface declaration + + + +#### 15. Statement: Method + +A method declaration + + + +#### 16. Statement: Method interface + +A method declaration in a interface + + + +#### 17. Statement: Package + +A package declaration + + + +#### 18. Statement: Return + +A return statement + + + +#### 19. Statement: Switch + +A switch statement + + + +#### 20. Statement: Type alias + +A type alias declaration + + + +#### 21. Statement: Update + +An update statement, eg ++/-- + + + + + +#### 22. Statement: Variable initialized + +An initialized variable declaration + + + + + +#### 23. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 24. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 25. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + +#### 26. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +#### 27. Statement (iteration interface) + +Iteration scope for statements: interface bodies. + + + +### Type + +#### 1. Type: Alias + +A type alias declaration + + + +#### 2. Type: Argument formal + +Type of a formal parameter in a function declaration + + + +#### 3. Type: Argument formal lambda + +Type of a formal parameter in a lambda declaration + + + +#### 4. Type: Argument formal method + +Type of a formal parameter in a class method declaration + + + +#### 5. Type: Class + +A class declaration + + + +#### 6. Type: Constant + +Type of a constant declaration + + + +#### 7. Type: Field class + +Type of a field in a class + + + +#### 8. Type: Interface + +An interface declaration + + + +#### 9. Type: Return + +Type of a return value in a function declaration + + + +#### 10. Type: Return lambda + +Type of a return value in a lambda declaration + + + +#### 11. Type: Return method + +Type of a return value in a method declaration + + + +#### 12. Type: Type argument + +Type argument to a generic / parametrized type + + + +#### 13. Type: Variable initialized + +Type of an initialized variable declaration + + + +#### 14. Type: Variable uninitialized + +Type of an uninitialized variable declaration + + + +#### 15. Type (iteration block) + +Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 16. Type (iteration class) + +Iteration scope for types: class bodies. + + + +#### 17. Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + + + +#### 18. Type: Argument formal (iteration) + +Iteration scope for types of formal parameters in a function declaration: the parameters list. + + + +#### 19. Type: Argument formal lambda (iteration) + +Iteration scope for types of formal parameters in a lambda declaration: the parameters list. + + + +#### 20. Type: Argument formal method (iteration) + +Iteration scope for types of formal parameters in a method declaration: the parameters list. + + + +#### 21. Type: Type argument (iteration) + +Iteration scope for type arguments to a generic / parametrized type: the type argument list. + + + +### Value + +#### 1. Value: Assignment + +Value (RHS) of an assignment + + + +#### 2. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 3. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 4. Value: Foreach + +Iterable in a for each loop + + + +#### 5. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 6. Value: Return + +Return value of a function + + + +#### 7. Value: Switch + +The value / subject of a switch statement + + + + + +#### 8. Value: Type alias + +Value of a type alias declaration + + + +#### 9. Value: Variable + +Value (RHS) of a variable declaration + + + + + + + +#### 10. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 11. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 12. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + +#### 2. Interior: For + +The body of a for loop + + + +#### 3. Interior: Foreach + +The body of a for-each loop + + + +#### 4. Interior: Function + +The body of a function declaration + + + +#### 5. Interior: If + +The body of an if/elif/else branch + + + +#### 6. Interior: Interface + +The body of a interface + + + +#### 7. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 8. Interior: Method + +The body of a method declaration + + + +#### 9. Interior: Switch + +The body of a switch statement + + + + + +#### 10. Interior: Switch case + +The body of a switch case branch + + + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 4. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/html.mdx b/packages/app-web-docs/src/docs/user/languages/html.mdx index e5ca41f1a78..a126e7f25b5 100644 --- a/packages/app-web-docs/src/docs/user/languages/html.mdx +++ b/packages/app-web-docs/src/docs/user/languages/html.mdx @@ -1,5 +1,119 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # HTML - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Attribute + +#### 1. Attribute + +A attribute, eg of a html element or a C++ attribute + + + +### Collection key + +#### 1. Key: Attribute + +Key (LHS) of an attribute eg in a xml element + + + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +### Value + +#### 1. Value: Attribute + +Value (RHS) of an attribute eg in a xml element + + + +### Xml both tags + +#### 1. Tags + +Both tags in a xml element + + + +### Xml element + +#### 1. Element + +A xml/html element. Also used for LaTeX environments + + + +### Xml end tag + +#### 1. End tag + +The end tag of a xml element + + + +### Xml start tag + +#### 1. Start tag + +The start tag of a xml element + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Interior + +#### 1. Interior: Element + +The interior/children of a XML element + + + +### String + +#### 1. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Element + +Internally used text fragment consisting of a xml element interior + + + +#### 3. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/java.mdx b/packages/app-web-docs/src/docs/user/languages/java.mdx index d2a3f0461fe..9f0da56c040 100644 --- a/packages/app-web-docs/src/docs/user/languages/java.mdx +++ b/packages/app-web-docs/src/docs/user/languages/java.mdx @@ -1,5 +1,1425 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Java - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + +### Argument list + +#### 1. Argument list: Actual constructor empty + +An empty list of arguments in a constructor call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual constructor multi line + +A multi line list of arguments in a constructor call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual constructor single line + +A single line list of arguments in a constructor call + + + +#### 4. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 5. Argument list: Actual enum empty + +An empty list of arguments in an enum constructor call. Insertion delimiter should be empty. + + + +#### 6. Argument list: Actual enum multi line + +A multi line list of arguments in an enum constructor call. Insertion delimiter should include new line. + + + +#### 7. Argument list: Actual enum single line + +A single line list of arguments in an enum constructor call + + + +#### 8. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 9. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 10. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 11. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 12. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 13. Argument list: Formal constructor empty + +An empty list of parameters in a constructor declaration. Insertion delimiter should be empty. + + + +#### 14. Argument list: Formal constructor multi line + +A multi line list of parameters in a constructor declaration. Insertion delimiter should include new line. + + + +#### 15. Argument list: Formal constructor single line + +A single line list of parameters in a constructor declaration + + + +#### 16. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + +#### 17. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + +#### 18. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + +#### 19. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + +#### 20. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 21. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +### Argument or parameter + +#### 1. Argument: Actual constructor multi line + +A multi line argument in a constructor call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual constructor single line + +A single line argument in a constructor call + + + +#### 3. Argument: Actual enum multi line + +A multi line argument in an enum constructor call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual enum single line + +A single line argument in an enum constructor call + + + +#### 5. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 6. Argument: Actual method single line + +A single line argument in a method call + + + +#### 7. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 8. Argument: Actual single line + +A single line argument in a function call + + + +#### 9. Argument: Formal catch + +A parameter in a catch clause + + + +#### 10. Argument: Formal constructor multi line + +A multi line parameter in a constructor declaration. Insertion delimiter should include new line. + + + +#### 11. Argument: Formal constructor single line + +A single line parameter in a constructor declaration + + + +#### 12. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 13. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + +#### 14. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 15. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 16. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 17. Argument: Actual constructor (iteration) + +Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. + + + +#### 18. Argument: Actual enum (iteration) + +Iteration scope for arguments in an enum constructor call: the argument list. The domain should be the entire enum constructor call.. + + + +#### 19. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 20. Argument: Formal constructor (iteration) + +Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. + + + +#### 21. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + +#### 22. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: Ternary + +A branch in a ternary expression + + + +#### 6. Branch: Try + +A try/catch/finally branch + + + +#### 7. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 8. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 9. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +#### 10. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + + + +#### 2. Class (iteration class) + +Iteration scope for classes: class bodies. + + + +#### 3. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + + + + + +#### 2. Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + + + + + + + +#### 3. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + + + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: Do while + +A condition in a do while loop + + + +#### 2. Condition: For + +A condition in a for loop + + + +#### 3. Condition: If + +A condition in an if statement + + + +#### 4. Condition: Switch case + +A condition in a switch statement + + + + + + + + + +#### 5. Condition: Ternary + +A condition in a ternary expression + + + +#### 6. Condition: While + +A condition in a while loop + + + +#### 7. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Constructor + +A constructor call + + + +#### 4. Function call: Enum + +An enum constructor call + + + +#### 5. Function call: Generic + +A function call with generic type arguments + + + +#### 6. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Constructor + +The class being constructed in a class instantiation, including the `new` keyword. + + + +#### 4. Function callee: Enum + +The enum constructor being called + + + +#### 5. Function callee: Generic + +The function being called in a function call with generic type arguments + + + +#### 6. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + +### Name + +#### 1. Name: Argument catch + +Name of a parameter in a catch clause + + + +#### 2. Name: Argument formal constructor + +The name of a parameter in a constructor declaration + + + +#### 3. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 4. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 5. Name: Assignment + +Name (LHS) of an assignment + + + +#### 6. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 7. Name: Class + +Name of a class + + + + + +#### 8. Name: Constant + +Name (LHS) of a constant declaration + + + +#### 9. Name: Constructor + +Name of a constructor + + + + + +#### 10. Name: Enum + +Name of an enum + + + +#### 11. Name: Field class + +Name (LHS) of a field in a class + + + +#### 12. Name: Field enum + +Name (LHS) of a field in an enum + + + +#### 13. Name: Field interface + +Name (LHS) of a field in an interface + + + +#### 14. Name: Foreach + +Iteration variable name in a for each loop + + + +#### 15. Name: Interface + +Name of a interface + + + +#### 16. Name: Method + +Name of a class method + + + + + +#### 17. Name: Method interface + +Name of a interface method + + + +#### 18. Name: Resource + +Name in a 'with' / 'use' / 'using' statement + + + +#### 19. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 20. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + +#### 21. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 22. Name (iteration class) + +Iteration scope for names: class bodies. + + + +#### 23. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 24. Name (iteration enum) + +Iteration scope for names: enum bodies. + + + +#### 25. Name (iteration interface) + +Iteration scope for names: interface bodies. + + + +#### 26. Name: Argument formal constructor (iteration) + +Iteration scope for names of formal parameters in a constructor declaration: the parameters list. + + + +#### 27. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 28. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function: Constructor + +A constructor declaration in a class + + + + + +#### 2. Named function: Method + +A named method declaration in a class + + + + + +#### 3. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Break + +A break statement + + + +#### 4. Statement: Class + +A class/struct declaration + + + + + +#### 5. Statement: Constant + +A constant declaration + + + +#### 6. Statement: Constructor + +A constructor declaration + + + + + +#### 7. Statement: Continue + +A continue statement + + + +#### 8. Statement: Do while + +A do-while loop statement + + + +#### 9. Statement: Enum + +An enum declaration + + + +#### 10. Statement: Field class + +A field declaration in a class/struct + + + +#### 11. Statement: Field interface + +A field declaration in a interface + + + +#### 12. Statement: For + +A for loop statement + + + +#### 13. Statement: Foreach + +A for-each loop statement + + + +#### 14. Statement: Function call + +A function call statement + + + +#### 15. Statement: If + +A if/elif/else statement + + + +#### 16. Statement: Import + +An import statement + + + +#### 17. Statement: Interface + +An interface declaration + + + + + +#### 18. Statement: Method + +A method declaration + + + + + +#### 19. Statement: Method interface + +A method declaration in a interface + + + +#### 20. Statement: Misc + +A miscellaneous statement + + + +#### 21. Statement: Package + +A package declaration + + + +#### 22. Statement: Resource + +A 'with' / 'use' / 'using' statement + + + +#### 23. Statement: Return + +A return statement + + + +#### 24. Statement: Static + +A static statement + + + +#### 25. Statement: Switch + +A switch statement + + + +#### 26. Statement: Throw + +A throw statement + + + +#### 27. Statement: Try + +A try/catch/finally statement + + + +#### 28. Statement: Update + +An update statement, eg ++/-- + + + + + +#### 29. Statement: Variable initialized + +An initialized variable declaration + + + +#### 30. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 31. Statement: While + +A while loop statement + + + +#### 32. Statement: Yield + +A yield statement + + + +#### 33. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 34. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + + + +#### 35. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +#### 36. Statement (iteration interface) + +Iteration scope for statements: interface bodies. + + + +### Type + +#### 1. Type: Argument catch + +Type of a parameter in a catch clause + + + +#### 2. Type: Argument formal constructor + +Type of a formal parameter in a constructor declaration + + + +#### 3. Type: Argument formal lambda + +Type of a formal parameter in a lambda declaration + + + +#### 4. Type: Argument formal method + +Type of a formal parameter in a class method declaration + + + +#### 5. Type: Cast + +A type cast + + + +#### 6. Type: Class + +A class declaration + + + +#### 7. Type: Constant + +Type of a constant declaration + + + +#### 8. Type: Enum + +An enum declaration + + + +#### 9. Type: Field class + +Type of a field in a class + + + +#### 10. Type: Field interface + +Type of a field in a interface + + + +#### 11. Type: Foreach + +Type of a variable in a for each loop + + + +#### 12. Type: Interface + +An interface declaration + + + +#### 13. Type: Resource + +Type in a 'with' / 'use' / 'using' statement + + + +#### 14. Type: Return method + +Type of a return value in a method declaration + + + +#### 15. Type: Type argument + +Type argument to a generic / parametrized type + + + +#### 16. Type: Variable initialized + +Type of an initialized variable declaration + + + +#### 17. Type: Variable uninitialized + +Type of an uninitialized variable declaration + + + +#### 18. Type (iteration block) + +Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 19. Type (iteration class) + +Iteration scope for types: class bodies. + + + + + +#### 20. Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + + + +#### 21. Type (iteration interface) + +Iteration scope for types: interface bodies. + + + +#### 22. Type: Argument formal constructor (iteration) + +Iteration scope for types of formal parameters in a constructor declaration: the parameters list. + + + +#### 23. Type: Argument formal lambda (iteration) + +Iteration scope for types of formal parameters in a lambda declaration: the parameters list. + + + +#### 24. Type: Argument formal method (iteration) + +Iteration scope for types of formal parameters in a method declaration: the parameters list. + + + +#### 25. Type: Type argument (iteration) + +Iteration scope for type arguments to a generic / parametrized type: the type argument list. + + + +### Value + +#### 1. Value: Assignment + +Value (RHS) of an assignment + + + + + +#### 2. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 3. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 4. Value: Field class + +Value (RHS) of a field in a class + + + +#### 5. Value: Field interface + +Value (RHS) of a field in an interface + + + +#### 6. Value: Foreach + +Iterable in a for each loop + + + +#### 7. Value: Resource + +Value of a 'with' / 'use' / 'using' statement + + + +#### 8. Value: Return + +Return value of a function + + + +#### 9. Value: Return lambda + +Implicit return value from a lambda + + + +#### 10. Value: Switch + +The value / subject of a switch statement + + + +#### 11. Value: Throw + +Value of a throw statement + + + +#### 12. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 13. Value: Yield + +Value of a yield statement + + + +#### 14. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 15. Value (iteration class) + +Iteration scope for values: class bodies. + + + + + +#### 16. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + +#### 2. Interior: Constructor + +The body of a constructor declaration + + + +#### 3. Interior: Do while + +The body of a do-while loop + + + +#### 4. Interior: Enum + +The body of an enum + + + +#### 5. Interior: For + +The body of a for loop + + + +#### 6. Interior: Foreach + +The body of a for-each loop + + + +#### 7. Interior: If + +The body of an if/elif/else branch + + + +#### 8. Interior: Interface + +The body of a interface + + + +#### 9. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 10. Interior: Method + +The body of a method declaration + + + +#### 11. Interior: Resource + +the body of a 'with' / 'use' / 'using' statement + + + +#### 12. Interior: Static + +the body of a static statement + + + +#### 13. Interior: Switch + +The body of a switch statement + + + +#### 14. Interior: Switch case + +The body of a switch case branch + + + + + +#### 15. Interior: Try + +The body of a try/catch/finally branch + + + +#### 16. Interior: While + +The body of a while loop + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 4. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/javascript.mdx b/packages/app-web-docs/src/docs/user/languages/javascript.mdx index f1787df969c..f4e7cf47655 100644 --- a/packages/app-web-docs/src/docs/user/languages/javascript.mdx +++ b/packages/app-web-docs/src/docs/user/languages/javascript.mdx @@ -1,5 +1,1559 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # JavaScript - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + + + + + +### Argument list + +#### 1. Argument list: Actual constructor empty + +An empty list of arguments in a constructor call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual constructor multi line + +A multi line list of arguments in a constructor call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual constructor single line + +A single line list of arguments in a constructor call + + + +#### 4. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 5. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 6. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 7. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 8. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 9. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 10. Argument list: Formal constructor empty + +An empty list of parameters in a constructor declaration. Insertion delimiter should be empty. + + + +#### 11. Argument list: Formal constructor multi line + +A multi line list of parameters in a constructor declaration. Insertion delimiter should include new line. + + + +#### 12. Argument list: Formal constructor single line + +A single line list of parameters in a constructor declaration + + + +#### 13. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 14. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + + + +#### 15. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + + + +#### 16. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + + + +#### 17. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + + + + + + + + + + + + + + + +#### 18. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 19. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 20. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 21. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual constructor multi line + +A multi line argument in a constructor call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual constructor single line + +A single line argument in a constructor call + + + +#### 3. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual method single line + +A single line argument in a method call + + + +#### 5. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument: Actual single line + +A single line argument in a function call + + + +#### 7. Argument: Formal catch + +A parameter in a catch clause + + + +#### 8. Argument: Formal constructor multi line + +A multi line parameter in a constructor declaration. Insertion delimiter should include new line. + + + +#### 9. Argument: Formal constructor single line + +A single line parameter in a constructor declaration + + + +#### 10. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 11. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + + + +#### 12. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 13. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 14. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 15. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 16. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 17. Argument: Actual constructor (iteration) + +Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. + + + +#### 18. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 19. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 20. Argument: Formal constructor (iteration) + +Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. + + + +#### 21. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + + + +#### 22. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + + + + + + + + + + + + + + + +### Attribute + +#### 1. Attribute + +A attribute, eg of a html element or a C++ attribute + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: Ternary + +A branch in a ternary expression + + + +#### 6. Branch: Try + +A try/catch/finally branch + + + +#### 7. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 8. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 9. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +#### 10. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + + + + + +#### 2. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + + + +#### 3. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Collection key + +#### 1. Key: Attribute + +Key (LHS) of an attribute eg in a xml element + + + + + +#### 2. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + + + +#### 3. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: Do while + +A condition in a do while loop + + + +#### 2. Condition: For + +A condition in a for loop + + + +#### 3. Condition: If + +A condition in an if statement + + + +#### 4. Condition: Switch case + +A condition in a switch statement + + + +#### 5. Condition: Ternary + +A condition in a ternary expression + + + +#### 6. Condition: While + +A condition in a while loop + + + +#### 7. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Constructor + +A constructor call + + + +#### 4. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Constructor + +The class being constructed in a class instantiation, including the `new` keyword. + + + +#### 4. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + +### Map + +#### 1. Map + +A map/dictionary + + + + + +### Name + +#### 1. Name: Argument catch + +Name of a parameter in a catch clause + + + +#### 2. Name: Argument formal + +Name of a parameter in a function declaration + + + + + +#### 3. Name: Argument formal constructor + +The name of a parameter in a constructor declaration + + + +#### 4. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 5. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 6. Name: Assignment + +Name (LHS) of an assignment + + + +#### 7. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 8. Name: Assignment destructuring + +LHS of an assignment with pattern destructuring + + + +#### 9. Name: Class + +Name of a class + + + + + + + +#### 10. Name: Constant + +Name (LHS) of a constant declaration + + + +#### 11. Name: Constructor + +Name of a constructor + + + +#### 12. Name: Field class + +Name (LHS) of a field in a class + + + +#### 13. Name: Foreach + +Iteration variable name in a for each loop + + + + + +#### 14. Name: Function + +Name of a function + + + + + + + + + + + + + + + + + + + + + + + + + +#### 15. Name: Method + +Name of a class method + + + + + + + + + + + + + + + + + +#### 16. Name: Variable destructuring + +Name (LHS) of a variable declaration with pattern destructuring + + + +#### 17. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 18. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + +#### 19. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 20. Name (iteration class) + +Iteration scope for names: class bodies. + + + +#### 21. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 22. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 23. Name: Argument formal constructor (iteration) + +Iteration scope for names of formal parameters in a constructor declaration: the parameters list. + + + +#### 24. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 25. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 2. Named function: Constructor + +A constructor declaration in a class + + + +#### 3. Named function: Method + +A named method declaration in a class + + + + + + + + + + + + + + + + + +#### 4. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 5. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Regular expression + +#### 1. Regular expression + +A regular expression + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Assignment destructuring + +An assignment statement with pattern destructuring + + + +#### 4. Statement: Break + +A break statement + + + +#### 5. Statement: Class + +A class/struct declaration + + + + + + + +#### 6. Statement: Constant + +A constant declaration + + + +#### 7. Statement: Constructor + +A constructor declaration + + + +#### 8. Statement: Continue + +A continue statement + + + +#### 9. Statement: Do while + +A do-while loop statement + + + +#### 10. Statement: Field class + +A field declaration in a class/struct + + + +#### 11. Statement: For + +A for loop statement + + + +#### 12. Statement: Foreach + +A for-each loop statement + + + + + +#### 13. Statement: Function + +A named function declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 14. Statement: Function call + +A function call statement + + + +#### 15. Statement: If + +A if/elif/else statement + + + +#### 16. Statement: Import + +An import statement + + + +#### 17. Statement: Method + +A method declaration + + + + + + + + + + + + + + + + + +#### 18. Statement: Return + +A return statement + + + +#### 19. Statement: Static + +A static statement + + + +#### 20. Statement: Switch + +A switch statement + + + +#### 21. Statement: Throw + +A throw statement + + + +#### 22. Statement: Try + +A try/catch/finally statement + + + +#### 23. Statement: Update + +An update statement, eg ++/-- + + + + + +#### 24. Statement: Variable destructuring + +A variable declaration pattern destructuring + + + +#### 25. Statement: Variable initialized + +An initialized variable declaration + + + +#### 26. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 27. Statement: While + +A while loop statement + + + +#### 28. Statement: Yield + +A yield statement + + + +#### 29. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 30. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + +#### 31. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Value + +#### 1. Value: Argument formal + +The (default) value of a argument in a function declaration + + + +#### 2. Value: Argument formal constructor + +The (default) value of a parameter in a constructor declaration + + + +#### 3. Value: Argument formal lambda + +The (default) value of a parameter in a lambda declaration + + + +#### 4. Value: Argument formal method + +The (default) value of a parameter in a method declaration + + + +#### 5. Value: Assignment + +Value (RHS) of an assignment + + + + + +#### 6. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 7. Value: Assignment destructuring + +Value (RHS) of an assignment with pattern destructuring + + + +#### 8. Value: Attribute + +Value (RHS) of an attribute eg in a xml element + + + +#### 9. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 10. Value: Field class + +Value (RHS) of a field in a class + + + +#### 11. Value: Foreach + +Iterable in a for each loop + + + + + +#### 12. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + + + +#### 13. Value: Return + +Return value of a function + + + +#### 14. Value: Return lambda + +Implicit return value from a lambda + + + +#### 15. Value: Switch + +The value / subject of a switch statement + + + +#### 16. Value: Throw + +Value of a throw statement + + + +#### 17. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 18. Value: Variable destructuring + +Value (RHS) of a variable declaration with pattern destructuring + + + +#### 19. Value: Yield + +Value of a yield statement + + + +#### 20. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 21. Value (iteration class) + +Iteration scope for values: class bodies. + + + +#### 22. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 23. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 24. Value: Argument formal constructor (iteration) + +Iteration scope for values of formal parameters in a constructor declaration: the parameters list. + + + +#### 25. Value: Argument formal lambda (iteration) + +Iteration scope for values of formal parameters in a lambda declaration: the parameters list. + + + +#### 26. Value: Argument formal method (iteration) + +Iteration scope for values of formal parameters in a method declaration: the parameters list. + + + +#### 27. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + + + +### Xml both tags + +#### 1. Tags + +Both tags in a xml element + + + +### Xml element + +#### 1. Element + +A xml/html element. Also used for LaTeX environments + + + +### Xml end tag + +#### 1. End tag + +The end tag of a xml element + + + +### Xml start tag + +#### 1. Start tag + +The start tag of a xml element + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + +#### 2. Interior: Constructor + +The body of a constructor declaration + + + +#### 3. Interior: Do while + +The body of a do-while loop + + + +#### 4. Interior: Element + +The interior/children of a XML element + + + +#### 5. Interior: For + +The body of a for loop + + + +#### 6. Interior: Foreach + +The body of a for-each loop + + + + + +#### 7. Interior: Function + +The body of a function declaration + + + +#### 8. Interior: If + +The body of an if/elif/else branch + + + +#### 9. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 10. Interior: Method + +The body of a method declaration + + + +#### 11. Interior: Static + +the body of a static statement + + + +#### 12. Interior: Switch + +The body of a switch statement + + + +#### 13. Interior: Switch case + +The body of a switch case branch + + + + + +#### 14. Interior: Try + +The body of a try/catch/finally branch + + + +#### 15. Interior: While + +The body of a while loop + + + +### Pair delimiter + +#### 1. Pair delimiter + +Internally used to add additional language specific surrounding pair delimiters in addition to the text based definitions. eg `r"`. + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: Element + +Internally used text fragment consisting of a xml element interior + + + + + +#### 4. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 5. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/javascriptreact.mdx b/packages/app-web-docs/src/docs/user/languages/javascriptreact.mdx index 8d837d8dd6c..034da079c0f 100644 --- a/packages/app-web-docs/src/docs/user/languages/javascriptreact.mdx +++ b/packages/app-web-docs/src/docs/user/languages/javascriptreact.mdx @@ -1,5 +1,1559 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # JavaScript React - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + + + + + +### Argument list + +#### 1. Argument list: Actual constructor empty + +An empty list of arguments in a constructor call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual constructor multi line + +A multi line list of arguments in a constructor call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual constructor single line + +A single line list of arguments in a constructor call + + + +#### 4. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 5. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 6. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 7. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 8. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 9. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 10. Argument list: Formal constructor empty + +An empty list of parameters in a constructor declaration. Insertion delimiter should be empty. + + + +#### 11. Argument list: Formal constructor multi line + +A multi line list of parameters in a constructor declaration. Insertion delimiter should include new line. + + + +#### 12. Argument list: Formal constructor single line + +A single line list of parameters in a constructor declaration + + + +#### 13. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 14. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + + + +#### 15. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + + + +#### 16. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + + + +#### 17. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + + + + + + + + + + + + + + + +#### 18. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 19. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 20. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 21. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual constructor multi line + +A multi line argument in a constructor call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual constructor single line + +A single line argument in a constructor call + + + +#### 3. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual method single line + +A single line argument in a method call + + + +#### 5. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument: Actual single line + +A single line argument in a function call + + + +#### 7. Argument: Formal catch + +A parameter in a catch clause + + + +#### 8. Argument: Formal constructor multi line + +A multi line parameter in a constructor declaration. Insertion delimiter should include new line. + + + +#### 9. Argument: Formal constructor single line + +A single line parameter in a constructor declaration + + + +#### 10. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 11. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + + + +#### 12. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 13. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 14. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 15. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 16. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 17. Argument: Actual constructor (iteration) + +Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. + + + +#### 18. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 19. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 20. Argument: Formal constructor (iteration) + +Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. + + + +#### 21. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + + + +#### 22. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + + + + + + + + + + + + + + + +### Attribute + +#### 1. Attribute + +A attribute, eg of a html element or a C++ attribute + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: Ternary + +A branch in a ternary expression + + + +#### 6. Branch: Try + +A try/catch/finally branch + + + +#### 7. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 8. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 9. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +#### 10. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + + + + + +#### 2. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + + + +#### 3. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Collection key + +#### 1. Key: Attribute + +Key (LHS) of an attribute eg in a xml element + + + + + +#### 2. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + + + +#### 3. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: Do while + +A condition in a do while loop + + + +#### 2. Condition: For + +A condition in a for loop + + + +#### 3. Condition: If + +A condition in an if statement + + + +#### 4. Condition: Switch case + +A condition in a switch statement + + + +#### 5. Condition: Ternary + +A condition in a ternary expression + + + +#### 6. Condition: While + +A condition in a while loop + + + +#### 7. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Constructor + +A constructor call + + + +#### 4. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Constructor + +The class being constructed in a class instantiation, including the `new` keyword. + + + +#### 4. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + +### Map + +#### 1. Map + +A map/dictionary + + + + + +### Name + +#### 1. Name: Argument catch + +Name of a parameter in a catch clause + + + +#### 2. Name: Argument formal + +Name of a parameter in a function declaration + + + + + +#### 3. Name: Argument formal constructor + +The name of a parameter in a constructor declaration + + + +#### 4. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 5. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 6. Name: Assignment + +Name (LHS) of an assignment + + + +#### 7. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 8. Name: Assignment destructuring + +LHS of an assignment with pattern destructuring + + + +#### 9. Name: Class + +Name of a class + + + + + + + +#### 10. Name: Constant + +Name (LHS) of a constant declaration + + + +#### 11. Name: Constructor + +Name of a constructor + + + +#### 12. Name: Field class + +Name (LHS) of a field in a class + + + +#### 13. Name: Foreach + +Iteration variable name in a for each loop + + + + + +#### 14. Name: Function + +Name of a function + + + + + + + + + + + + + + + + + + + + + + + + + +#### 15. Name: Method + +Name of a class method + + + + + + + + + + + + + + + + + +#### 16. Name: Variable destructuring + +Name (LHS) of a variable declaration with pattern destructuring + + + +#### 17. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 18. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + +#### 19. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 20. Name (iteration class) + +Iteration scope for names: class bodies. + + + +#### 21. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 22. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 23. Name: Argument formal constructor (iteration) + +Iteration scope for names of formal parameters in a constructor declaration: the parameters list. + + + +#### 24. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 25. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 2. Named function: Constructor + +A constructor declaration in a class + + + +#### 3. Named function: Method + +A named method declaration in a class + + + + + + + + + + + + + + + + + +#### 4. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 5. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Regular expression + +#### 1. Regular expression + +A regular expression + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Assignment destructuring + +An assignment statement with pattern destructuring + + + +#### 4. Statement: Break + +A break statement + + + +#### 5. Statement: Class + +A class/struct declaration + + + + + + + +#### 6. Statement: Constant + +A constant declaration + + + +#### 7. Statement: Constructor + +A constructor declaration + + + +#### 8. Statement: Continue + +A continue statement + + + +#### 9. Statement: Do while + +A do-while loop statement + + + +#### 10. Statement: Field class + +A field declaration in a class/struct + + + +#### 11. Statement: For + +A for loop statement + + + +#### 12. Statement: Foreach + +A for-each loop statement + + + + + +#### 13. Statement: Function + +A named function declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 14. Statement: Function call + +A function call statement + + + +#### 15. Statement: If + +A if/elif/else statement + + + +#### 16. Statement: Import + +An import statement + + + +#### 17. Statement: Method + +A method declaration + + + + + + + + + + + + + + + + + +#### 18. Statement: Return + +A return statement + + + +#### 19. Statement: Static + +A static statement + + + +#### 20. Statement: Switch + +A switch statement + + + +#### 21. Statement: Throw + +A throw statement + + + +#### 22. Statement: Try + +A try/catch/finally statement + + + +#### 23. Statement: Update + +An update statement, eg ++/-- + + + + + +#### 24. Statement: Variable destructuring + +A variable declaration pattern destructuring + + + +#### 25. Statement: Variable initialized + +An initialized variable declaration + + + +#### 26. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 27. Statement: While + +A while loop statement + + + +#### 28. Statement: Yield + +A yield statement + + + +#### 29. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 30. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + +#### 31. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Value + +#### 1. Value: Argument formal + +The (default) value of a argument in a function declaration + + + +#### 2. Value: Argument formal constructor + +The (default) value of a parameter in a constructor declaration + + + +#### 3. Value: Argument formal lambda + +The (default) value of a parameter in a lambda declaration + + + +#### 4. Value: Argument formal method + +The (default) value of a parameter in a method declaration + + + +#### 5. Value: Assignment + +Value (RHS) of an assignment + + + + + +#### 6. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 7. Value: Assignment destructuring + +Value (RHS) of an assignment with pattern destructuring + + + +#### 8. Value: Attribute + +Value (RHS) of an attribute eg in a xml element + + + +#### 9. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 10. Value: Field class + +Value (RHS) of a field in a class + + + +#### 11. Value: Foreach + +Iterable in a for each loop + + + + + +#### 12. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + + + +#### 13. Value: Return + +Return value of a function + + + +#### 14. Value: Return lambda + +Implicit return value from a lambda + + + +#### 15. Value: Switch + +The value / subject of a switch statement + + + +#### 16. Value: Throw + +Value of a throw statement + + + +#### 17. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 18. Value: Variable destructuring + +Value (RHS) of a variable declaration with pattern destructuring + + + +#### 19. Value: Yield + +Value of a yield statement + + + +#### 20. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 21. Value (iteration class) + +Iteration scope for values: class bodies. + + + +#### 22. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 23. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 24. Value: Argument formal constructor (iteration) + +Iteration scope for values of formal parameters in a constructor declaration: the parameters list. + + + +#### 25. Value: Argument formal lambda (iteration) + +Iteration scope for values of formal parameters in a lambda declaration: the parameters list. + + + +#### 26. Value: Argument formal method (iteration) + +Iteration scope for values of formal parameters in a method declaration: the parameters list. + + + +#### 27. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + + + +### Xml both tags + +#### 1. Tags + +Both tags in a xml element + + + +### Xml element + +#### 1. Element + +A xml/html element. Also used for LaTeX environments + + + +### Xml end tag + +#### 1. End tag + +The end tag of a xml element + + + +### Xml start tag + +#### 1. Start tag + +The start tag of a xml element + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + +#### 2. Interior: Constructor + +The body of a constructor declaration + + + +#### 3. Interior: Do while + +The body of a do-while loop + + + +#### 4. Interior: Element + +The interior/children of a XML element + + + +#### 5. Interior: For + +The body of a for loop + + + +#### 6. Interior: Foreach + +The body of a for-each loop + + + + + +#### 7. Interior: Function + +The body of a function declaration + + + +#### 8. Interior: If + +The body of an if/elif/else branch + + + +#### 9. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 10. Interior: Method + +The body of a method declaration + + + +#### 11. Interior: Static + +the body of a static statement + + + +#### 12. Interior: Switch + +The body of a switch statement + + + +#### 13. Interior: Switch case + +The body of a switch case branch + + + + + +#### 14. Interior: Try + +The body of a try/catch/finally branch + + + +#### 15. Interior: While + +The body of a while loop + + + +### Pair delimiter + +#### 1. Pair delimiter + +Internally used to add additional language specific surrounding pair delimiters in addition to the text based definitions. eg `r"`. + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: Element + +Internally used text fragment consisting of a xml element interior + + + + + +#### 4. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 5. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/json.mdx b/packages/app-web-docs/src/docs/user/languages/json.mdx index 672c9165596..86b3cde83eb 100644 --- a/packages/app-web-docs/src/docs/user/languages/json.mdx +++ b/packages/app-web-docs/src/docs/user/languages/json.mdx @@ -1,5 +1,103 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # JSON - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### List + +#### 1. List + +A list/array + + + +### Map + +#### 1. Map + +A map/dictionary + + + +### Value + +#### 1. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 2. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### String + +#### 1. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/jsonc.mdx b/packages/app-web-docs/src/docs/user/languages/jsonc.mdx index 5d1037816ea..19486134105 100644 --- a/packages/app-web-docs/src/docs/user/languages/jsonc.mdx +++ b/packages/app-web-docs/src/docs/user/languages/jsonc.mdx @@ -1,9 +1,103 @@ ---- -sidebar_label: JSONC ---- - -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # JSON with comments (JSONC) - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### List + +#### 1. List + +A list/array + + + +### Map + +#### 1. Map + +A map/dictionary + + + +### Value + +#### 1. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 2. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### String + +#### 1. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/jsonl.mdx b/packages/app-web-docs/src/docs/user/languages/jsonl.mdx index 73a70602b3c..231119ea05c 100644 --- a/packages/app-web-docs/src/docs/user/languages/jsonl.mdx +++ b/packages/app-web-docs/src/docs/user/languages/jsonl.mdx @@ -1,9 +1,105 @@ ---- -sidebar_label: JSONL ---- - -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # JSON lines (JSONL) - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### List + +#### 1. List + +A list/array + + + +### Map + +#### 1. Map + +A map/dictionary + + + + + +### Value + +#### 1. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 2. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### String + +#### 1. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/kotlin.mdx b/packages/app-web-docs/src/docs/user/languages/kotlin.mdx index 470cd1c90f7..ce64eee62ca 100644 --- a/packages/app-web-docs/src/docs/user/languages/kotlin.mdx +++ b/packages/app-web-docs/src/docs/user/languages/kotlin.mdx @@ -1,5 +1,1635 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Kotlin - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + +### Argument list + +#### 1. Argument list: Actual constructor empty + +An empty list of arguments in a constructor call. Insertion delimiter should be empty. + + + + + +#### 2. Argument list: Actual constructor multi line + +A multi line list of arguments in a constructor call. Insertion delimiter should include new line. + + + + + +#### 3. Argument list: Actual constructor single line + +A single line list of arguments in a constructor call + + + + + +#### 4. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 5. Argument list: Actual enum empty + +An empty list of arguments in an enum constructor call. Insertion delimiter should be empty. + + + +#### 6. Argument list: Actual enum multi line + +A multi line list of arguments in an enum constructor call. Insertion delimiter should include new line. + + + +#### 7. Argument list: Actual enum single line + +A single line list of arguments in an enum constructor call + + + +#### 8. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 9. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 10. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 11. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 12. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 13. Argument list: Formal constructor empty + +An empty list of parameters in a constructor declaration. Insertion delimiter should be empty. + + + +#### 14. Argument list: Formal constructor multi line + +A multi line list of parameters in a constructor declaration. Insertion delimiter should include new line. + + + + + +#### 15. Argument list: Formal constructor single line + +A single line list of parameters in a constructor declaration + + + + + +#### 16. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + +#### 17. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + +#### 18. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + +#### 19. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + +#### 20. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + +#### 21. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 22. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 23. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 24. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual constructor multi line + +A multi line argument in a constructor call. Insertion delimiter should include new line. + + + + + +#### 2. Argument: Actual constructor single line + +A single line argument in a constructor call + + + + + +#### 3. Argument: Actual enum multi line + +A multi line argument in an enum constructor call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual enum single line + +A single line argument in an enum constructor call + + + +#### 5. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 6. Argument: Actual method single line + +A single line argument in a method call + + + +#### 7. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 8. Argument: Actual single line + +A single line argument in a function call + + + + + +#### 9. Argument: Formal catch + +A parameter in a catch clause + + + +#### 10. Argument: Formal constructor multi line + +A multi line parameter in a constructor declaration. Insertion delimiter should include new line. + + + + + +#### 11. Argument: Formal constructor single line + +A single line parameter in a constructor declaration + + + + + +#### 12. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 13. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + +#### 14. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 15. Argument: Formal method single line + +A single line parameter in a class method declaration + + + + + +#### 16. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 17. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 18. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 19. Argument: Actual constructor (iteration) + +Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. + + + + + +#### 20. Argument: Actual enum (iteration) + +Iteration scope for arguments in an enum constructor call: the argument list. The domain should be the entire enum constructor call.. + + + +#### 21. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 22. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + +#### 23. Argument: Formal constructor (iteration) + +Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. + + + + + +#### 24. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + +#### 25. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: Ternary + +A branch in a ternary expression + + + +#### 6. Branch: Try + +A try/catch/finally branch + + + +#### 7. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 8. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 9. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +#### 10. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + + + + + + + +#### 2. Class (iteration class) + +Iteration scope for classes: class bodies. + + + +#### 3. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: Do while + +A condition in a do while loop + + + +#### 2. Condition: If + +A condition in an if statement + + + +#### 3. Condition: Switch case + +A condition in a switch statement + + + + + +#### 4. Condition: Ternary + +A condition in a ternary expression + + + +#### 5. Condition: While + +A condition in a while loop + + + +#### 6. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Constructor + +A constructor call + + + + + + + +#### 4. Function call: Enum + +An enum constructor call + + + +#### 5. Function call: Generic + +A function call with generic type arguments + + + +#### 6. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Constructor + +The class being constructed in a class instantiation, including the `new` keyword. + + + + + + + +#### 4. Function callee: Enum + +The enum constructor being called + + + +#### 5. Function callee: Generic + +The function being called in a function call with generic type arguments + + + +#### 6. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### Name + +#### 1. Name: Argument actual + +Name of a (keyword) argument in a function call + + + +#### 2. Name: Argument catch + +Name of a parameter in a catch clause + + + +#### 3. Name: Argument formal + +Name of a parameter in a function declaration + + + + + +#### 4. Name: Argument formal constructor + +The name of a parameter in a constructor declaration + + + + + + + + + +#### 5. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 6. Name: Argument formal method + +Name of a parameter in a class method declaration + + + + + + + +#### 7. Name: Assignment + +Name (LHS) of an assignment + + + +#### 8. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 9. Name: Class + +Name of a class + + + + + + + +#### 10. Name: Constant + +Name (LHS) of a constant declaration + + + +#### 11. Name: Constructor + +Name of a constructor + + + +#### 12. Name: Enum + +Name of an enum + + + +#### 13. Name: Field class + +Name (LHS) of a field in a class + + + +#### 14. Name: Field enum + +Name (LHS) of a field in an enum + + + +#### 15. Name: Field interface + +Name (LHS) of a field in an interface + + + +#### 16. Name: Foreach + +Iteration variable name in a for each loop + + + +#### 17. Name: Function + +Name of a function + + + +#### 18. Name: Interface + +Name of a interface + + + +#### 19. Name: Method + +Name of a class method + + + +#### 20. Name: Method interface + +Name of a interface method + + + +#### 21. Name: Type alias + +Name of a type alias + + + +#### 22. Name: Variable destructuring + +Name (LHS) of a variable declaration with pattern destructuring + + + +#### 23. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 24. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + +#### 25. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 26. Name (iteration class) + +Iteration scope for names: class bodies. + + + +#### 27. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 28. Name (iteration enum) + +Iteration scope for names: enum bodies. + + + +#### 29. Name (iteration interface) + +Iteration scope for names: interface bodies. + + + +#### 30. Name: Argument actual (iteration) + +Iteration scope for names of (keyword) arguments in a function call: the argument list. + + + +#### 31. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 32. Name: Argument formal constructor (iteration) + +Iteration scope for names of formal parameters in a constructor declaration: the parameters list. + + + + + +#### 33. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 34. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + + + +#### 2. Named function: Constructor + +A constructor declaration in a class + + + + + +#### 3. Named function: Method + +A named method declaration in a class + + + + + + + + + +#### 4. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 5. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Break + +A break statement + + + +#### 4. Statement: Class + +A class/struct declaration + + + + + + + +#### 5. Statement: Constant + +A constant declaration + + + +#### 6. Statement: Constructor + +A constructor declaration + + + + + +#### 7. Statement: Continue + +A continue statement + + + +#### 8. Statement: Do while + +A do-while loop statement + + + +#### 9. Statement: Enum + +An enum declaration + + + +#### 10. Statement: Field class + +A field declaration in a class/struct + + + +#### 11. Statement: Field interface + +A field declaration in a interface + + + +#### 12. Statement: Foreach + +A for-each loop statement + + + +#### 13. Statement: Function + +A named function declaration + + + +#### 14. Statement: Function call + +A function call statement + + + +#### 15. Statement: If + +A if/elif/else statement + + + +#### 16. Statement: Import + +An import statement + + + +#### 17. Statement: Interface + +An interface declaration + + + +#### 18. Statement: Method + +A method declaration + + + + + + + + + +#### 19. Statement: Method interface + +A method declaration in a interface + + + +#### 20. Statement: Package + +A package declaration + + + +#### 21. Statement: Return + +A return statement + + + +#### 22. Statement: Static + +A static statement + + + +#### 23. Statement: Switch + +A switch statement + + + +#### 24. Statement: Throw + +A throw statement + + + +#### 25. Statement: Try + +A try/catch/finally statement + + + +#### 26. Statement: Type alias + +A type alias declaration + + + +#### 27. Statement: Update + +An update statement, eg ++/-- + + + + + +#### 28. Statement: Variable destructuring + +A variable declaration pattern destructuring + + + +#### 29. Statement: Variable initialized + +An initialized variable declaration + + + +#### 30. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 31. Statement: While + +A while loop statement + + + +#### 32. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 33. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + +#### 34. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +#### 35. Statement (iteration interface) + +Iteration scope for statements: interface bodies. + + + +### Type + +#### 1. Type: Alias + +A type alias declaration + + + +#### 2. Type: Argument catch + +Type of a parameter in a catch clause + + + +#### 3. Type: Argument formal + +Type of a formal parameter in a function declaration + + + + + +#### 4. Type: Argument formal constructor + +Type of a formal parameter in a constructor declaration + + + + + +#### 5. Type: Argument formal lambda + +Type of a formal parameter in a lambda declaration + + + +#### 6. Type: Argument formal method + +Type of a formal parameter in a class method declaration + + + + + +#### 7. Type: Class + +A class declaration + + + + + + + +#### 8. Type: Constant + +Type of a constant declaration + + + +#### 9. Type: Enum + +An enum declaration + + + +#### 10. Type: Field class + +Type of a field in a class + + + +#### 11. Type: Field interface + +Type of a field in a interface + + + +#### 12. Type: Foreach + +Type of a variable in a for each loop + + + +#### 13. Type: Interface + +An interface declaration + + + +#### 14. Type: Return + +Type of a return value in a function declaration + + + + + + + + + + + +#### 15. Type: Return method + +Type of a return value in a method declaration + + + +#### 16. Type: Type argument + +Type argument to a generic / parametrized type + + + +#### 17. Type: Variable initialized + +Type of an initialized variable declaration + + + + + +#### 18. Type: Variable uninitialized + +Type of an uninitialized variable declaration + + + + + + + +#### 19. Type (iteration block) + +Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 20. Type (iteration class) + +Iteration scope for types: class bodies. + + + +#### 21. Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + + + +#### 22. Type (iteration interface) + +Iteration scope for types: interface bodies. + + + +#### 23. Type: Argument formal (iteration) + +Iteration scope for types of formal parameters in a function declaration: the parameters list. + + + +#### 24. Type: Argument formal constructor (iteration) + +Iteration scope for types of formal parameters in a constructor declaration: the parameters list. + + + + + +#### 25. Type: Argument formal lambda (iteration) + +Iteration scope for types of formal parameters in a lambda declaration: the parameters list. + + + +#### 26. Type: Argument formal method (iteration) + +Iteration scope for types of formal parameters in a method declaration: the parameters list. + + + +#### 27. Type: Type argument (iteration) + +Iteration scope for type arguments to a generic / parametrized type: the type argument list. + + + +### Value + +#### 1. Value: Argument actual + +The value of a (keyword) argument in a function call + + + +#### 2. Value: Argument formal + +The (default) value of a argument in a function declaration + + + +#### 3. Value: Argument formal constructor + +The (default) value of a parameter in a constructor declaration + + + + + +#### 4. Value: Argument formal method + +The (default) value of a parameter in a method declaration + + + +#### 5. Value: Assignment + +Value (RHS) of an assignment + + + +#### 6. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 7. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 8. Value: Field class + +Value (RHS) of a field in a class + + + +#### 9. Value: Foreach + +Iterable in a for each loop + + + +#### 10. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 11. Value: Return + +Return value of a function + + + +#### 12. Value: Return lambda + +Implicit return value from a lambda + + + + + + + +#### 13. Value: Switch + +The value / subject of a switch statement + + + + + + + +#### 14. Value: Throw + +Value of a throw statement + + + +#### 15. Value: Type alias + +Value of a type alias declaration + + + + + +#### 16. Value: Variable + +Value (RHS) of a variable declaration + + + + + + + + + + + +#### 17. Value: Variable destructuring + +Value (RHS) of a variable declaration with pattern destructuring + + + +#### 18. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 19. Value (iteration class) + +Iteration scope for values: class bodies. + + + +#### 20. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 21. Value: Argument actual (iteration) + +Iteration scope for values of (keyword) arguments in a function call: the arguments list. + + + +#### 22. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 23. Value: Argument formal constructor (iteration) + +Iteration scope for values of formal parameters in a constructor declaration: the parameters list. + + + + + +#### 24. Value: Argument formal method (iteration) + +Iteration scope for values of formal parameters in a method declaration: the parameters list. + + + +#### 25. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + +#### 2. Interior: Constructor + +The body of a constructor declaration + + + +#### 3. Interior: Do while + +The body of a do-while loop + + + +#### 4. Interior: Enum + +The body of an enum + + + +#### 5. Interior: For + +The body of a for loop + + + +#### 6. Interior: Foreach + +The body of a for-each loop + + + +#### 7. Interior: Function + +The body of a function declaration + + + +#### 8. Interior: If + +The body of an if/elif/else branch + + + +#### 9. Interior: Interface + +The body of a interface + + + +#### 10. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 11. Interior: Method + +The body of a method declaration + + + +#### 12. Interior: Static + +the body of a static statement + + + +#### 13. Interior: Switch + +The body of a switch statement + + + +#### 14. Interior: Switch case + +The body of a switch case branch + + + + + +#### 15. Interior: Try + +The body of a try/catch/finally branch + + + +#### 16. Interior: While + +The body of a while loop + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 4. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/latex.mdx b/packages/app-web-docs/src/docs/user/languages/latex.mdx index 4ec19bb54eb..d356e7b6a80 100644 --- a/packages/app-web-docs/src/docs/user/languages/latex.mdx +++ b/packages/app-web-docs/src/docs/user/languages/latex.mdx @@ -1,5 +1,187 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Latex - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Argument or parameter + +#### 1. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual single line + +A single line argument in a function call + + + +#### 3. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### Environment + +#### 1. Environment + +An environment, eg in LaTeX + + + +### Function call + +#### 1. Function call + +A function call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +### List + +#### 1. List + +A list/array + + + +### Section + +#### 1. Section + +A document section + + + +#### 2. Section (iteration document) + +Iteration scope for sections: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Function call + +A function call statement + + + +### Xml both tags + +#### 1. Tags + +Both tags in a xml element + + + +### Xml element + +#### 1. Element + +A xml/html element. Also used for LaTeX environments + + + +### Xml end tag + +#### 1. End tag + +The end tag of a xml element + + + +### Xml start tag + +#### 1. Start tag + +The start tag of a xml element + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Element + +The interior/children of a XML element + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: Element + +Internally used text fragment consisting of a xml element interior + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/lua.mdx b/packages/app-web-docs/src/docs/user/languages/lua.mdx index 2523a1c764c..654a8c13896 100644 --- a/packages/app-web-docs/src/docs/user/languages/lua.mdx +++ b/packages/app-web-docs/src/docs/user/languages/lua.mdx @@ -1,5 +1,779 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Lua - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + +### Argument list + +#### 1. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 3. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 5. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 7. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + +#### 8. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + +#### 9. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + +#### 10. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + +#### 11. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + +#### 12. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 13. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 14. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 15. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual method single line + +A single line argument in a method call + + + +#### 3. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual single line + +A single line argument in a function call + + + +#### 5. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 6. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + +#### 7. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 8. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 9. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 10. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 11. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 12. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 13. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + +#### 14. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + +#### 15. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + + + +#### 3. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: Do while + +A condition in a do while loop + + + +#### 2. Condition: For + +A condition in a for loop + + + +#### 3. Condition: If + +A condition in an if statement + + + +#### 4. Condition: While + +A condition in a while loop + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + + + +#### 3. Function call: Method + +A method call + + + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + + + +#### 3. Function callee: Method + +The function being called in a method call, including parent objects. + + + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + +### Map + +#### 1. Map + +A map/dictionary + + + +### Name + +#### 1. Name: Argument formal + +Name of a parameter in a function declaration + + + +#### 2. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 3. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 4. Name: Assignment + +Name (LHS) of an assignment + + + + + +#### 5. Name: Assignment destructuring + +LHS of an assignment with pattern destructuring + + + +#### 6. Name: Foreach + +Iteration variable name in a for each loop + + + +#### 7. Name: Function + +Name of a function + + + +#### 8. Name: Method + +Name of a class method + + + +#### 9. Name: Variable destructuring + +Name (LHS) of a variable declaration with pattern destructuring + + + +#### 10. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 11. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + +#### 12. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 13. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 14. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 15. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 16. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + +#### 2. Named function: Method + +A named method declaration in a class + + + +#### 3. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment destructuring + +An assignment statement with pattern destructuring + + + +#### 3. Statement: Break + +A break statement + + + +#### 4. Statement: Do while + +A do-while loop statement + + + +#### 5. Statement: For + +A for loop statement + + + +#### 6. Statement: Foreach + +A for-each loop statement + + + +#### 7. Statement: Function + +A named function declaration + + + +#### 8. Statement: Function call + +A function call statement + + + +#### 9. Statement: If + +A if/elif/else statement + + + +#### 10. Statement: Method + +A method declaration + + + +#### 11. Statement: Return + +A return statement + + + +#### 12. Statement: Variable destructuring + +A variable declaration pattern destructuring + + + +#### 13. Statement: Variable initialized + +An initialized variable declaration + + + +#### 14. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 15. Statement: While + +A while loop statement + + + +#### 16. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 17. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Value + +#### 1. Value: Assignment + +Value (RHS) of an assignment + + + + + +#### 2. Value: Assignment destructuring + +Value (RHS) of an assignment with pattern destructuring + + + +#### 3. Value: Foreach + +Iterable in a for each loop + + + +#### 4. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 5. Value: Return + +Return value of a function + + + +#### 6. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 7. Value: Variable destructuring + +Value (RHS) of a variable declaration with pattern destructuring + + + +#### 8. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 9. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 10. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Do while + +The body of a do-while loop + + + +#### 2. Interior: For + +The body of a for loop + + + +#### 3. Interior: Foreach + +The body of a for-each loop + + + +#### 4. Interior: Function + +The body of a function declaration + + + +#### 5. Interior: If + +The body of an if/elif/else branch + + + +#### 6. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 7. Interior: Method + +The body of a method declaration + + + +#### 8. Interior: While + +The body of a while loop + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 4. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/markdown.mdx b/packages/app-web-docs/src/docs/user/languages/markdown.mdx index a546f6910a9..83c834ec4a6 100644 --- a/packages/app-web-docs/src/docs/user/languages/markdown.mdx +++ b/packages/app-web-docs/src/docs/user/languages/markdown.mdx @@ -1,5 +1,95 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Markdown - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +### List + +#### 1. List + +A list/array + + + +### Notebook cell + +#### 1. Notebook cell + +A cell in a notebook or a markdown code block + + + + + +### Section + +#### 1. Section + +A document section + + + +#### 2. Section (iteration document) + +Iteration scope for sections: the entire document including leading and trailing empty lines. + + + +#### 3. Section (iteration parent) + +Iteration scope for sections: the parent section. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Interior + +#### 1. Interior: Cell + +The body of a code cell in markdown + + + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/php.mdx b/packages/app-web-docs/src/docs/user/languages/php.mdx index 7b627d3cd4d..40534bfdec1 100644 --- a/packages/app-web-docs/src/docs/user/languages/php.mdx +++ b/packages/app-web-docs/src/docs/user/languages/php.mdx @@ -1,5 +1,1421 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # PHP - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + +### Argument list + +#### 1. Argument list: Actual constructor empty + +An empty list of arguments in a constructor call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual constructor multi line + +A multi line list of arguments in a constructor call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual constructor single line + +A single line list of arguments in a constructor call + + + +#### 4. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 5. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 6. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 7. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 8. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 9. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 10. Argument list: Formal constructor empty + +An empty list of parameters in a constructor declaration. Insertion delimiter should be empty. + + + +#### 11. Argument list: Formal constructor multi line + +A multi line list of parameters in a constructor declaration. Insertion delimiter should include new line. + + + +#### 12. Argument list: Formal constructor single line + +A single line list of parameters in a constructor declaration + + + +#### 13. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + +#### 14. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + + + +#### 15. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + + + +#### 16. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + + + +#### 17. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + +#### 18. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 19. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 20. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 21. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual constructor multi line + +A multi line argument in a constructor call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual constructor single line + +A single line argument in a constructor call + + + +#### 3. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual method single line + +A single line argument in a method call + + + +#### 5. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument: Actual single line + +A single line argument in a function call + + + +#### 7. Argument: Formal catch + +A parameter in a catch clause + + + +#### 8. Argument: Formal constructor multi line + +A multi line parameter in a constructor declaration. Insertion delimiter should include new line. + + + +#### 9. Argument: Formal constructor single line + +A single line parameter in a constructor declaration + + + +#### 10. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 11. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + +#### 12. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 13. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 14. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 15. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 16. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 17. Argument: Actual constructor (iteration) + +Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. + + + +#### 18. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 19. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + +#### 20. Argument: Formal constructor (iteration) + +Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. + + + +#### 21. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + +#### 22. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: Ternary + +A branch in a ternary expression + + + +#### 6. Branch: Try + +A try/catch/finally branch + + + +#### 7. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 8. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 9. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +#### 10. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + +#### 2. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + + + +### Condition + +#### 1. Condition: Do while + +A condition in a do while loop + + + +#### 2. Condition: For + +A condition in a for loop + + + +#### 3. Condition: If + +A condition in an if statement + + + +#### 4. Condition: Switch case + +A condition in a switch statement + + + +#### 5. Condition: Ternary + +A condition in a ternary expression + + + +#### 6. Condition: While + +A condition in a while loop + + + +#### 7. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Constructor + +A constructor call + + + +#### 4. Function call: Method + +A method call + + + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Constructor + +The class being constructed in a class instantiation, including the `new` keyword. + + + +#### 4. Function callee: Method + +The function being called in a method call, including parent objects. + + + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + +### Map + +#### 1. Map + +A map/dictionary + + + +### Name + +#### 1. Name: Argument actual + +Name of a (keyword) argument in a function call + + + +#### 2. Name: Argument catch + +Name of a parameter in a catch clause + + + +#### 3. Name: Argument formal + +Name of a parameter in a function declaration + + + + + +#### 4. Name: Argument formal constructor + +The name of a parameter in a constructor declaration + + + +#### 5. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 6. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 7. Name: Assignment + +Name (LHS) of an assignment + + + + + +#### 8. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 9. Name: Class + +Name of a class + + + +#### 10. Name: Constructor + +Name of a constructor + + + +#### 11. Name: Enum + +Name of an enum + + + +#### 12. Name: Field class + +Name (LHS) of a field in a class + + + +#### 13. Name: Field enum + +Name (LHS) of a field in an enum + + + +#### 14. Name: Field interface + +Name (LHS) of a field in an interface + + + +#### 15. Name: Foreach + +Iteration variable name in a for each loop + + + +#### 16. Name: Function + +Name of a function + + + +#### 17. Name: Interface + +Name of a interface + + + +#### 18. Name: Method + +Name of a class method + + + +#### 19. Name: Method interface + +Name of a interface method + + + +#### 20. Name: Namespace + +Name of a namespace + + + +#### 21. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 22. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 23. Name (iteration class) + +Iteration scope for names: class bodies. + + + +#### 24. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 25. Name (iteration enum) + +Iteration scope for names: enum bodies. + + + +#### 26. Name (iteration interface) + +Iteration scope for names: interface bodies. + + + +#### 27. Name: Argument actual (iteration) + +Iteration scope for names of (keyword) arguments in a function call: the argument list. + + + +#### 28. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 29. Name: Argument formal constructor (iteration) + +Iteration scope for names of formal parameters in a constructor declaration: the parameters list. + + + +#### 30. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 31. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + + + + + +#### 2. Named function: Constructor + +A constructor declaration in a class + + + +#### 3. Named function: Method + +A named method declaration in a class + + + +#### 4. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 5. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Break + +A break statement + + + +#### 4. Statement: Class + +A class/struct declaration + + + +#### 5. Statement: Constructor + +A constructor declaration + + + +#### 6. Statement: Continue + +A continue statement + + + +#### 7. Statement: Do while + +A do-while loop statement + + + +#### 8. Statement: Enum + +An enum declaration + + + +#### 9. Statement: Field class + +A field declaration in a class/struct + + + +#### 10. Statement: Field interface + +A field declaration in a interface + + + + + +#### 11. Statement: For + +A for loop statement + + + +#### 12. Statement: Foreach + +A for-each loop statement + + + +#### 13. Statement: Function + +A named function declaration + + + +#### 14. Statement: Function call + +A function call statement + + + +#### 15. Statement: If + +A if/elif/else statement + + + +#### 16. Statement: Import + +An import statement + + + +#### 17. Statement: Interface + +An interface declaration + + + +#### 18. Statement: Method + +A method declaration + + + +#### 19. Statement: Method interface + +A method declaration in a interface + + + +#### 20. Statement: Namespace + +A namespace declaration + + + +#### 21. Statement: Return + +A return statement + + + +#### 22. Statement: Switch + +A switch statement + + + +#### 23. Statement: Throw + +A throw statement + + + +#### 24. Statement: Try + +A try/catch/finally statement + + + +#### 25. Statement: Update + +An update statement, eg ++/-- + + + +#### 26. Statement: Variable initialized + +An initialized variable declaration + + + +#### 27. Statement: While + +A while loop statement + + + +#### 28. Statement: Yield + +A yield statement + + + +#### 29. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 30. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + +#### 31. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +#### 32. Statement (iteration interface) + +Iteration scope for statements: interface bodies. + + + +### Type + +#### 1. Type: Argument catch + +Type of a parameter in a catch clause + + + +#### 2. Type: Argument formal + +Type of a formal parameter in a function declaration + + + + + +#### 3. Type: Argument formal constructor + +Type of a formal parameter in a constructor declaration + + + +#### 4. Type: Argument formal lambda + +Type of a formal parameter in a lambda declaration + + + +#### 5. Type: Argument formal method + +Type of a formal parameter in a class method declaration + + + +#### 6. Type: Cast + +A type cast + + + +#### 7. Type: Class + +A class declaration + + + +#### 8. Type: Enum + +An enum declaration + + + +#### 9. Type: Field class + +Type of a field in a class + + + +#### 10. Type: Field interface + +Type of a field in a interface + + + +#### 11. Type: Interface + +An interface declaration + + + +#### 12. Type: Return + +Type of a return value in a function declaration + + + +#### 13. Type: Return lambda + +Type of a return value in a lambda declaration + + + + + +#### 14. Type: Return method + +Type of a return value in a method declaration + + + +#### 15. Type (iteration class) + +Iteration scope for types: class bodies. + + + +#### 16. Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + + + +#### 17. Type (iteration interface) + +Iteration scope for types: interface bodies. + + + +#### 18. Type: Argument formal (iteration) + +Iteration scope for types of formal parameters in a function declaration: the parameters list. + + + +#### 19. Type: Argument formal constructor (iteration) + +Iteration scope for types of formal parameters in a constructor declaration: the parameters list. + + + +#### 20. Type: Argument formal lambda (iteration) + +Iteration scope for types of formal parameters in a lambda declaration: the parameters list. + + + +#### 21. Type: Argument formal method (iteration) + +Iteration scope for types of formal parameters in a method declaration: the parameters list. + + + +### Value + +#### 1. Value: Argument actual + +The value of a (keyword) argument in a function call + + + +#### 2. Value: Argument formal + +The (default) value of a argument in a function declaration + + + +#### 3. Value: Argument formal constructor + +The (default) value of a parameter in a constructor declaration + + + +#### 4. Value: Argument formal lambda + +The (default) value of a parameter in a lambda declaration + + + +#### 5. Value: Argument formal method + +The (default) value of a parameter in a method declaration + + + +#### 6. Value: Assignment + +Value (RHS) of an assignment + + + + + +#### 7. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 8. Value: Field class + +Value (RHS) of a field in a class + + + +#### 9. Value: Field enum + +Value (RHS) of a field in an enum + + + +#### 10. Value: Field interface + +Value (RHS) of a field in an interface + + + +#### 11. Value: Foreach + +Iterable in a for each loop + + + +#### 12. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 13. Value: Return + +Return value of a function + + + +#### 14. Value: Return lambda + +Implicit return value from a lambda + + + +#### 15. Value: Switch + +The value / subject of a switch statement + + + +#### 16. Value: Throw + +Value of a throw statement + + + +#### 17. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 18. Value: Yield + +Value of a yield statement + + + +#### 19. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 20. Value (iteration class) + +Iteration scope for values: class bodies. + + + +#### 21. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 22. Value (iteration enum) + +Iteration scope for values: enum bodies. + + + +#### 23. Value: Argument actual (iteration) + +Iteration scope for values of (keyword) arguments in a function call: the arguments list. + + + +#### 24. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 25. Value: Argument formal constructor (iteration) + +Iteration scope for values of formal parameters in a constructor declaration: the parameters list. + + + +#### 26. Value: Argument formal lambda (iteration) + +Iteration scope for values of formal parameters in a lambda declaration: the parameters list. + + + +#### 27. Value: Argument formal method (iteration) + +Iteration scope for values of formal parameters in a method declaration: the parameters list. + + + +#### 28. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + +#### 2. Interior: Constructor + +The body of a constructor declaration + + + +#### 3. Interior: Do while + +The body of a do-while loop + + + +#### 4. Interior: Enum + +The body of an enum + + + +#### 5. Interior: For + +The body of a for loop + + + +#### 6. Interior: Foreach + +The body of a for-each loop + + + +#### 7. Interior: Function + +The body of a function declaration + + + +#### 8. Interior: If + +The body of an if/elif/else branch + + + +#### 9. Interior: Interface + +The body of a interface + + + +#### 10. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 11. Interior: Method + +The body of a method declaration + + + +#### 12. Interior: Namespace + +the body of a namespace statement + + + +#### 13. Interior: Switch + +The body of a switch statement + + + +#### 14. Interior: Switch case + +The body of a switch case branch + + + + + +#### 15. Interior: Try + +The body of a try/catch/finally branch + + + +#### 16. Interior: While + +The body of a while loop + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 4. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/plaintext.mdx b/packages/app-web-docs/src/docs/user/languages/plaintext.mdx index c1df1f54126..8f19e943274 100644 --- a/packages/app-web-docs/src/docs/user/languages/plaintext.mdx +++ b/packages/app-web-docs/src/docs/user/languages/plaintext.mdx @@ -1,5 +1,399 @@ -import { Language } from "@site/src/docs/components/Language"; +import { + Scope, + ScopeVisualizerOptions, + ScopeVisualizerProvider, +} from "@site/src/docs/components/ScopeVisualizer"; # Plaintext - +{/* START GENERATED SCOPE VISUALIZER */} + + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Bounded non whitespace sequence + +#### 1. Bounded non whitespace sequence + +{"A sequence of non-whitespace characters bounded by matching pair"} + + + + + + + +#### 2. Bounded non whitespace sequence (iteration) + +{"Iteration scope for bounded non-whitespace sequence"} + + + +### Bounded paragraph + +#### 1. Bounded paragraph + + + { + "A single paragraph(contiguous block of lines) in the document bounded by matching pair" + } + + + + + + + + + + + + + + +#### 2. Bounded paragraph (iteration) + +{"Iteration scope for bounded paragraph"} + + + +### Character + +#### 1. Character + +{"A single character in the document"} + + + +### Collection item + +#### 1. Collection item: Textual + +{"A text based collection item"} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 2. Collection item: Textual (iteration) + +{"Iteration scope for text based collection items"} + + + + + + + + + + + + + + + +### Document + +#### 1. Document + +{"The entire document"} + + + +### Full line + +#### 1. Full line + + + { + "A single full line in the document. Includes leading and trailing whitespace." + } + + + + + + +### Identifier + +#### 1. Identifier + +{"A single alphanumeric identifier in the document"} + + + +### Line + +#### 1. Line + + + {"A single line in the document. Excludes leading and trailing whitespace."} + + + + + + +### Non whitespace sequence + +#### 1. Non whitespace sequence + +{"A sequence of non-whitespace characters"} + + + +### Paragraph + +#### 1. Paragraph + +{"A single paragraph(contiguous block of lines) in the document"} + + + +### Sentence + +#### 1. Sentence + +{"A single sentence in the document"} + + + + + + + + + +### Surrounding pair + +#### 1. Surrounding pair + +{"A delimiter pair, such as parentheses or quotes"} + + + + + + + + + + + + + +#### 2. Surrounding pair (iteration) + +{"The iteration scope for delimiter pairs"} + + + + + +### Token + +#### 1. Token + +{"A single token in the document"} + + + +### Url + +#### 1. Url + +{"A url"} + + + + + + + + + +### Word + +#### 1. Word + +{"A single word in a token"} + + + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Surrounding pair interior + +#### 1. Interior: Surrounding pair + +{"The interior scope of a surrounding pair"} + + + + +{/* END GENERATED SCOPE VISUALIZER */} diff --git a/packages/app-web-docs/src/docs/user/languages/properties.mdx b/packages/app-web-docs/src/docs/user/languages/properties.mdx index 5928c03f34b..f0c11a41f09 100644 --- a/packages/app-web-docs/src/docs/user/languages/properties.mdx +++ b/packages/app-web-docs/src/docs/user/languages/properties.mdx @@ -1,5 +1,105 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Properties - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Line + +A line comment + + + +### Name + +#### 1. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + + + +#### 2. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Variable initialized + +An initialized variable declaration + + + +#### 2. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Value + +#### 1. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 2. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 3. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 4. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Text fragment + +#### 1. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/python.mdx b/packages/app-web-docs/src/docs/user/languages/python.mdx index 00d9f1f6cb8..b04400ce8b7 100644 --- a/packages/app-web-docs/src/docs/user/languages/python.mdx +++ b/packages/app-web-docs/src/docs/user/languages/python.mdx @@ -1,5 +1,1345 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Python - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + +### Argument list + +#### 1. Argument list: Actual constructor empty + +An empty list of arguments in a constructor call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual constructor multi line + +A multi line list of arguments in a constructor call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual constructor single line + +A single line list of arguments in a constructor call + + + +#### 4. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 5. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 6. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 7. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 8. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 9. Argument list: Actual single line + +A single line list of arguments in a function call + + + + + +#### 10. Argument list: Formal constructor empty + +An empty list of parameters in a constructor declaration. Insertion delimiter should be empty. + + + +#### 11. Argument list: Formal constructor multi line + +A multi line list of parameters in a constructor declaration. Insertion delimiter should include new line. + + + +#### 12. Argument list: Formal constructor single line + +A single line list of parameters in a constructor declaration + + + +#### 13. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + +#### 14. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + +#### 15. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + +#### 16. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + +#### 17. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 18. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 19. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 20. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual constructor multi line + +A multi line argument in a constructor call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual constructor single line + +A single line argument in a constructor call + + + +#### 3. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual method single line + +A single line argument in a method call + + + +#### 5. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument: Actual single line + +A single line argument in a function call + + + + + +#### 7. Argument: Formal catch + +A parameter in a catch clause + + + +#### 8. Argument: Formal constructor multi line + +A multi line parameter in a constructor declaration. Insertion delimiter should include new line. + + + +#### 9. Argument: Formal constructor single line + +A single line parameter in a constructor declaration + + + +#### 10. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + +#### 11. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 12. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 13. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 14. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 15. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 16. Argument: Actual constructor (iteration) + +Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. + + + +#### 17. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 18. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + +#### 19. Argument: Formal constructor (iteration) + +Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. + + + +#### 20. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + +#### 21. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Loop + +A for / while loop branch. For most languages this is not supported, but eg in Python you can have an else branch for a loop. + + + + + +#### 5. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 6. Branch: Ternary + +A branch in a ternary expression + + + +#### 7. Branch: Try + +A try/catch/finally branch + + + + + +#### 8. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 9. Branch: Loop (iteration) + +Iteration scope for loop branches: the loop statement. + + + + + +#### 10. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 11. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +#### 12. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + + + +#### 2. Class (iteration class) + +Iteration scope for classes: class bodies. + + + +#### 3. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection item + +#### 1. Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + + + + + + + + + +#### 2. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + + + + + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: If + +A condition in an if statement + + + +#### 2. Condition: Switch case + +A condition in a switch statement + + + +#### 3. Condition: Ternary + +A condition in a ternary expression + + + +#### 4. Condition: While + +A condition in a while loop + + + +#### 5. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Constructor + +A constructor call + + + +#### 4. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Constructor + +The class being constructed in a class instantiation, including the `new` keyword. + + + +#### 4. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + + + + + + + + + +### Map + +#### 1. Map + +A map/dictionary + + + +### Name + +#### 1. Name: Argument actual + +Name of a (keyword) argument in a function call + + + +#### 2. Name: Argument catch + +Name of a parameter in a catch clause + + + +#### 3. Name: Argument formal + +Name of a parameter in a function declaration + + + +#### 4. Name: Argument formal constructor + +The name of a parameter in a constructor declaration + + + +#### 5. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 6. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 7. Name: Assignment + +Name (LHS) of an assignment + + + +#### 8. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 9. Name: Assignment destructuring + +LHS of an assignment with pattern destructuring + + + +#### 10. Name: Class + +Name of a class + + + + + +#### 11. Name: Constructor + +Name of a constructor + + + +#### 12. Name: Field class + +Name (LHS) of a field in a class + + + +#### 13. Name: Foreach + +Iteration variable name in a for each loop + + + +#### 14. Name: Function + +Name of a function + + + + + +#### 15. Name: Method + +Name of a class method + + + +#### 16. Name: Resource + +Name in a 'with' / 'use' / 'using' statement + + + +#### 17. Name: Variable destructuring + +Name (LHS) of a variable declaration with pattern destructuring + + + +#### 18. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 19. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + +#### 20. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 21. Name (iteration class) + +Iteration scope for names: class bodies. + + + +#### 22. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 23. Name: Argument actual (iteration) + +Iteration scope for names of (keyword) arguments in a function call: the argument list. + + + +#### 24. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 25. Name: Argument formal constructor (iteration) + +Iteration scope for names of formal parameters in a constructor declaration: the parameters list. + + + +#### 26. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 27. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + + + +#### 2. Named function: Constructor + +A constructor declaration in a class + + + +#### 3. Named function: Method + +A named method declaration in a class + + + +#### 4. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 5. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Assignment destructuring + +An assignment statement with pattern destructuring + + + +#### 4. Statement: Break + +A break statement + + + +#### 5. Statement: Class + +A class/struct declaration + + + + + +#### 6. Statement: Constructor + +A constructor declaration + + + +#### 7. Statement: Continue + +A continue statement + + + +#### 8. Statement: Field class + +A field declaration in a class/struct + + + +#### 9. Statement: Foreach + +A for-each loop statement + + + +#### 10. Statement: Function + +A named function declaration + + + + + +#### 11. Statement: Function call + +A function call statement + + + +#### 12. Statement: If + +A if/elif/else statement + + + +#### 13. Statement: Import + +An import statement + + + +#### 14. Statement: Method + +A method declaration + + + +#### 15. Statement: Resource + +A 'with' / 'use' / 'using' statement + + + +#### 16. Statement: Return + +A return statement + + + +#### 17. Statement: Switch + +A switch statement + + + +#### 18. Statement: Throw + +A throw statement + + + +#### 19. Statement: Try + +A try/catch/finally statement + + + +#### 20. Statement: Variable destructuring + +A variable declaration pattern destructuring + + + +#### 21. Statement: Variable initialized + +An initialized variable declaration + + + +#### 22. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 23. Statement: While + +A while loop statement + + + +#### 24. Statement: Yield + +A yield statement + + + +#### 25. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 26. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + +#### 27. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Type + +#### 1. Type: Argument catch + +Type of a parameter in a catch clause + + + +#### 2. Type: Argument formal + +Type of a formal parameter in a function declaration + + + +#### 3. Type: Argument formal constructor + +Type of a formal parameter in a constructor declaration + + + +#### 4. Type: Argument formal method + +Type of a formal parameter in a class method declaration + + + +#### 5. Type: Class + +A class declaration + + + + + +#### 6. Type: Field class + +Type of a field in a class + + + +#### 7. Type: Return + +Type of a return value in a function declaration + + + +#### 8. Type: Return method + +Type of a return value in a method declaration + + + +#### 9. Type: Type argument + +Type argument to a generic / parametrized type + + + + + +#### 10. Type: Variable initialized + +Type of an initialized variable declaration + + + +#### 11. Type: Variable uninitialized + +Type of an uninitialized variable declaration + + + +#### 12. Type (iteration block) + +Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 13. Type (iteration class) + +Iteration scope for types: class bodies. + + + +#### 14. Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + + + +#### 15. Type: Argument formal (iteration) + +Iteration scope for types of formal parameters in a function declaration: the parameters list. + + + +#### 16. Type: Argument formal constructor (iteration) + +Iteration scope for types of formal parameters in a constructor declaration: the parameters list. + + + +#### 17. Type: Argument formal method (iteration) + +Iteration scope for types of formal parameters in a method declaration: the parameters list. + + + +#### 18. Type: Type argument (iteration) + +Iteration scope for type arguments to a generic / parametrized type: the type argument list. + + + +### Value + +#### 1. Value: Argument actual + +The value of a (keyword) argument in a function call + + + +#### 2. Value: Argument formal + +The (default) value of a argument in a function declaration + + + +#### 3. Value: Argument formal constructor + +The (default) value of a parameter in a constructor declaration + + + +#### 4. Value: Argument formal lambda + +The (default) value of a parameter in a lambda declaration + + + +#### 5. Value: Argument formal method + +The (default) value of a parameter in a method declaration + + + +#### 6. Value: Assignment + +Value (RHS) of an assignment + + + + + +#### 7. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 8. Value: Assignment destructuring + +Value (RHS) of an assignment with pattern destructuring + + + +#### 9. Value: Field class + +Value (RHS) of a field in a class + + + +#### 10. Value: Foreach + +Iterable in a for each loop + + + +#### 11. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 12. Value: Return + +Return value of a function + + + +#### 13. Value: Return lambda + +Implicit return value from a lambda + + + +#### 14. Value: Switch + +The value / subject of a switch statement + + + +#### 15. Value: Throw + +Value of a throw statement + + + +#### 16. Value: Variable + +Value (RHS) of a variable declaration + + + + + +#### 17. Value: Variable destructuring + +Value (RHS) of a variable declaration with pattern destructuring + + + +#### 18. Value: Yield + +Value of a yield statement + + + +#### 19. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 20. Value (iteration class) + +Iteration scope for values: class bodies. + + + +#### 21. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 22. Value: Argument actual (iteration) + +Iteration scope for values of (keyword) arguments in a function call: the arguments list. + + + +#### 23. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 24. Value: Argument formal constructor (iteration) + +Iteration scope for values of formal parameters in a constructor declaration: the parameters list. + + + +#### 25. Value: Argument formal lambda (iteration) + +Iteration scope for values of formal parameters in a lambda declaration: the parameters list. + + + +#### 26. Value: Argument formal method (iteration) + +Iteration scope for values of formal parameters in a method declaration: the parameters list. + + + +#### 27. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + +#### 2. Interior: Constructor + +The body of a constructor declaration + + + +#### 3. Interior: Foreach + +The body of a for-each loop + + + +#### 4. Interior: Function + +The body of a function declaration + + + +#### 5. Interior: If + +The body of an if/elif/else branch + + + +#### 6. Interior: Method + +The body of a method declaration + + + +#### 7. Interior: Resource + +the body of a 'with' / 'use' / 'using' statement + + + +#### 8. Interior: Switch + +The body of a switch statement + + + +#### 9. Interior: Switch case + +The body of a switch case branch + + + +#### 10. Interior: Try + +The body of a try/catch/finally branch + + + + + +#### 11. Interior: While + +The body of a while loop + + + +### Pair delimiter + +#### 1. Pair delimiter + +Internally used to add additional language specific surrounding pair delimiters in addition to the text based definitions. eg `r"`. + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 2. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 3. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/r.mdx b/packages/app-web-docs/src/docs/user/languages/r.mdx index 654c7c8b1ff..29f7679eb17 100644 --- a/packages/app-web-docs/src/docs/user/languages/r.mdx +++ b/packages/app-web-docs/src/docs/user/languages/r.mdx @@ -1,5 +1,669 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # R - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + +### Argument list + +#### 1. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 3. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 5. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 7. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + +#### 8. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + +#### 9. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + +#### 10. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + +#### 11. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 12. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual method single line + +A single line argument in a method call + + + +#### 3. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual single line + +A single line argument in a function call + + + +#### 5. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 6. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + +#### 7. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 8. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 9. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 10. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 11. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + +#### 12. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + + + +#### 5. Branch: Try + +A try/catch/finally branch + + + +#### 6. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 7. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 8. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Comment + +#### 1. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: If + +A condition in an if statement + + + +#### 2. Condition: Switch case + +A condition in a switch statement + + + + + +#### 3. Condition: While + +A condition in a while loop + + + +#### 4. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + +### Name + +#### 1. Name: Argument actual + +Name of a (keyword) argument in a function call + + + +#### 2. Name: Argument formal + +Name of a parameter in a function declaration + + + +#### 3. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 4. Name: Assignment + +Name (LHS) of an assignment + + + + + +#### 5. Name: Foreach + +Iteration variable name in a for each loop + + + +#### 6. Name: Function + +Name of a function + + + +#### 7. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 8. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 9. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 10. Name: Argument actual (iteration) + +Iteration scope for names of (keyword) arguments in a function call: the argument list. + + + +#### 11. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 12. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + +#### 2. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + + + +#### 2. Statement: Break + +A break statement + + + +#### 3. Statement: Continue + +A continue statement + + + +#### 4. Statement: Foreach + +A for-each loop statement + + + +#### 5. Statement: Function + +A named function declaration + + + +#### 6. Statement: Function call + +A function call statement + + + +#### 7. Statement: If + +A if/elif/else statement + + + +#### 8. Statement: Return + +A return statement + + + +#### 9. Statement: Switch + +A switch statement + + + +#### 10. Statement: Try + +A try/catch/finally statement + + + +#### 11. Statement: Variable initialized + +An initialized variable declaration + + + +#### 12. Statement: While + +A while loop statement + + + +#### 13. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 14. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Value + +#### 1. Value: Argument actual + +The value of a (keyword) argument in a function call + + + +#### 2. Value: Argument formal + +The (default) value of a argument in a function declaration + + + +#### 3. Value: Argument formal lambda + +The (default) value of a parameter in a lambda declaration + + + +#### 4. Value: Assignment + +Value (RHS) of an assignment + + + + + +#### 5. Value: Foreach + +Iterable in a for each loop + + + +#### 6. Value: Return + +Return value of a function + + + +#### 7. Value: Switch + +The value / subject of a switch statement + + + +#### 8. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 9. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 10. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 11. Value: Argument actual (iteration) + +Iteration scope for values of (keyword) arguments in a function call: the arguments list. + + + +#### 12. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 13. Value: Argument formal lambda (iteration) + +Iteration scope for values of formal parameters in a lambda declaration: the parameters list. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Foreach + +The body of a for-each loop + + + +#### 2. Interior: Function + +The body of a function declaration + + + +#### 3. Interior: If + +The body of an if/elif/else branch + + + +#### 4. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 5. Interior: Switch case + +The body of a switch case branch + + + + + +#### 6. Interior: Try + +The body of a try/catch/finally branch + + + +#### 7. Interior: While + +The body of a while loop + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 2. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 3. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/ruby.mdx b/packages/app-web-docs/src/docs/user/languages/ruby.mdx index 1aaa234fe10..074e9cccc2f 100644 --- a/packages/app-web-docs/src/docs/user/languages/ruby.mdx +++ b/packages/app-web-docs/src/docs/user/languages/ruby.mdx @@ -1,5 +1,995 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Ruby - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + + + +### Argument list + +#### 1. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 3. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 5. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 7. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + + + +#### 8. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + +#### 9. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + +#### 10. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + +#### 11. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + +#### 12. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 13. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 14. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + + + +#### 15. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + + + +### Argument or parameter + +#### 1. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual method single line + +A single line argument in a method call + + + +#### 3. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + + + +#### 4. Argument: Actual single line + +A single line argument in a function call + + + + + +#### 5. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 6. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + +#### 7. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 8. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 9. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 10. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 11. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + + + +#### 12. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 13. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + +#### 14. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + +#### 15. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + + + +#### 5. Branch: Ternary + +A branch in a ternary expression + + + +#### 6. Branch: Try + +A try/catch/finally branch + + + +#### 7. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 8. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + + + +#### 9. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +#### 10. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + +#### 2. Class (iteration class) + +Iteration scope for classes: class bodies. + + + +#### 3. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: If + +A condition in an if statement + + + +#### 2. Condition: Switch case + +A condition in a switch statement + + + + + + + + + +#### 3. Condition: Ternary + +A condition in a ternary expression + + + +#### 4. Condition: While + +A condition in a while loop + + + +#### 5. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + + + + + +### Map + +#### 1. Map + +A map/dictionary + + + +### Name + +#### 1. Name: Argument actual + +Name of a (keyword) argument in a function call + + + +#### 2. Name: Argument formal + +Name of a parameter in a function declaration + + + +#### 3. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 4. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 5. Name: Assignment + +Name (LHS) of an assignment + + + +#### 6. Name: Class + +Name of a class + + + +#### 7. Name: Foreach + +Iteration variable name in a for each loop + + + +#### 8. Name: Function + +Name of a function + + + + + + + + + +#### 9. Name: Method + +Name of a class method + + + +#### 10. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 11. Name (iteration class) + +Iteration scope for names: class bodies. + + + +#### 12. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 13. Name: Argument actual (iteration) + +Iteration scope for names of (keyword) arguments in a function call: the argument list. + + + +#### 14. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 15. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 16. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + + + + + + + +#### 2. Named function: Method + +A named method declaration in a class + + + +#### 3. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 4. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Regular expression + +#### 1. Regular expression + +A regular expression + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Break + +A break statement + + + +#### 3. Statement: Class + +A class/struct declaration + + + +#### 4. Statement: Continue + +A continue statement + + + +#### 5. Statement: Foreach + +A for-each loop statement + + + +#### 6. Statement: Function + +A named function declaration + + + + + + + + + +#### 7. Statement: Function call + +A function call statement + + + +#### 8. Statement: If + +A if/elif/else statement + + + +#### 9. Statement: Method + +A method declaration + + + +#### 10. Statement: Misc + +A miscellaneous statement + + + +#### 11. Statement: Return + +A return statement + + + +#### 12. Statement: Switch + +A switch statement + + + + + +#### 13. Statement: Throw + +A throw statement + + + +#### 14. Statement: Try + +A try/catch/finally statement + + + +#### 15. Statement: Variable initialized + +An initialized variable declaration + + + +#### 16. Statement: While + +A while loop statement + + + +#### 17. Statement: Yield + +A yield statement + + + +#### 18. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 19. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + +#### 20. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Value + +#### 1. Value: Argument actual + +The value of a (keyword) argument in a function call + + + +#### 2. Value: Argument formal + +The (default) value of a argument in a function declaration + + + +#### 3. Value: Argument formal lambda + +The (default) value of a parameter in a lambda declaration + + + +#### 4. Value: Argument formal method + +The (default) value of a parameter in a method declaration + + + +#### 5. Value: Assignment + +Value (RHS) of an assignment + + + +#### 6. Value: Foreach + +Iterable in a for each loop + + + +#### 7. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 8. Value: Return + +Return value of a function + + + +#### 9. Value: Return lambda + +Implicit return value from a lambda + + + +#### 10. Value: Switch + +The value / subject of a switch statement + + + + + +#### 11. Value: Throw + +Value of a throw statement + + + +#### 12. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 13. Value: Yield + +Value of a yield statement + + + +#### 14. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 15. Value (iteration class) + +Iteration scope for values: class bodies. + + + +#### 16. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 17. Value: Argument actual (iteration) + +Iteration scope for values of (keyword) arguments in a function call: the arguments list. + + + +#### 18. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 19. Value: Argument formal lambda (iteration) + +Iteration scope for values of formal parameters in a lambda declaration: the parameters list. + + + +#### 20. Value: Argument formal method (iteration) + +Iteration scope for values of formal parameters in a method declaration: the parameters list. + + + +#### 21. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + +#### 2. Interior: Foreach + +The body of a for-each loop + + + +#### 3. Interior: Function + +The body of a function declaration + + + + + + + + + +#### 4. Interior: If + +The body of an if/elif/else branch + + + + + + + +#### 5. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 6. Interior: Method + +The body of a method declaration + + + +#### 7. Interior: Switch + +The body of a switch statement + + + + + +#### 8. Interior: Switch case + +The body of a switch case branch + + + + + +#### 9. Interior: Try + +The body of a try/catch/finally branch + + + +#### 10. Interior: While + +The body of a while loop + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 4. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/rust.mdx b/packages/app-web-docs/src/docs/user/languages/rust.mdx index 1ad8ccc3e2b..4c92c20fa0a 100644 --- a/packages/app-web-docs/src/docs/user/languages/rust.mdx +++ b/packages/app-web-docs/src/docs/user/languages/rust.mdx @@ -1,5 +1,1219 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Rust - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + +### Argument list + +#### 1. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual enum empty + +An empty list of arguments in an enum constructor call. Insertion delimiter should be empty. + + + +#### 3. Argument list: Actual enum multi line + +A multi line list of arguments in an enum constructor call. Insertion delimiter should include new line. + + + +#### 4. Argument list: Actual enum single line + +A single line list of arguments in an enum constructor call + + + +#### 5. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 6. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 7. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 8. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 9. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 10. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + +#### 11. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + +#### 12. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + +#### 13. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + +#### 14. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + +#### 15. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 16. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 17. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 18. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual enum multi line + +A multi line argument in an enum constructor call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual enum single line + +A single line argument in an enum constructor call + + + +#### 3. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual method single line + +A single line argument in a method call + + + +#### 5. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument: Actual single line + +A single line argument in a function call + + + +#### 7. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + + + +#### 8. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + + + +#### 9. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 10. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 11. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 12. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 13. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 14. Argument: Actual enum (iteration) + +Iteration scope for arguments in an enum constructor call: the argument list. The domain should be the entire enum constructor call.. + + + +#### 15. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 16. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + +#### 17. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + + + +#### 18. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 6. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + +#### 2. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: If + +A condition in an if statement + + + +#### 2. Condition: Switch case + +A condition in a switch statement + + + + + +#### 3. Condition: While + +A condition in a while loop + + + +#### 4. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Enum + +An enum constructor call + + + +#### 4. Function call: Generic + +A function call with generic type arguments + + + +#### 5. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Enum + +The enum constructor being called + + + +#### 4. Function callee: Generic + +The function being called in a function call with generic type arguments + + + +#### 5. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + + + +### Map + +#### 1. Map + +A map/dictionary + + + +### Name + +#### 1. Name: Argument formal + +Name of a parameter in a function declaration + + + +#### 2. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 3. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 4. Name: Assignment + +Name (LHS) of an assignment + + + +#### 5. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 6. Name: Assignment destructuring + +LHS of an assignment with pattern destructuring + + + +#### 7. Name: Class + +Name of a class + + + + + +#### 8. Name: Constant + +Name (LHS) of a constant declaration + + + +#### 9. Name: Enum + +Name of an enum + + + +#### 10. Name: Field class + +Name (LHS) of a field in a class + + + +#### 11. Name: Field enum + +Name (LHS) of a field in an enum + + + +#### 12. Name: Foreach + +Iteration variable name in a for each loop + + + +#### 13. Name: Function + +Name of a function + + + +#### 14. Name: Method + +Name of a class method + + + +#### 15. Name: Namespace + +Name of a namespace + + + +#### 16. Name: Type alias + +Name of a type alias + + + +#### 17. Name: Variable destructuring + +Name (LHS) of a variable declaration with pattern destructuring + + + +#### 18. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 19. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + +#### 20. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 21. Name (iteration class) + +Iteration scope for names: class bodies. + + + + + + + +#### 22. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 23. Name (iteration enum) + +Iteration scope for names: enum bodies. + + + +#### 24. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 25. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 26. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + +#### 2. Named function: Method + +A named method declaration in a class + + + +#### 3. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + + + +#### 4. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Assignment destructuring + +An assignment statement with pattern destructuring + + + +#### 4. Statement: Break + +A break statement + + + +#### 5. Statement: Class + +A class/struct declaration + + + + + + + +#### 6. Statement: Constant + +A constant declaration + + + +#### 7. Statement: Continue + +A continue statement + + + +#### 8. Statement: Enum + +An enum declaration + + + +#### 9. Statement: Field class + +A field declaration in a class/struct + + + +#### 10. Statement: Foreach + +A for-each loop statement + + + +#### 11. Statement: Function + +A named function declaration + + + +#### 12. Statement: Function call + +A function call statement + + + +#### 13. Statement: If + +A if/elif/else statement + + + +#### 14. Statement: Import + +An import statement + + + +#### 15. Statement: Method + +A method declaration + + + +#### 16. Statement: Namespace + +A namespace declaration + + + +#### 17. Statement: Package + +A package declaration + + + +#### 18. Statement: Return + +A return statement + + + +#### 19. Statement: Switch + +A switch statement + + + +#### 20. Statement: Type alias + +A type alias declaration + + + +#### 21. Statement: Update + +An update statement, eg ++/-- + + + + + +#### 22. Statement: Variable destructuring + +A variable declaration pattern destructuring + + + +#### 23. Statement: Variable initialized + +An initialized variable declaration + + + +#### 24. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 25. Statement: While + +A while loop statement + + + +#### 26. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 27. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + + + + + +#### 28. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Type + +#### 1. Type: Alias + +A type alias declaration + + + +#### 2. Type: Argument formal + +Type of a formal parameter in a function declaration + + + +#### 3. Type: Argument formal lambda + +Type of a formal parameter in a lambda declaration + + + +#### 4. Type: Argument formal method + +Type of a formal parameter in a class method declaration + + + +#### 5. Type: Cast + +A type cast + + + +#### 6. Type: Class + +A class declaration + + + + + + + + + +#### 7. Type: Constant + +Type of a constant declaration + + + +#### 8. Type: Enum + +An enum declaration + + + +#### 9. Type: Field class + +Type of a field in a class + + + +#### 10. Type: Return + +Type of a return value in a function declaration + + + +#### 11. Type: Return lambda + +Type of a return value in a lambda declaration + + + +#### 12. Type: Return method + +Type of a return value in a method declaration + + + +#### 13. Type: Type argument + +Type argument to a generic / parametrized type + + + +#### 14. Type: Variable initialized + +Type of an initialized variable declaration + + + +#### 15. Type: Variable uninitialized + +Type of an uninitialized variable declaration + + + +#### 16. Type (iteration block) + +Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 17. Type (iteration class) + +Iteration scope for types: class bodies. + + + + + + + +#### 18. Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + + + +#### 19. Type: Argument formal (iteration) + +Iteration scope for types of formal parameters in a function declaration: the parameters list. + + + +#### 20. Type: Argument formal lambda (iteration) + +Iteration scope for types of formal parameters in a lambda declaration: the parameters list. + + + +#### 21. Type: Argument formal method (iteration) + +Iteration scope for types of formal parameters in a method declaration: the parameters list. + + + +#### 22. Type: Type argument (iteration) + +Iteration scope for type arguments to a generic / parametrized type: the type argument list. + + + +### Value + +#### 1. Value: Assignment + +Value (RHS) of an assignment + + + +#### 2. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 3. Value: Assignment destructuring + +Value (RHS) of an assignment with pattern destructuring + + + +#### 4. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 5. Value: Foreach + +Iterable in a for each loop + + + +#### 6. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 7. Value: Return + +Return value of a function + + + +#### 8. Value: Return lambda + +Implicit return value from a lambda + + + +#### 9. Value: Switch + +The value / subject of a switch statement + + + +#### 10. Value: Type alias + +Value of a type alias declaration + + + +#### 11. Value: Variable + +Value (RHS) of a variable declaration + + + + + +#### 12. Value: Variable destructuring + +Value (RHS) of a variable declaration with pattern destructuring + + + +#### 13. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 14. Value (iteration class) + +Iteration scope for values: class bodies. + + + + + + + +#### 15. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 16. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + + + + + +#### 2. Interior: Enum + +The body of an enum + + + +#### 3. Interior: Foreach + +The body of a for-each loop + + + +#### 4. Interior: Function + +The body of a function declaration + + + +#### 5. Interior: If + +The body of an if/elif/else branch + + + +#### 6. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 7. Interior: Method + +The body of a method declaration + + + +#### 8. Interior: Namespace + +the body of a namespace statement + + + +#### 9. Interior: Switch + +The body of a switch statement + + + +#### 10. Interior: Switch case + +The body of a switch case branch + + + + + +#### 11. Interior: While + +The body of a while loop + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + + + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 4. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/scala.mdx b/packages/app-web-docs/src/docs/user/languages/scala.mdx index 51fece1f3e5..75c4a59d6c0 100644 --- a/packages/app-web-docs/src/docs/user/languages/scala.mdx +++ b/packages/app-web-docs/src/docs/user/languages/scala.mdx @@ -1,5 +1,1409 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Scala - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + +### Argument list + +#### 1. Argument list: Actual constructor empty + +An empty list of arguments in a constructor call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual constructor multi line + +A multi line list of arguments in a constructor call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual constructor single line + +A single line list of arguments in a constructor call + + + +#### 4. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 5. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 6. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 7. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 8. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 9. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 10. Argument list: Formal constructor empty + +An empty list of parameters in a constructor declaration. Insertion delimiter should be empty. + + + +#### 11. Argument list: Formal constructor multi line + +A multi line list of parameters in a constructor declaration. Insertion delimiter should include new line. + + + +#### 12. Argument list: Formal constructor single line + +A single line list of parameters in a constructor declaration + + + +#### 13. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + + + +#### 14. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + +#### 15. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + +#### 16. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + +#### 17. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + +#### 18. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 19. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 20. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + + + +#### 21. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + + + +### Argument or parameter + +#### 1. Argument: Actual constructor multi line + +A multi line argument in a constructor call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual constructor single line + +A single line argument in a constructor call + + + +#### 3. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual method single line + +A single line argument in a method call + + + +#### 5. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument: Actual single line + +A single line argument in a function call + + + +#### 7. Argument: Formal catch + +A parameter in a catch clause + + + +#### 8. Argument: Formal constructor multi line + +A multi line parameter in a constructor declaration. Insertion delimiter should include new line. + + + +#### 9. Argument: Formal constructor single line + +A single line parameter in a constructor declaration + + + +#### 10. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 11. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + +#### 12. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 13. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 14. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 15. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 16. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 17. Argument: Actual constructor (iteration) + +Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. + + + +#### 18. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 19. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + +#### 20. Argument: Formal constructor (iteration) + +Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. + + + +#### 21. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + +#### 22. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: Try + +A try/catch/finally branch + + + +#### 6. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 7. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 8. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + +#### 2. Class (iteration class) + +Iteration scope for classes: class bodies. + + + +#### 3. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + + + +#### 3. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: Do while + +A condition in a do while loop + + + +#### 2. Condition: If + +A condition in an if statement + + + +#### 3. Condition: Switch case + +A condition in a switch statement + + + + + +#### 4. Condition: While + +A condition in a while loop + + + +#### 5. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Constructor + +A constructor call + + + +#### 4. Function call: Generic + +A function call with generic type arguments + + + +#### 5. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Constructor + +The class being constructed in a class instantiation, including the `new` keyword. + + + +#### 4. Function callee: Generic + +The function being called in a function call with generic type arguments + + + +#### 5. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### Name + +#### 1. Name: Argument actual + +Name of a (keyword) argument in a function call + + + +#### 2. Name: Argument catch + +Name of a parameter in a catch clause + + + +#### 3. Name: Argument formal + +Name of a parameter in a function declaration + + + +#### 4. Name: Argument formal constructor + +The name of a parameter in a constructor declaration + + + +#### 5. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 6. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 7. Name: Assignment + +Name (LHS) of an assignment + + + +#### 8. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 9. Name: Class + +Name of a class + + + +#### 10. Name: Constant + +Name (LHS) of a constant declaration + + + +#### 11. Name: Enum + +Name of an enum + + + +#### 12. Name: Field class + +Name (LHS) of a field in a class + + + +#### 13. Name: Field enum + +Name (LHS) of a field in an enum + + + +#### 14. Name: Field interface + +Name (LHS) of a field in an interface + + + +#### 15. Name: Foreach + +Iteration variable name in a for each loop + + + + + +#### 16. Name: Function + +Name of a function + + + +#### 17. Name: Interface + +Name of a interface + + + +#### 18. Name: Method + +Name of a class method + + + +#### 19. Name: Method interface + +Name of a interface method + + + +#### 20. Name: Namespace + +Name of a namespace + + + +#### 21. Name: Type alias + +Name of a type alias + + + +#### 22. Name: Variable destructuring + +Name (LHS) of a variable declaration with pattern destructuring + + + +#### 23. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 24. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + +#### 25. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 26. Name (iteration class) + +Iteration scope for names: class bodies. + + + +#### 27. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 28. Name (iteration enum) + +Iteration scope for names: enum bodies. + + + +#### 29. Name (iteration interface) + +Iteration scope for names: interface bodies. + + + +#### 30. Name: Argument actual (iteration) + +Iteration scope for names of (keyword) arguments in a function call: the argument list. + + + +#### 31. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 32. Name: Argument formal constructor (iteration) + +Iteration scope for names of formal parameters in a constructor declaration: the parameters list. + + + +#### 33. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 34. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + +#### 2. Named function: Method + +A named method declaration in a class + + + +#### 3. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 4. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Class + +A class/struct declaration + + + +#### 4. Statement: Constant + +A constant declaration + + + +#### 5. Statement: Do while + +A do-while loop statement + + + +#### 6. Statement: Enum + +An enum declaration + + + +#### 7. Statement: Field class + +A field declaration in a class/struct + + + +#### 8. Statement: Field interface + +A field declaration in a interface + + + +#### 9. Statement: Foreach + +A for-each loop statement + + + +#### 10. Statement: Function + +A named function declaration + + + +#### 11. Statement: Function call + +A function call statement + + + +#### 12. Statement: If + +A if/elif/else statement + + + +#### 13. Statement: Import + +An import statement + + + +#### 14. Statement: Interface + +An interface declaration + + + +#### 15. Statement: Method + +A method declaration + + + +#### 16. Statement: Method interface + +A method declaration in a interface + + + +#### 17. Statement: Namespace + +A namespace declaration + + + +#### 18. Statement: Package + +A package declaration + + + +#### 19. Statement: Return + +A return statement + + + +#### 20. Statement: Switch + +A switch statement + + + +#### 21. Statement: Throw + +A throw statement + + + +#### 22. Statement: Try + +A try/catch/finally statement + + + +#### 23. Statement: Type alias + +A type alias declaration + + + +#### 24. Statement: Update + +An update statement, eg ++/-- + + + + + +#### 25. Statement: Variable destructuring + +A variable declaration pattern destructuring + + + +#### 26. Statement: Variable initialized + +An initialized variable declaration + + + +#### 27. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 28. Statement: While + +A while loop statement + + + +#### 29. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 30. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + +#### 31. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +#### 32. Statement (iteration interface) + +Iteration scope for statements: interface bodies. + + + +### Type + +#### 1. Type: Alias + +A type alias declaration + + + +#### 2. Type: Argument catch + +Type of a parameter in a catch clause + + + +#### 3. Type: Argument formal + +Type of a formal parameter in a function declaration + + + +#### 4. Type: Argument formal constructor + +Type of a formal parameter in a constructor declaration + + + +#### 5. Type: Argument formal lambda + +Type of a formal parameter in a lambda declaration + + + +#### 6. Type: Argument formal method + +Type of a formal parameter in a class method declaration + + + +#### 7. Type: Class + +A class declaration + + + +#### 8. Type: Constant + +Type of a constant declaration + + + +#### 9. Type: Enum + +An enum declaration + + + +#### 10. Type: Field class + +Type of a field in a class + + + +#### 11. Type: Field interface + +Type of a field in a interface + + + +#### 12. Type: Foreach + +Type of a variable in a for each loop + + + +#### 13. Type: Interface + +An interface declaration + + + +#### 14. Type: Return + +Type of a return value in a function declaration + + + +#### 15. Type: Return method + +Type of a return value in a method declaration + + + +#### 16. Type: Type argument + +Type argument to a generic / parametrized type + + + +#### 17. Type: Variable initialized + +Type of an initialized variable declaration + + + +#### 18. Type: Variable uninitialized + +Type of an uninitialized variable declaration + + + +#### 19. Type (iteration block) + +Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 20. Type (iteration class) + +Iteration scope for types: class bodies. + + + +#### 21. Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + + + +#### 22. Type (iteration interface) + +Iteration scope for types: interface bodies. + + + +#### 23. Type: Argument formal (iteration) + +Iteration scope for types of formal parameters in a function declaration: the parameters list. + + + +#### 24. Type: Argument formal constructor (iteration) + +Iteration scope for types of formal parameters in a constructor declaration: the parameters list. + + + +#### 25. Type: Argument formal lambda (iteration) + +Iteration scope for types of formal parameters in a lambda declaration: the parameters list. + + + +#### 26. Type: Argument formal method (iteration) + +Iteration scope for types of formal parameters in a method declaration: the parameters list. + + + +#### 27. Type: Type argument (iteration) + +Iteration scope for type arguments to a generic / parametrized type: the type argument list. + + + +### Value + +#### 1. Value: Argument actual + +The value of a (keyword) argument in a function call + + + +#### 2. Value: Argument formal + +The (default) value of a argument in a function declaration + + + +#### 3. Value: Argument formal constructor + +The (default) value of a parameter in a constructor declaration + + + +#### 4. Value: Argument formal method + +The (default) value of a parameter in a method declaration + + + +#### 5. Value: Assignment + +Value (RHS) of an assignment + + + +#### 6. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 7. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 8. Value: Field class + +Value (RHS) of a field in a class + + + +#### 9. Value: Field interface + +Value (RHS) of a field in an interface + + + +#### 10. Value: Foreach + +Iterable in a for each loop + + + +#### 11. Value: Return + +Return value of a function + + + +#### 12. Value: Return lambda + +Implicit return value from a lambda + + + +#### 13. Value: Switch + +The value / subject of a switch statement + + + +#### 14. Value: Throw + +Value of a throw statement + + + +#### 15. Value: Type alias + +Value of a type alias declaration + + + +#### 16. Value: Variable + +Value (RHS) of a variable declaration + + + + + +#### 17. Value: Variable destructuring + +Value (RHS) of a variable declaration with pattern destructuring + + + +#### 18. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 19. Value (iteration class) + +Iteration scope for values: class bodies. + + + +#### 20. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 21. Value: Argument actual (iteration) + +Iteration scope for values of (keyword) arguments in a function call: the arguments list. + + + +#### 22. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 23. Value: Argument formal constructor (iteration) + +Iteration scope for values of formal parameters in a constructor declaration: the parameters list. + + + +#### 24. Value: Argument formal method (iteration) + +Iteration scope for values of formal parameters in a method declaration: the parameters list. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + +#### 2. Interior: Do while + +The body of a do-while loop + + + +#### 3. Interior: Enum + +The body of an enum + + + +#### 4. Interior: Foreach + +The body of a for-each loop + + + +#### 5. Interior: Function + +The body of a function declaration + + + +#### 6. Interior: If + +The body of an if/elif/else branch + + + +#### 7. Interior: Interface + +The body of a interface + + + +#### 8. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 9. Interior: Method + +The body of a method declaration + + + +#### 10. Interior: Namespace + +the body of a namespace statement + + + +#### 11. Interior: Switch + +The body of a switch statement + + + +#### 12. Interior: Switch case + +The body of a switch case branch + + + + + +#### 13. Interior: Try + +The body of a try/catch/finally branch + + + +#### 14. Interior: While + +The body of a while loop + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 4. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/scm.mdx b/packages/app-web-docs/src/docs/user/languages/scm.mdx index 9bd40944229..9ca439ba7cb 100644 --- a/packages/app-web-docs/src/docs/user/languages/scm.mdx +++ b/packages/app-web-docs/src/docs/user/languages/scm.mdx @@ -1,9 +1,119 @@ ---- -sidebar_label: Tree sitter query ---- - -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Tree sitter query (SCM) - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Argument list + +#### 1. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual single line + +A single line list of arguments in a function call + + + +### Argument or parameter + +#### 1. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual single line + +A single line argument in a function call + + + +#### 3. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +### Comment + +#### 1. Comment: Line + +A line comment + + + +### Function call + +#### 1. Function call + +A function call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +### List + +#### 1. List + +A list/array + + + +### Statement + +#### 1. Statement: Misc + +A miscellaneous statement + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### String + +#### 1. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 2. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/scss.mdx b/packages/app-web-docs/src/docs/user/languages/scss.mdx index f791cc75acc..b1a1eea05ac 100644 --- a/packages/app-web-docs/src/docs/user/languages/scss.mdx +++ b/packages/app-web-docs/src/docs/user/languages/scss.mdx @@ -1,5 +1,375 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # SCSS - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Argument list + +#### 1. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual single line + +A single line list of arguments in a function call + + + +### Argument or parameter + +#### 1. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + + + +#### 2. Argument: Actual single line + +A single line argument in a function call + + + + + + + + + + + +#### 3. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + + + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: If + +A condition in an if statement + + + +### Function call + +#### 1. Function call + +A function call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +### If statement + +#### 1. If statement + +An if statement + + + +### Map + +#### 1. Map + +A map/dictionary + + + +### Name + +#### 1. Name: Argument formal + +Name of a parameter in a function declaration + + + +#### 2. Name: Function + +Name of a function + + + + + +#### 3. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + +#### 4. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + + + +#### 5. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + + + +#### 2. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 3. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Selector + +#### 1. Selector + +A selector in a css rule set + + + + + + + + + + + + + + + +### Statement + +#### 1. Statement: Misc + +A miscellaneous statement + + + +#### 2. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Unit + +#### 1. Unit + +A unit in a css rule set + + + + + + + + + + + +### Value + +#### 1. Value: Argument formal + +The (default) value of a argument in a function declaration + + + +#### 2. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + + + +#### 3. Value: Return + +Return value of a function + + + +#### 4. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 5. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + + + +### Interior + +#### 1. Interior: Function + +The body of a function declaration + + + +#### 2. Interior: If + +The body of an if/elif/else branch + + + +### String + +#### 1. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/talon-list.mdx b/packages/app-web-docs/src/docs/user/languages/talon-list.mdx index 4fc01d30346..a17cc2ae708 100644 --- a/packages/app-web-docs/src/docs/user/languages/talon-list.mdx +++ b/packages/app-web-docs/src/docs/user/languages/talon-list.mdx @@ -1,5 +1,123 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Talon-list - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Line + +A line comment + + + +### Name + +#### 1. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + + + +#### 2. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Variable initialized + +An initialized variable declaration + + + + + +#### 2. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Value + +#### 1. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 2. Value: Variable + +Value (RHS) of a variable declaration + + + + + +#### 3. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 4. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### String + +#### 1. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 2. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/talon.mdx b/packages/app-web-docs/src/docs/user/languages/talon.mdx index f94f97444e0..f50b41a146a 100644 --- a/packages/app-web-docs/src/docs/user/languages/talon.mdx +++ b/packages/app-web-docs/src/docs/user/languages/talon.mdx @@ -1,5 +1,357 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Talon - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Argument list + +#### 1. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 3. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 4. Argument list: Actual single line + +A single line list of arguments in a function call + + + + + + + +### Argument or parameter + +#### 1. Argument: Actual single line + +A single line argument in a function call + + + + + + + +#### 2. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + + + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + + + + + +### Command + +#### 1. Command + +A command, for example Talon spoken command or bash + + + + + +### Comment + +#### 1. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: If + +A condition in an if statement + + + +### Function call + +#### 1. Function call + +A function call + + + + + +#### 2. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + + + +#### 2. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### Name + +#### 1. Name: Assignment + +Name (LHS) of an assignment + + + +#### 2. Name: Command + +LHS of a command, eg Talon spoken command or bash + + + + + + + +#### 3. Name: Foreach + +Iteration variable name in a for each loop + + + +#### 4. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + +#### 5. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 6. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Command + +A command statement, eg Talon spoken command or bash + + + +#### 3. Statement: Foreach + +A for-each loop statement + + + +#### 4. Statement: Function call + +A function call statement + + + +#### 5. Statement: If + +A if/elif/else statement + + + +#### 6. Statement: Variable initialized + +An initialized variable declaration + + + +#### 7. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + +#### 8. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Value + +#### 1. Value: Assignment + +Value (RHS) of an assignment + + + +#### 2. Value: Command + +Value (RHS) of an command, eg Talon spoken command + + + +#### 3. Value: Foreach + +Iterable in a for each loop + + + +#### 4. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + + + +#### 5. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 6. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 7. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 8. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + + + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Interior + +#### 1. Interior: Command + +The body of a command, eg Talon spoken command + + + +#### 2. Interior: Foreach + +The body of a for-each loop + + + +#### 3. Interior: If + +The body of an if/elif/else branch + + + +### String + +#### 1. String: Single line + +A single-line string + + + + + +### Text fragment + +#### 1. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 2. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/typescript.mdx b/packages/app-web-docs/src/docs/user/languages/typescript.mdx index 0b272ee5111..2e363184ac5 100644 --- a/packages/app-web-docs/src/docs/user/languages/typescript.mdx +++ b/packages/app-web-docs/src/docs/user/languages/typescript.mdx @@ -1,5 +1,1893 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # TypeScript - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + + + + + +### Argument list + +#### 1. Argument list: Actual constructor empty + +An empty list of arguments in a constructor call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual constructor multi line + +A multi line list of arguments in a constructor call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual constructor single line + +A single line list of arguments in a constructor call + + + +#### 4. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 5. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 6. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 7. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 8. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 9. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 10. Argument list: Formal constructor empty + +An empty list of parameters in a constructor declaration. Insertion delimiter should be empty. + + + + + +#### 11. Argument list: Formal constructor multi line + +A multi line list of parameters in a constructor declaration. Insertion delimiter should include new line. + + + +#### 12. Argument list: Formal constructor single line + +A single line list of parameters in a constructor declaration + + + +#### 13. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 14. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + + + +#### 15. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + + + +#### 16. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + + + +#### 17. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + + + + + + + + + + + + + + + + + + + +#### 18. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 19. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 20. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 21. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual constructor multi line + +A multi line argument in a constructor call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual constructor single line + +A single line argument in a constructor call + + + +#### 3. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual method single line + +A single line argument in a method call + + + +#### 5. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument: Actual single line + +A single line argument in a function call + + + +#### 7. Argument: Formal catch + +A parameter in a catch clause + + + + + +#### 8. Argument: Formal constructor multi line + +A multi line parameter in a constructor declaration. Insertion delimiter should include new line. + + + +#### 9. Argument: Formal constructor single line + +A single line parameter in a constructor declaration + + + +#### 10. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 11. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + + + +#### 12. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 13. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 14. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 15. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 16. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 17. Argument: Actual constructor (iteration) + +Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. + + + +#### 18. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 19. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 20. Argument: Formal constructor (iteration) + +Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. + + + + + +#### 21. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + + + +#### 22. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + + + + + + + + + + + + + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: Ternary + +A branch in a ternary expression + + + +#### 6. Branch: Try + +A try/catch/finally branch + + + +#### 7. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 8. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 9. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +#### 10. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + + + + + + + + + + + +#### 2. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + + + +#### 3. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: Do while + +A condition in a do while loop + + + +#### 2. Condition: For + +A condition in a for loop + + + +#### 3. Condition: If + +A condition in an if statement + + + +#### 4. Condition: Switch case + +A condition in a switch statement + + + +#### 5. Condition: Ternary + +A condition in a ternary expression + + + +#### 6. Condition: While + +A condition in a while loop + + + +#### 7. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Constructor + +A constructor call + + + +#### 4. Function call: Generic + +A function call with generic type arguments + + + +#### 5. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Constructor + +The class being constructed in a class instantiation, including the `new` keyword. + + + +#### 4. Function callee: Generic + +The function being called in a function call with generic type arguments + + + +#### 5. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + +### Map + +#### 1. Map + +A map/dictionary + + + + + +### Name + +#### 1. Name: Argument catch + +Name of a parameter in a catch clause + + + +#### 2. Name: Argument formal + +Name of a parameter in a function declaration + + + + + + + + + +#### 3. Name: Argument formal constructor + +The name of a parameter in a constructor declaration + + + +#### 4. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 5. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 6. Name: Assignment + +Name (LHS) of an assignment + + + +#### 7. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 8. Name: Assignment destructuring + +LHS of an assignment with pattern destructuring + + + +#### 9. Name: Class + +Name of a class + + + + + + + + + + + + + +#### 10. Name: Constant + +Name (LHS) of a constant declaration + + + + + +#### 11. Name: Constructor + +Name of a constructor + + + + + +#### 12. Name: Enum + +Name of an enum + + + +#### 13. Name: Field class + +Name (LHS) of a field in a class + + + + + +#### 14. Name: Field enum + +Name (LHS) of a field in an enum + + + +#### 15. Name: Field interface + +Name (LHS) of a field in an interface + + + +#### 16. Name: Foreach + +Iteration variable name in a for each loop + + + + + +#### 17. Name: Function + +Name of a function + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 18. Name: Interface + +Name of a interface + + + +#### 19. Name: Method + +Name of a class method + + + + + + + + + + + + + + + + + + + + + +#### 20. Name: Method interface + +Name of a interface method + + + +#### 21. Name: Type alias + +Name of a type alias + + + +#### 22. Name: Variable destructuring + +Name (LHS) of a variable declaration with pattern destructuring + + + +#### 23. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + + + + + +#### 24. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + + + +#### 25. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 26. Name (iteration class) + +Iteration scope for names: class bodies. + + + + + +#### 27. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 28. Name (iteration enum) + +Iteration scope for names: enum bodies. + + + +#### 29. Name (iteration interface) + +Iteration scope for names: interface bodies. + + + +#### 30. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 31. Name: Argument formal constructor (iteration) + +Iteration scope for names of formal parameters in a constructor declaration: the parameters list. + + + +#### 32. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 33. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 2. Named function: Constructor + +A constructor declaration in a class + + + + + +#### 3. Named function: Method + +A named method declaration in a class + + + + + + + + + + + + + + + + + + + + + +#### 4. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 5. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Regular expression + +#### 1. Regular expression + +A regular expression + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Assignment destructuring + +An assignment statement with pattern destructuring + + + +#### 4. Statement: Break + +A break statement + + + +#### 5. Statement: Class + +A class/struct declaration + + + + + + + +#### 6. Statement: Constant + +A constant declaration + + + +#### 7. Statement: Constructor + +A constructor declaration + + + +#### 8. Statement: Continue + +A continue statement + + + +#### 9. Statement: Do while + +A do-while loop statement + + + +#### 10. Statement: Enum + +An enum declaration + + + +#### 11. Statement: Field class + +A field declaration in a class/struct + + + +#### 12. Statement: Field interface + +A field declaration in a interface + + + +#### 13. Statement: For + +A for loop statement + + + +#### 14. Statement: Foreach + +A for-each loop statement + + + + + +#### 15. Statement: Function + +A named function declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 16. Statement: Function call + +A function call statement + + + +#### 17. Statement: If + +A if/elif/else statement + + + +#### 18. Statement: Import + +An import statement + + + +#### 19. Statement: Interface + +An interface declaration + + + +#### 20. Statement: Method + +A method declaration + + + + + + + + + + + + + + + + + +#### 21. Statement: Method interface + +A method declaration in a interface + + + +#### 22. Statement: Misc + +A miscellaneous statement + + + +#### 23. Statement: Return + +A return statement + + + +#### 24. Statement: Static + +A static statement + + + +#### 25. Statement: Switch + +A switch statement + + + +#### 26. Statement: Throw + +A throw statement + + + +#### 27. Statement: Try + +A try/catch/finally statement + + + +#### 28. Statement: Type alias + +A type alias declaration + + + +#### 29. Statement: Update + +An update statement, eg ++/-- + + + + + +#### 30. Statement: Variable destructuring + +A variable declaration pattern destructuring + + + +#### 31. Statement: Variable initialized + +An initialized variable declaration + + + +#### 32. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 33. Statement: While + +A while loop statement + + + +#### 34. Statement: Yield + +A yield statement + + + +#### 35. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 36. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + +#### 37. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +#### 38. Statement (iteration interface) + +Iteration scope for statements: interface bodies. + + + +### Type + +#### 1. Type: Alias + +A type alias declaration + + + + + +#### 2. Type: Argument catch + +Type of a parameter in a catch clause + + + +#### 3. Type: Argument formal + +Type of a formal parameter in a function declaration + + + + + +#### 4. Type: Argument formal constructor + +Type of a formal parameter in a constructor declaration + + + +#### 5. Type: Argument formal lambda + +Type of a formal parameter in a lambda declaration + + + +#### 6. Type: Argument formal method + +Type of a formal parameter in a class method declaration + + + +#### 7. Type: Cast + +A type cast + + + + + + + +#### 8. Type: Class + +A class declaration + + + + + + + + + + + + + +#### 9. Type: Constant + +Type of a constant declaration + + + +#### 10. Type: Enum + +An enum declaration + + + + + +#### 11. Type: Field class + +Type of a field in a class + + + +#### 12. Type: Field interface + +Type of a field in a interface + + + +#### 13. Type: Interface + +An interface declaration + + + +#### 14. Type: Return + +Type of a return value in a function declaration + + + + + +#### 15. Type: Return lambda + +Type of a return value in a lambda declaration + + + +#### 16. Type: Return method + +Type of a return value in a method declaration + + + +#### 17. Type: Type argument + +Type argument to a generic / parametrized type + + + + + +#### 18. Type: Variable initialized + +Type of an initialized variable declaration + + + +#### 19. Type: Variable uninitialized + +Type of an uninitialized variable declaration + + + +#### 20. Type (iteration block) + +Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 21. Type (iteration class) + +Iteration scope for types: class bodies. + + + +#### 22. Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + + + +#### 23. Type (iteration interface) + +Iteration scope for types: interface bodies. + + + +#### 24. Type: Argument formal (iteration) + +Iteration scope for types of formal parameters in a function declaration: the parameters list. + + + +#### 25. Type: Argument formal constructor (iteration) + +Iteration scope for types of formal parameters in a constructor declaration: the parameters list. + + + +#### 26. Type: Argument formal lambda (iteration) + +Iteration scope for types of formal parameters in a lambda declaration: the parameters list. + + + +#### 27. Type: Argument formal method (iteration) + +Iteration scope for types of formal parameters in a method declaration: the parameters list. + + + +#### 28. Type: Type argument (iteration) + +Iteration scope for type arguments to a generic / parametrized type: the type argument list. + + + +### Value + +#### 1. Value: Argument formal + +The (default) value of a argument in a function declaration + + + + + +#### 2. Value: Argument formal constructor + +The (default) value of a parameter in a constructor declaration + + + +#### 3. Value: Argument formal lambda + +The (default) value of a parameter in a lambda declaration + + + +#### 4. Value: Argument formal method + +The (default) value of a parameter in a method declaration + + + +#### 5. Value: Assignment + +Value (RHS) of an assignment + + + + + +#### 6. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 7. Value: Assignment destructuring + +Value (RHS) of an assignment with pattern destructuring + + + +#### 8. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 9. Value: Field class + +Value (RHS) of a field in a class + + + + + +#### 10. Value: Field enum + +Value (RHS) of a field in an enum + + + +#### 11. Value: Foreach + +Iterable in a for each loop + + + + + +#### 12. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + + + +#### 13. Value: Return + +Return value of a function + + + +#### 14. Value: Return lambda + +Implicit return value from a lambda + + + +#### 15. Value: Switch + +The value / subject of a switch statement + + + +#### 16. Value: Throw + +Value of a throw statement + + + +#### 17. Value: Type alias + +Value of a type alias declaration + + + + + +#### 18. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 19. Value: Variable destructuring + +Value (RHS) of a variable declaration with pattern destructuring + + + +#### 20. Value: Yield + +Value of a yield statement + + + +#### 21. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 22. Value (iteration class) + +Iteration scope for values: class bodies. + + + + + +#### 23. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 24. Value (iteration enum) + +Iteration scope for values: enum bodies. + + + +#### 25. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 26. Value: Argument formal constructor (iteration) + +Iteration scope for values of formal parameters in a constructor declaration: the parameters list. + + + +#### 27. Value: Argument formal lambda (iteration) + +Iteration scope for values of formal parameters in a lambda declaration: the parameters list. + + + +#### 28. Value: Argument formal method (iteration) + +Iteration scope for values of formal parameters in a method declaration: the parameters list. + + + +#### 29. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + +#### 2. Interior: Constructor + +The body of a constructor declaration + + + +#### 3. Interior: Do while + +The body of a do-while loop + + + +#### 4. Interior: Enum + +The body of an enum + + + +#### 5. Interior: For + +The body of a for loop + + + +#### 6. Interior: Foreach + +The body of a for-each loop + + + + + +#### 7. Interior: Function + +The body of a function declaration + + + +#### 8. Interior: If + +The body of an if/elif/else branch + + + +#### 9. Interior: Interface + +The body of a interface + + + +#### 10. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 11. Interior: Method + +The body of a method declaration + + + +#### 12. Interior: Static + +the body of a static statement + + + +#### 13. Interior: Switch + +The body of a switch statement + + + +#### 14. Interior: Switch case + +The body of a switch case branch + + + + + +#### 15. Interior: Try + +The body of a try/catch/finally branch + + + +#### 16. Interior: While + +The body of a while loop + + + +### Pair delimiter + +#### 1. Pair delimiter + +Internally used to add additional language specific surrounding pair delimiters in addition to the text based definitions. eg `r"`. + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 4. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/typescriptreact.mdx b/packages/app-web-docs/src/docs/user/languages/typescriptreact.mdx index 10b6aa61a54..7579a24445e 100644 --- a/packages/app-web-docs/src/docs/user/languages/typescriptreact.mdx +++ b/packages/app-web-docs/src/docs/user/languages/typescriptreact.mdx @@ -1,5 +1,1959 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # TypeScript React - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Anonymous function + +#### 1. Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + + + + + + + + + +### Argument list + +#### 1. Argument list: Actual constructor empty + +An empty list of arguments in a constructor call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual constructor multi line + +A multi line list of arguments in a constructor call. Insertion delimiter should include new line. + + + +#### 3. Argument list: Actual constructor single line + +A single line list of arguments in a constructor call + + + +#### 4. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 5. Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + + + +#### 6. Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + + + +#### 7. Argument list: Actual method single line + +A single line list of arguments in a method call + + + +#### 8. Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + + + +#### 9. Argument list: Actual single line + +A single line list of arguments in a function call + + + +#### 10. Argument list: Formal constructor empty + +An empty list of parameters in a constructor declaration. Insertion delimiter should be empty. + + + + + +#### 11. Argument list: Formal constructor multi line + +A multi line list of parameters in a constructor declaration. Insertion delimiter should include new line. + + + +#### 12. Argument list: Formal constructor single line + +A single line list of parameters in a constructor declaration + + + +#### 13. Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 14. Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + + + + + +#### 15. Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + + + + + +#### 16. Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + + + + + +#### 17. Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + + + + + + + + + + + + + + + + + + + + + +#### 18. Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + + + +#### 19. Argument list: Formal method single line + +A single line list of parameters in a class method declaration + + + +#### 20. Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + + + +#### 21. Argument list: Formal single line + +A single line list of parameters in a function declaration + + + +### Argument or parameter + +#### 1. Argument: Actual constructor multi line + +A multi line argument in a constructor call. Insertion delimiter should include new line. + + + +#### 2. Argument: Actual constructor single line + +A single line argument in a constructor call + + + +#### 3. Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + + + +#### 4. Argument: Actual method single line + +A single line argument in a method call + + + +#### 5. Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + + + +#### 6. Argument: Actual single line + +A single line argument in a function call + + + +#### 7. Argument: Formal catch + +A parameter in a catch clause + + + + + +#### 8. Argument: Formal constructor multi line + +A multi line parameter in a constructor declaration. Insertion delimiter should include new line. + + + +#### 9. Argument: Formal constructor single line + +A single line parameter in a constructor declaration + + + +#### 10. Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + + + +#### 11. Argument: Formal lambda single line + +A single line parameter in a lambda declaration + + + + + +#### 12. Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + + + +#### 13. Argument: Formal method single line + +A single line parameter in a class method declaration + + + +#### 14. Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + + + +#### 15. Argument: Formal single line + +A single line parameter in a function declaration + + + +#### 16. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +#### 17. Argument: Actual constructor (iteration) + +Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. + + + +#### 18. Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + + + +#### 19. Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 20. Argument: Formal constructor (iteration) + +Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. + + + + + +#### 21. Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + + + + + +#### 22. Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + + + + + + + + + + + + + + + + + +### Attribute + +#### 1. Attribute + +A attribute, eg of a html element or a C++ attribute + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: Ternary + +A branch in a ternary expression + + + +#### 6. Branch: Try + +A try/catch/finally branch + + + +#### 7. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + + + +#### 8. Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + + + +#### 9. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +#### 10. Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + + + +### Class + +#### 1. Class + +A class/struct in an object-oriented language + + + + + + + + + + + + + +#### 2. Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + + + +#### 3. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Collection key + +#### 1. Key: Attribute + +Key (LHS) of an attribute eg in a xml element + + + + + +#### 2. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + + + +#### 3. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + + + +#### 2. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: Do while + +A condition in a do while loop + + + +#### 2. Condition: For + +A condition in a for loop + + + +#### 3. Condition: If + +A condition in an if statement + + + +#### 4. Condition: Switch case + +A condition in a switch statement + + + +#### 5. Condition: Ternary + +A condition in a ternary expression + + + +#### 6. Condition: While + +A condition in a while loop + + + +#### 7. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + +#### 2. Function call: Chain + +A chain of function calls, eg `foo().bar()` + + + +#### 3. Function call: Constructor + +A constructor call + + + +#### 4. Function call: Generic + +A function call with generic type arguments + + + +#### 5. Function call: Method + +A method call + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + +#### 2. Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + + + +#### 3. Function callee: Constructor + +The class being constructed in a class instantiation, including the `new` keyword. + + + +#### 4. Function callee: Generic + +The function being called in a function call with generic type arguments + + + +#### 5. Function callee: Method + +The function being called in a method call, including parent objects. + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + +### Map + +#### 1. Map + +A map/dictionary + + + + + +### Name + +#### 1. Name: Argument catch + +Name of a parameter in a catch clause + + + +#### 2. Name: Argument formal + +Name of a parameter in a function declaration + + + + + + + + + +#### 3. Name: Argument formal constructor + +The name of a parameter in a constructor declaration + + + +#### 4. Name: Argument formal lambda + +Name of a parameter in a lambda declaration + + + +#### 5. Name: Argument formal method + +Name of a parameter in a class method declaration + + + +#### 6. Name: Assignment + +Name (LHS) of an assignment + + + +#### 7. Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + + + +#### 8. Name: Assignment destructuring + +LHS of an assignment with pattern destructuring + + + +#### 9. Name: Class + +Name of a class + + + + + + + + + + + + + +#### 10. Name: Constant + +Name (LHS) of a constant declaration + + + + + +#### 11. Name: Constructor + +Name of a constructor + + + + + +#### 12. Name: Enum + +Name of an enum + + + +#### 13. Name: Field class + +Name (LHS) of a field in a class + + + + + +#### 14. Name: Field enum + +Name (LHS) of a field in an enum + + + +#### 15. Name: Field interface + +Name (LHS) of a field in an interface + + + +#### 16. Name: Foreach + +Iteration variable name in a for each loop + + + + + +#### 17. Name: Function + +Name of a function + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 18. Name: Interface + +Name of a interface + + + +#### 19. Name: Method + +Name of a class method + + + + + + + + + + + + + + + + + + + + + +#### 20. Name: Method interface + +Name of a interface method + + + +#### 21. Name: Type alias + +Name of a type alias + + + +#### 22. Name: Variable destructuring + +Name (LHS) of a variable declaration with pattern destructuring + + + +#### 23. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + + + + + +#### 24. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + + + +#### 25. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 26. Name (iteration class) + +Iteration scope for names: class bodies. + + + + + +#### 27. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +#### 28. Name (iteration enum) + +Iteration scope for names: enum bodies. + + + +#### 29. Name (iteration interface) + +Iteration scope for names: interface bodies. + + + +#### 30. Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + + + +#### 31. Name: Argument formal constructor (iteration) + +Iteration scope for names of formal parameters in a constructor declaration: the parameters list. + + + +#### 32. Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + + + +#### 33. Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 2. Named function: Constructor + +A constructor declaration in a class + + + + + +#### 3. Named function: Method + +A named method declaration in a class + + + + + + + + + + + + + + + + + + + + + +#### 4. Named function (iteration class) + +Iteration scope for named functions: class bodies. + + + +#### 5. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Regular expression + +#### 1. Regular expression + +A regular expression + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Assignment destructuring + +An assignment statement with pattern destructuring + + + +#### 4. Statement: Break + +A break statement + + + +#### 5. Statement: Class + +A class/struct declaration + + + + + + + +#### 6. Statement: Constant + +A constant declaration + + + +#### 7. Statement: Constructor + +A constructor declaration + + + +#### 8. Statement: Continue + +A continue statement + + + +#### 9. Statement: Do while + +A do-while loop statement + + + +#### 10. Statement: Enum + +An enum declaration + + + +#### 11. Statement: Field class + +A field declaration in a class/struct + + + +#### 12. Statement: Field interface + +A field declaration in a interface + + + +#### 13. Statement: For + +A for loop statement + + + +#### 14. Statement: Foreach + +A for-each loop statement + + + + + +#### 15. Statement: Function + +A named function declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#### 16. Statement: Function call + +A function call statement + + + +#### 17. Statement: If + +A if/elif/else statement + + + +#### 18. Statement: Import + +An import statement + + + +#### 19. Statement: Interface + +An interface declaration + + + +#### 20. Statement: Method + +A method declaration + + + + + + + + + + + + + + + + + +#### 21. Statement: Method interface + +A method declaration in a interface + + + +#### 22. Statement: Misc + +A miscellaneous statement + + + +#### 23. Statement: Return + +A return statement + + + +#### 24. Statement: Static + +A static statement + + + +#### 25. Statement: Switch + +A switch statement + + + +#### 26. Statement: Throw + +A throw statement + + + +#### 27. Statement: Try + +A try/catch/finally statement + + + +#### 28. Statement: Type alias + +A type alias declaration + + + +#### 29. Statement: Update + +An update statement, eg ++/-- + + + + + +#### 30. Statement: Variable destructuring + +A variable declaration pattern destructuring + + + +#### 31. Statement: Variable initialized + +An initialized variable declaration + + + +#### 32. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 33. Statement: While + +A while loop statement + + + +#### 34. Statement: Yield + +A yield statement + + + +#### 35. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 36. Statement (iteration class) + +Iteration scope for statements: class bodies. + + + +#### 37. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +#### 38. Statement (iteration interface) + +Iteration scope for statements: interface bodies. + + + +### Type + +#### 1. Type: Alias + +A type alias declaration + + + + + +#### 2. Type: Argument catch + +Type of a parameter in a catch clause + + + +#### 3. Type: Argument formal + +Type of a formal parameter in a function declaration + + + + + +#### 4. Type: Argument formal constructor + +Type of a formal parameter in a constructor declaration + + + +#### 5. Type: Argument formal lambda + +Type of a formal parameter in a lambda declaration + + + +#### 6. Type: Argument formal method + +Type of a formal parameter in a class method declaration + + + +#### 7. Type: Cast + +A type cast + + + + + +#### 8. Type: Class + +A class declaration + + + + + + + + + + + + + +#### 9. Type: Constant + +Type of a constant declaration + + + +#### 10. Type: Enum + +An enum declaration + + + + + +#### 11. Type: Field class + +Type of a field in a class + + + +#### 12. Type: Field interface + +Type of a field in a interface + + + +#### 13. Type: Interface + +An interface declaration + + + +#### 14. Type: Return + +Type of a return value in a function declaration + + + + + +#### 15. Type: Return lambda + +Type of a return value in a lambda declaration + + + +#### 16. Type: Return method + +Type of a return value in a method declaration + + + +#### 17. Type: Type argument + +Type argument to a generic / parametrized type + + + + + +#### 18. Type: Variable initialized + +Type of an initialized variable declaration + + + +#### 19. Type: Variable uninitialized + +Type of an uninitialized variable declaration + + + +#### 20. Type (iteration block) + +Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + + + +#### 21. Type (iteration class) + +Iteration scope for types: class bodies. + + + +#### 22. Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + + + +#### 23. Type (iteration interface) + +Iteration scope for types: interface bodies. + + + +#### 24. Type: Argument formal (iteration) + +Iteration scope for types of formal parameters in a function declaration: the parameters list. + + + +#### 25. Type: Argument formal constructor (iteration) + +Iteration scope for types of formal parameters in a constructor declaration: the parameters list. + + + +#### 26. Type: Argument formal lambda (iteration) + +Iteration scope for types of formal parameters in a lambda declaration: the parameters list. + + + +#### 27. Type: Argument formal method (iteration) + +Iteration scope for types of formal parameters in a method declaration: the parameters list. + + + +#### 28. Type: Type argument (iteration) + +Iteration scope for type arguments to a generic / parametrized type: the type argument list. + + + +### Value + +#### 1. Value: Argument formal + +The (default) value of a argument in a function declaration + + + + + +#### 2. Value: Argument formal constructor + +The (default) value of a parameter in a constructor declaration + + + +#### 3. Value: Argument formal lambda + +The (default) value of a parameter in a lambda declaration + + + +#### 4. Value: Argument formal method + +The (default) value of a parameter in a method declaration + + + +#### 5. Value: Assignment + +Value (RHS) of an assignment + + + + + +#### 6. Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + + + +#### 7. Value: Assignment destructuring + +Value (RHS) of an assignment with pattern destructuring + + + +#### 8. Value: Attribute + +Value (RHS) of an attribute eg in a xml element + + + +#### 9. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 10. Value: Field class + +Value (RHS) of a field in a class + + + + + +#### 11. Value: Field enum + +Value (RHS) of a field in an enum + + + +#### 12. Value: Foreach + +Iterable in a for each loop + + + + + +#### 13. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + + + +#### 14. Value: Return + +Return value of a function + + + +#### 15. Value: Return lambda + +Implicit return value from a lambda + + + +#### 16. Value: Switch + +The value / subject of a switch statement + + + +#### 17. Value: Throw + +Value of a throw statement + + + +#### 18. Value: Type alias + +Value of a type alias declaration + + + + + +#### 19. Value: Variable + +Value (RHS) of a variable declaration + + + +#### 20. Value: Variable destructuring + +Value (RHS) of a variable declaration with pattern destructuring + + + +#### 21. Value: Yield + +Value of a yield statement + + + +#### 22. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 23. Value (iteration class) + +Iteration scope for values: class bodies. + + + + + +#### 24. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 25. Value (iteration enum) + +Iteration scope for values: enum bodies. + + + +#### 26. Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + + + +#### 27. Value: Argument formal constructor (iteration) + +Iteration scope for values of formal parameters in a constructor declaration: the parameters list. + + + +#### 28. Value: Argument formal lambda (iteration) + +Iteration scope for values of formal parameters in a lambda declaration: the parameters list. + + + +#### 29. Value: Argument formal method (iteration) + +Iteration scope for values of formal parameters in a method declaration: the parameters list. + + + +#### 30. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + + + +### Xml both tags + +#### 1. Tags + +Both tags in a xml element + + + +### Xml element + +#### 1. Element + +A xml/html element. Also used for LaTeX environments + + + +### Xml end tag + +#### 1. End tag + +The end tag of a xml element + + + +### Xml start tag + +#### 1. Start tag + +The start tag of a xml element + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + + + +### Interior + +#### 1. Interior: Class + +The body of a class + + + +#### 2. Interior: Constructor + +The body of a constructor declaration + + + +#### 3. Interior: Do while + +The body of a do-while loop + + + +#### 4. Interior: Element + +The interior/children of a XML element + + + +#### 5. Interior: Enum + +The body of an enum + + + +#### 6. Interior: For + +The body of a for loop + + + +#### 7. Interior: Foreach + +The body of a for-each loop + + + + + +#### 8. Interior: Function + +The body of a function declaration + + + +#### 9. Interior: If + +The body of an if/elif/else branch + + + +#### 10. Interior: Interface + +The body of a interface + + + +#### 11. Interior: Lambda + +The block body of a lambda/anonymous function + + + +#### 12. Interior: Method + +The body of a method declaration + + + +#### 13. Interior: Static + +the body of a static statement + + + +#### 14. Interior: Switch + +The body of a switch statement + + + +#### 15. Interior: Switch case + +The body of a switch case branch + + + + + +#### 16. Interior: Try + +The body of a try/catch/finally branch + + + +#### 17. Interior: While + +The body of a while loop + + + +### Pair delimiter + +#### 1. Pair delimiter + +Internally used to add additional language specific surrounding pair delimiters in addition to the text based definitions. eg `r"`. + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + + + +#### 2. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 3. Text fragment: Element + +Internally used text fragment consisting of a xml element interior + + + + + +#### 4. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 5. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/xml.mdx b/packages/app-web-docs/src/docs/user/languages/xml.mdx index 9e4d37f3ad4..01561346eda 100644 --- a/packages/app-web-docs/src/docs/user/languages/xml.mdx +++ b/packages/app-web-docs/src/docs/user/languages/xml.mdx @@ -1,5 +1,117 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # XML - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Attribute + +#### 1. Attribute + +A attribute, eg of a html element or a C++ attribute + + + +### Collection key + +#### 1. Key: Attribute + +Key (LHS) of an attribute eg in a xml element + + + +### Comment + +#### 1. Comment: Block + +A block comment + + + +### Value + +#### 1. Value: Attribute + +Value (RHS) of an attribute eg in a xml element + + + +### Xml both tags + +#### 1. Tags + +Both tags in a xml element + + + +### Xml element + +#### 1. Element + +A xml/html element. Also used for LaTeX environments + + + +### Xml end tag + +#### 1. End tag + +The end tag of a xml element + + + +### Xml start tag + +#### 1. Start tag + +The start tag of a xml element + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Interior + +#### 1. Interior: Element + +The interior/children of a XML element + + + +### String + +#### 1. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment block + +Internally used text fragment consisting of a block comment + + + +#### 2. Text fragment: Element + +Internally used text fragment consisting of a xml element interior + + + +#### 3. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/languages/yaml.mdx b/packages/app-web-docs/src/docs/user/languages/yaml.mdx index 63e1f6d33fe..5da8149c2f4 100644 --- a/packages/app-web-docs/src/docs/user/languages/yaml.mdx +++ b/packages/app-web-docs/src/docs/user/languages/yaml.mdx @@ -1,5 +1,131 @@ -import { Language } from "@site/src/docs/components/Language"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Yaml - + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Collection item + +#### 1. Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + + + +#### 2. Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair of a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Line + +A line comment + + + +### List + +#### 1. List + +A list/array + + + + + +### Map + +#### 1. Map + +A map/dictionary + + + +### Value + +#### 1. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 2. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Disqualify delimiter + +#### 1. Disqualify delimiter + +Internally used to disqualify a token from being treated as a surrounding pair delimiter. This will usually be operators containing `>` or `<`, eg `<`, `<=`, `->`, etc. + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + + + +### Text fragment + +#### 1. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 2. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 3. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/anonymousFunction.mdx b/packages/app-web-docs/src/docs/user/scopes/anonymousFunction.mdx index 4f079a186c6..c14512bd64a 100644 --- a/packages/app-web-docs/src/docs/user/scopes/anonymousFunction.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/anonymousFunction.mdx @@ -2,7 +2,7 @@ sidebar_label: Lambda --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Lambda (Anonymous function) @@ -20,4 +20,106 @@ Default: `lambda` - `"take lambda blue air"` - Selects the anonymous function containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Anonymous function + +An anonymous function, eg a lambda function, an arrow function, etc. + +##### Clojure + + + + + +##### C++ + + + + + +##### C# + + + + + +##### Dart + + + + + +##### Go + + + +##### Java + + + + + +##### JavaScript + + + + + + + + + +##### Kotlin + + + + + +##### Lua + + + +##### PHP + + + + + +##### Python + + + + + +##### R + + + + + +##### Ruby + + + + + + + +##### Rust + + + + + +##### Scala + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/argumentList.mdx b/packages/app-web-docs/src/docs/user/scopes/argumentList.mdx index b39436bbefa..c09a2101372 100644 --- a/packages/app-web-docs/src/docs/user/scopes/argumentList.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/argumentList.mdx @@ -2,7 +2,7 @@ sidebar_label: Arg list --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Arg list (Argument list) @@ -20,4 +20,1332 @@ Default: `arg list` - `"take arg list blue air"` - Selects the argument list containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Argument list: Actual constructor empty + +An empty list of arguments in a constructor call. Insertion delimiter should be empty. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Argument list: Actual constructor multi line + +A multi line list of arguments in a constructor call. Insertion delimiter should include new line. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Argument list: Actual constructor single line + +A single line list of arguments in a constructor call + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + +##### C + + + +##### Clojure + + + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Tree sitter query (SCM) + + + +##### Talon + + + +### Argument list: Actual enum empty + +An empty list of arguments in an enum constructor call. Insertion delimiter should be empty. + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### Rust + + + +### Argument list: Actual enum multi line + +A multi line list of arguments in an enum constructor call. Insertion delimiter should include new line. + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### Rust + + + +### Argument list: Actual enum single line + +A single line list of arguments in an enum constructor call + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### Rust + + + +### Argument list: Actual method empty + +An empty list of arguments in a method call. Insertion delimiter should be empty. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon + + + +### Argument list: Actual method multi line + +A multi line list of arguments in a method call. Insertion delimiter should include new line. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument list: Actual method single line + +A single line list of arguments in a method call + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon + + + +### Argument list: Actual multi line + +A multi line list of arguments in a function call. Insertion delimiter should include new line. + +##### C + + + +##### Clojure + + + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Tree sitter query (SCM) + + + +### Argument list: Actual single line + +A single line list of arguments in a function call + +##### C + + + +##### Clojure + + + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Tree sitter query (SCM) + + + +##### Talon + + + + + + + +### Argument list: Formal constructor empty + +An empty list of parameters in a constructor declaration. Insertion delimiter should be empty. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +##### TypeScript + + + +### Argument list: Formal constructor multi line + +A multi line list of parameters in a constructor declaration. Insertion delimiter should include new line. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Argument list: Formal constructor single line + +A single line list of parameters in a constructor declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Argument list: Formal empty + +An empty list of parameters in a function declaration. Insertion delimiter should be empty. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + + + +##### Rust + + + +##### Scala + + + + + +##### TypeScript + + + + + +### Argument list: Formal lambda empty + +An empty list of parameters in a lambda declaration. Insertion delimiter should be empty. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument list: Formal lambda multi line + +A multi line list of parameters in a lambda declaration. Insertion delimiter should include new line. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument list: Formal lambda single line + +A single line list of parameters in a lambda declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument list: Formal method empty + +An empty list of parameters in a class method declaration. Insertion delimiter should be empty. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + + + + + + + + + + + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + + + +### Argument list: Formal method multi line + +A multi line list of parameters in a class method declaration. Insertion delimiter should include new line. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument list: Formal method single line + +A single line list of parameters in a class method declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument list: Formal multi line + +A multi line list of parameters in a function declaration. Insertion delimiter should include new line. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + + + +##### Rust + + + +##### Scala + + + + + +### Argument list: Formal single line + +A single line list of parameters in a function declaration + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + + + +##### Rust + + + +##### Scala + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/argumentOrParameter.mdx b/packages/app-web-docs/src/docs/user/scopes/argumentOrParameter.mdx index 9ec8b10369a..2c4e72859d4 100644 --- a/packages/app-web-docs/src/docs/user/scopes/argumentOrParameter.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/argumentOrParameter.mdx @@ -2,7 +2,7 @@ sidebar_label: Arg --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Arg (Argument or parameter) @@ -20,4 +20,1392 @@ Default: `arg` - `"take arg blue air"` - Selects the argument or parameter containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Argument: Actual constructor multi line + +A multi line argument in a constructor call. Insertion delimiter should include new line. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Argument: Actual constructor single line + +A single line argument in a constructor call + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Argument: Actual enum multi line + +A multi line argument in an enum constructor call. Insertion delimiter should include new line. + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### Rust + + + +### Argument: Actual enum single line + +A single line argument in an enum constructor call + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### Rust + + + +### Argument: Actual method multi line + +A multi line argument in a method call. Insertion delimiter should include new line. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument: Actual method single line + +A single line argument in a method call + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument: Actual multi line + +A multiline argument in a function call. Insertion delimiter should include new line. + +##### C + + + +##### Clojure + + + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Latex + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + + + +##### Rust + + + +##### Scala + + + +##### Tree sitter query (SCM) + + + +##### SCSS + + + +### Argument: Actual single line + +A single line argument in a function call + +##### C + + + +##### Clojure + + + +##### C# + + + +##### CSS + + + + + + + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### Latex + + + +##### Lua + + + +##### PHP + + + +##### Python + + + + + +##### R + + + +##### Ruby + + + + + +##### Rust + + + +##### Scala + + + +##### Tree sitter query (SCM) + + + +##### SCSS + + + +##### Talon + + + + + + + +### Argument: Formal catch + +A parameter in a catch clause + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +##### TypeScript + + + +### Argument: Formal constructor multi line + +A multi line parameter in a constructor declaration. Insertion delimiter should include new line. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Argument: Formal constructor single line + +A single line parameter in a constructor declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Argument: Formal lambda multi line + +A multi line parameter in a lambda declaration. Insertion delimiter should include new line. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### R + + + +##### Ruby + + + +##### Rust + + + + + +##### Scala + + + +### Argument: Formal lambda single line + +A single line parameter in a lambda declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + + + +##### Scala + + + +### Argument: Formal method multi line + +A multi line parameter in a class method declaration. Insertion delimiter should include new line. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument: Formal method single line + +A single line parameter in a class method declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument: Formal multi line + +A multi line parameter in a function declaration. Insertion delimiter should include new line. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument: Formal single line + +A single line parameter in a function declaration + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + +##### C + + + +##### Clojure + + + +##### C# + + + +##### CSS + + + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Latex + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + + + +##### Rust + + + +##### Scala + + + +##### Tree sitter query (SCM) + + + +##### SCSS + + + +##### Talon + + + + + + + +### Argument: Actual constructor (iteration) + +Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Argument: Actual enum (iteration) + +Iteration scope for arguments in an enum constructor call: the argument list. The domain should be the entire enum constructor call.. + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### Rust + + + +### Argument: Actual method (iteration) + +Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument: Formal (iteration) + +Iteration scope for formal parameters in a function declaration: the parameters list. The domain should be the entire function. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Argument: Formal constructor (iteration) + +Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +##### TypeScript + + + +### Argument: Formal lambda (iteration) + +Iteration scope for formal parameters in a lambda declaration: the parameter list. The domain should be the entire lambda. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + + + +##### Scala + + + +### Argument: Formal method (iteration) + +Iteration scope for formal parameters in a method declaration: the parameter list. The domain should be the entire method. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + + + + + + + + + + + + + + + +##### Kotlin + + + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/attribute.mdx b/packages/app-web-docs/src/docs/user/scopes/attribute.mdx index 0883f693ae5..ee7aae7662f 100644 --- a/packages/app-web-docs/src/docs/user/scopes/attribute.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/attribute.mdx @@ -2,7 +2,7 @@ sidebar_label: Attribute --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Attribute @@ -20,4 +20,34 @@ Default: `attribute` - `"take attribute blue air"` - Selects the attribute containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Attribute + +A attribute, eg of a html element or a C++ attribute + +##### C++ + + + +##### C# + + + +##### HTML + + + +##### JavaScript React + + + +##### XML + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/boundedNonWhitespaceSequence.mdx b/packages/app-web-docs/src/docs/user/scopes/boundedNonWhitespaceSequence.mdx index a65a0b2cd40..1d9e46a1394 100644 --- a/packages/app-web-docs/src/docs/user/scopes/boundedNonWhitespaceSequence.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/boundedNonWhitespaceSequence.mdx @@ -2,7 +2,7 @@ sidebar_label: Short paint --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Short paint (Bounded non-whitespace sequence) @@ -22,4 +22,30 @@ Default: `short paint` - `"take short paint blue air"` - Selects the bounded non-whitespace sequence containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Bounded non whitespace sequence + +A sequence of non-whitespace characters bounded by matching pair + +##### Plaintext + + + + + + + +### Bounded non whitespace sequence (iteration) + +Iteration scope for bounded non-whitespace sequence + +##### Plaintext + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/boundedParagraph.mdx b/packages/app-web-docs/src/docs/user/scopes/boundedParagraph.mdx index 28148ab3535..a42418173f5 100644 --- a/packages/app-web-docs/src/docs/user/scopes/boundedParagraph.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/boundedParagraph.mdx @@ -2,7 +2,7 @@ sidebar_label: Short block --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Short block (Bounded paragraph) @@ -22,4 +22,36 @@ Default: `short block` - `"take short block blue air"` - Selects the bounded paragraph containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Bounded paragraph + +A single paragraph(contiguous block of lines) in the document bounded by matching pair + +##### Plaintext + + + + + + + + + + + + + +### Bounded paragraph (iteration) + +Iteration scope for bounded paragraph + +##### Plaintext + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/branch.mdx b/packages/app-web-docs/src/docs/user/scopes/branch.mdx index fb6554f2948..0e77dd0da8e 100644 --- a/packages/app-web-docs/src/docs/user/scopes/branch.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/branch.mdx @@ -2,7 +2,7 @@ sidebar_label: Branch --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Branch @@ -20,4 +20,610 @@ Default: `branch` - `"take branch blue air"` - Selects the branch containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Branch: If + +An if branch + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + +### Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + +### Branch: If else + +An if-else branch + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + +### Branch: Loop + +A for / while loop branch. For most languages this is not supported, but eg in Python you can have an else branch for a loop. + +##### Python + + + + + +### Branch: Switch case + +A case/default branch in a switch statement + +##### C + + + + + +##### C# + + + + + +##### Dart + + + + + +##### Go + + + + + +##### Java + + + + + +##### JavaScript + + + + + +##### Kotlin + + + + + +##### PHP + + + + + +##### Python + + + + + +##### R + + + + + + + +##### Ruby + + + + + + + +##### Rust + + + + + +##### Scala + + + + + +### Branch: Ternary + +A branch in a ternary expression + +##### C + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +### Branch: Try + +A try/catch/finally branch + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + + + +##### R + + + +##### Ruby + + + +##### Scala + + + +### Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if-else statement. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + +### Branch: Loop (iteration) + +Iteration scope for loop branches: the loop statement. + +##### Python + + + + + +### Branch: Switch case (iteration) + +Iteration scope for switch branches: the switch statement body. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + + + +##### Rust + + + +##### Scala + + + +### Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +### Branch: Try (iteration) + +Iteration scope for try/catch/finally branches: the try-catch statement. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Scala + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/chapter.mdx b/packages/app-web-docs/src/docs/user/scopes/chapter.mdx index 73665b30b38..4a5f782f39b 100644 --- a/packages/app-web-docs/src/docs/user/scopes/chapter.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/chapter.mdx @@ -2,8 +2,6 @@ sidebar_label: Chapter --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Chapter Cursorless ID: `chapter` @@ -19,5 +17,3 @@ Default: `chapter` ## Examples - `"take chapter blue air"` - Selects the chapter containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/character.mdx b/packages/app-web-docs/src/docs/user/scopes/character.mdx index 76077f663cd..8a5cd56355b 100644 --- a/packages/app-web-docs/src/docs/user/scopes/character.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/character.mdx @@ -2,7 +2,7 @@ sidebar_label: Char --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Char (Character) @@ -20,4 +20,18 @@ Default: `char` - `"take first char blue air"` - Selects the first character in the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Character + +A single character in the document + +##### Plaintext + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/class.mdx b/packages/app-web-docs/src/docs/user/scopes/class.mdx index 4f6022be2f3..0e686043df9 100644 --- a/packages/app-web-docs/src/docs/user/scopes/class.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/class.mdx @@ -2,7 +2,7 @@ sidebar_label: Class --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Class @@ -20,4 +20,178 @@ Default: `class` - `"take class blue air"` - Selects the class containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Class + +A class/struct in an object-oriented language + +##### C + + + + + + + + + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + + + +##### JavaScript + + + + + + + +##### Kotlin + + + + + + + + + +##### PHP + + + +##### Python + + + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + + + + + +### Class (iteration class) + +Iteration scope for classes: class bodies. + +##### C# + + + +##### Java + + + +##### Kotlin + + + +##### Python + + + +##### Ruby + + + +##### Scala + + + +### Class (iteration document) + +Iteration scope for classes: the entire document including leading and trailing empty lines. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/className.mdx b/packages/app-web-docs/src/docs/user/scopes/className.mdx index 528125bae02..f62da81a373 100644 --- a/packages/app-web-docs/src/docs/user/scopes/className.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/className.mdx @@ -2,8 +2,6 @@ sidebar_label: Class name --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Class name Cursorless ID: `className` @@ -19,5 +17,3 @@ Default: `class name` ## Examples - `"take class name blue air"` - Selects the class name containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/collectionItem.mdx b/packages/app-web-docs/src/docs/user/scopes/collectionItem.mdx index 91965692d33..aaa0f3ab30c 100644 --- a/packages/app-web-docs/src/docs/user/scopes/collectionItem.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/collectionItem.mdx @@ -2,7 +2,7 @@ sidebar_label: Item --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Item (Collection item) @@ -20,4 +20,244 @@ Default: `item` - `"take item blue air"` - Selects the collection item containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Collection item: Textual + +A text based collection item + +##### Plaintext + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +### Collection item: Unenclosed multi line + +An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. + +##### C + + + +##### C# + + + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### Java + + + + + + + +##### JavaScript + + + +##### Latex + + + +##### Lua + + + +##### Markdown + + + +##### Scala + + + +##### Yaml + + + +### Collection item: Unenclosed single line + +An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. + +##### C + + + +##### C# + + + + + +##### Dart + + + +##### Go + + + +##### Java + + + + + + + +##### JavaScript + + + +##### Lua + + + +##### Python + + + + + + + + + +##### Scala + + + +### Collection item: Textual (iteration) + +Iteration scope for text based collection items + +##### Plaintext + + + + + + + + + + + + + + + +### Collection item: Unenclosed (iteration) + +Iteration scope for items in a comma-separated list without enclosing delimiters + +##### C + + + +##### C# + + + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### Java + + + + + + + +##### JavaScript + + + +##### Latex + + + +##### Lua + + + +##### Markdown + + + +##### Python + + + + + + + + + +##### Scala + + + +##### Yaml + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/collectionKey.mdx b/packages/app-web-docs/src/docs/user/scopes/collectionKey.mdx index e9070e090ba..3aaa38b5e41 100644 --- a/packages/app-web-docs/src/docs/user/scopes/collectionKey.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/collectionKey.mdx @@ -2,7 +2,7 @@ sidebar_label: Key --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Key (Collection key) @@ -20,4 +20,180 @@ Default: `key` - `"take key blue air"` - Selects the collection key containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Key: Attribute + +Key (LHS) of an attribute eg in a xml element + +##### HTML + + + + + +##### JavaScript React + + + + + +##### XML + + + +### Key: Map pair + +Key (LHS) of a key-value pair of a map + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + + + +##### JSON + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Properties + + + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Talon-list + + + + + +##### Talon + + + + + +##### Yaml + + + +### Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + + + +##### JSON + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Properties + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Talon-list + + + +##### Talon + + + + + + + +##### Yaml + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/command.mdx b/packages/app-web-docs/src/docs/user/scopes/command.mdx index 62d0089222e..38b217c345e 100644 --- a/packages/app-web-docs/src/docs/user/scopes/command.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/command.mdx @@ -2,7 +2,7 @@ sidebar_label: Command --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Command @@ -20,4 +20,20 @@ Default: `command` - `"take command blue air"` - Selects the command containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Command + +A command, for example Talon spoken command or bash + +##### Talon + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/comment.mdx b/packages/app-web-docs/src/docs/user/scopes/comment.mdx index be6c916498a..f55e59f99ac 100644 --- a/packages/app-web-docs/src/docs/user/scopes/comment.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/comment.mdx @@ -2,7 +2,7 @@ sidebar_label: Comment --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Comment @@ -20,4 +20,190 @@ Default: `comment` - `"take comment blue air"` - Selects the comment containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Comment: Block + +A block comment + +##### C + + + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### HTML + + + +##### Java + + + + + +##### JavaScript + + + + + +##### JSON + + + +##### Kotlin + + + + + +##### Latex + + + +##### Lua + + + +##### Markdown + + + +##### PHP + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### XML + + + +### Comment: Line + +A line comment + +##### C + + + +##### Clojure + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### JSON + + + +##### Kotlin + + + +##### Latex + + + +##### Lua + + + +##### PHP + + + + + +##### Properties + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Tree sitter query (SCM) + + + +##### SCSS + + + +##### Talon-list + + + +##### Talon + + + +##### Yaml + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/condition.mdx b/packages/app-web-docs/src/docs/user/scopes/condition.mdx index 936d3997419..e2bc23fe2c3 100644 --- a/packages/app-web-docs/src/docs/user/scopes/condition.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/condition.mdx @@ -2,7 +2,7 @@ sidebar_label: Condition --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Condition @@ -20,4 +20,392 @@ Default: `condition` - `"take condition blue air"` - Selects the condition containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Condition: Do while + +A condition in a do while loop + +##### C + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Scala + + + +### Condition: For + +A condition in a for loop + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Lua + + + +##### PHP + + + +### Condition: If + +A condition in an if statement + +##### C + + + +##### Clojure + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + +##### Talon + + + +### Condition: Switch case + +A condition in a switch statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + + + +##### Java + + + + + + + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### R + + + + + +##### Ruby + + + + + + + + + +##### Rust + + + + + +##### Scala + + + + + +### Condition: Ternary + +A condition in a ternary expression + +##### C + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +### Condition: While + +A condition in a while loop + +##### C + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + + + +##### Rust + + + +##### Scala + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/document.mdx b/packages/app-web-docs/src/docs/user/scopes/document.mdx index 97d8e5b8980..60055b152f4 100644 --- a/packages/app-web-docs/src/docs/user/scopes/document.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/document.mdx @@ -2,7 +2,7 @@ sidebar_label: File --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # File (Document) @@ -22,4 +22,18 @@ Default: `file` - `"take file blue air"` - Selects the document containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Document + +The entire document + +##### Plaintext + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/environment.mdx b/packages/app-web-docs/src/docs/user/scopes/environment.mdx index 8083352037b..4fa8b978236 100644 --- a/packages/app-web-docs/src/docs/user/scopes/environment.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/environment.mdx @@ -2,7 +2,7 @@ sidebar_label: Environment --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Environment @@ -20,4 +20,18 @@ Default: `environment` - `"take environment blue air"` - Selects the environment containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Environment + +An environment, eg in LaTeX + +##### Latex + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/fullLine.mdx b/packages/app-web-docs/src/docs/user/scopes/fullLine.mdx index a3f665459e2..8d767c81e72 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fullLine.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/fullLine.mdx @@ -2,7 +2,7 @@ sidebar_label: Full line --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Full line @@ -20,4 +20,20 @@ Default: `full line` - `"take full line blue air"` - Selects the full line containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Full line + +A single full line in the document. Includes leading and trailing whitespace. + +##### Plaintext + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/functionCall.mdx b/packages/app-web-docs/src/docs/user/scopes/functionCall.mdx index cff994ddc2c..8df45ffeaaa 100644 --- a/packages/app-web-docs/src/docs/user/scopes/functionCall.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/functionCall.mdx @@ -2,7 +2,7 @@ sidebar_label: Call --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Call (Function call) @@ -20,4 +20,326 @@ Default: `call` - `"take call blue air"` - Selects the function call containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Function call + +A function call + +##### C + + + +##### Clojure + + + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Latex + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Tree sitter query (SCM) + + + +##### Talon + + + + + +### Function call: Chain + +A chain of function calls, eg `foo().bar()` + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Function call: Constructor + +A constructor call + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Function call: Enum + +An enum constructor call + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### Rust + + + +### Function call: Generic + +A function call with generic type arguments + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Function call: Method + +A method call + +##### C + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + + + +##### PHP + + + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/functionCallee.mdx b/packages/app-web-docs/src/docs/user/scopes/functionCallee.mdx index 568b09a60c4..9f1c5a355ea 100644 --- a/packages/app-web-docs/src/docs/user/scopes/functionCallee.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/functionCallee.mdx @@ -2,7 +2,7 @@ sidebar_label: Callee --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Callee (Function callee) @@ -20,4 +20,326 @@ Default: `callee` - `"take callee blue air"` - Selects the function callee containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Function callee + +The function being called in a function call + +##### C + + + +##### Clojure + + + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Latex + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Tree sitter query (SCM) + + + +##### Talon + + + + + +### Function callee: Chain + +The function being called in a chain of function calls, including parent objects. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Function callee: Constructor + +The class being constructed in a class instantiation, including the `new` keyword. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Function callee: Enum + +The enum constructor being called + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### Rust + + + +### Function callee: Generic + +The function being called in a function call with generic type arguments + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Function callee: Method + +The function being called in a method call, including parent objects. + +##### C + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + + + +##### PHP + + + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/functionName.mdx b/packages/app-web-docs/src/docs/user/scopes/functionName.mdx index d884b52efce..9042002514b 100644 --- a/packages/app-web-docs/src/docs/user/scopes/functionName.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/functionName.mdx @@ -2,8 +2,6 @@ sidebar_label: Funk name --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Funk name (Function name) Cursorless ID: `functionName` @@ -19,5 +17,3 @@ Default: `funk name` ## Examples - `"take funk name blue air"` - Selects the function name containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/glyph.mdx b/packages/app-web-docs/src/docs/user/scopes/glyph.mdx index 8cf44a78ff7..8cca9374424 100644 --- a/packages/app-web-docs/src/docs/user/scopes/glyph.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/glyph.mdx @@ -2,8 +2,6 @@ sidebar_label: Glyph --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Glyph Cursorless ID: `glyph` @@ -19,5 +17,3 @@ Default: `glyph` ## Examples - `"take next glyph air"` - Selects the next 'a'. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/identifier.mdx b/packages/app-web-docs/src/docs/user/scopes/identifier.mdx index f22193d14bf..16639301805 100644 --- a/packages/app-web-docs/src/docs/user/scopes/identifier.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/identifier.mdx @@ -2,7 +2,7 @@ sidebar_label: Identifier --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Identifier @@ -22,4 +22,18 @@ Default: `identifier` - `"take identifier blue air"` - Selects the identifier containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Identifier + +A single alphanumeric identifier in the document + +##### Plaintext + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/ifStatement.mdx b/packages/app-web-docs/src/docs/user/scopes/ifStatement.mdx index d4f7bbe84c0..d18f7f47b04 100644 --- a/packages/app-web-docs/src/docs/user/scopes/ifStatement.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/ifStatement.mdx @@ -2,7 +2,7 @@ sidebar_label: If state --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # If state (If statement) @@ -20,4 +20,82 @@ Default: `if state` - `"take if state blue air"` - Selects the if statement containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### If statement + +An if statement + +##### C + + + +##### Clojure + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + +##### Talon + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/instance.mdx b/packages/app-web-docs/src/docs/user/scopes/instance.mdx index 792a97eeaf7..686dd8cc4f5 100644 --- a/packages/app-web-docs/src/docs/user/scopes/instance.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/instance.mdx @@ -2,8 +2,6 @@ sidebar_label: Instance --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Instance Searches for occurrences of the input target's text. Instance matching preserves the target's scope type, so an instance of a token only matches complete tokens rather than substrings within larger tokens; apply [`"just"`](../modifiers/toRawSelection.mdx) to match the raw text instead. @@ -26,5 +24,3 @@ Default: `instance` - `"take every instance blue air past green bat"` - Selects every occurrence of the text spanning from the token containing letter 'a' with a blue hat through the token containing letter 'b' with a green hat. - `"take next instance blue air"` - Selects the next instance of the token containing letter 'a' with a blue hat. - `"take every instance"` - Selects every instance of the token touching the cursor. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/line.mdx b/packages/app-web-docs/src/docs/user/scopes/line.mdx index 40df716d2b4..349215ebbd7 100644 --- a/packages/app-web-docs/src/docs/user/scopes/line.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/line.mdx @@ -2,7 +2,7 @@ sidebar_label: Line --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Line @@ -20,4 +20,20 @@ Default: `line` - `"take line blue air"` - Selects the line containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Line + +A single line in the document. Excludes leading and trailing whitespace. + +##### Plaintext + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/list.mdx b/packages/app-web-docs/src/docs/user/scopes/list.mdx index 362e879c2f3..7d3155c1c30 100644 --- a/packages/app-web-docs/src/docs/user/scopes/list.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/list.mdx @@ -2,7 +2,7 @@ sidebar_label: List --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # List @@ -20,4 +20,110 @@ Default: `list` - `"take list blue air"` - Selects the list containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### List + +A list/array + +##### C + + + +##### Clojure + + + + + + + +##### C# + + + +##### Dart + + + +##### Go + + + + + + + +##### Java + + + +##### JavaScript + + + +##### JSON + + + +##### Latex + + + +##### Lua + + + +##### Markdown + + + +##### PHP + + + +##### Python + + + + + + + + + + + +##### R + + + +##### Ruby + + + + + + + +##### Rust + + + + + +##### Tree sitter query (SCM) + + + +##### Yaml + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/map.mdx b/packages/app-web-docs/src/docs/user/scopes/map.mdx index b6da3855d87..f7c92ac1ef0 100644 --- a/packages/app-web-docs/src/docs/user/scopes/map.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/map.mdx @@ -2,7 +2,7 @@ sidebar_label: Map --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Map @@ -20,4 +20,80 @@ Default: `map` - `"take map blue air"` - Selects the map containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Map + +A map/dictionary + +##### Clojure + + + + + +##### C# + + + +##### CSS + + + +##### Dart + + + + + +##### Go + + + + + + + +##### JavaScript + + + + + +##### JSON + + + +##### JSON lines (JSONL) + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Yaml + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/name.mdx b/packages/app-web-docs/src/docs/user/scopes/name.mdx index 39c36aa4ce7..79ddaf5f524 100644 --- a/packages/app-web-docs/src/docs/user/scopes/name.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/name.mdx @@ -2,7 +2,7 @@ sidebar_label: Name --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Name @@ -20,4 +20,2032 @@ Default: `name` - `"take name blue air"` - Selects the name containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Name: Argument actual + +Name of a (keyword) argument in a function call + +##### C# + + + +##### Dart + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Scala + + + +### Name: Argument catch + +Name of a parameter in a catch clause + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Name: Argument formal + +Name of a parameter in a function declaration + +##### C + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + + + +##### Kotlin + + + + + +##### Lua + + + +##### PHP + + + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + +##### TypeScript + + + + + +### Name: Argument formal constructor + +The name of a parameter in a constructor declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Name: Argument formal lambda + +Name of a parameter in a lambda declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Name: Argument formal method + +Name of a parameter in a class method declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Name: Assignment + +Name (LHS) of an assignment + +##### C + + + + + +##### C# + + + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + + + +##### PHP + + + + + +##### Python + + + +##### R + + + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon + + + +### Name: Assignment compound + +Name (LHS) of a compound assignment, eg +=/-= + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +### Name: Assignment destructuring + +LHS of an assignment with pattern destructuring + +##### JavaScript + + + +##### Lua + + + +##### Python + + + +##### Rust + + + +### Name: Class + +Name of a class + +##### C + + + + + + + + + + + + + +##### C++ + + + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + + + +##### JavaScript + + + + + + + +##### Kotlin + + + + + + + +##### PHP + + + +##### Python + + + + + +##### Ruby + + + +##### Rust + + + + + +##### Scala + + + +##### TypeScript + + + + + + + +### Name: Command + +LHS of a command, eg Talon spoken command or bash + +##### Talon + + + + + + + +### Name: Constant + +Name (LHS) of a constant declaration + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Name: Constructor + +Name of a constructor + +##### C++ + + + + + +##### C# + + + +##### Dart + + + +##### Java + + + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### TypeScript + + + +### Name: Enum + +Name of an enum + +##### C + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Name: Field class + +Name (LHS) of a field in a class + +##### C + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Name: Field enum + +Name (LHS) of a field in an enum + +##### C + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Name: Field interface + +Name (LHS) of a field in an interface + +##### C# + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Scala + + + +##### TypeScript + + + +### Name: Foreach + +Iteration variable name in a for each loop + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + + + +##### Talon + + + +### Name: Function + +Name of a function + +##### C + + + + + + + + + +##### Clojure + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + + + + + + + + + + + + + + + + + + + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + + + +##### R + + + +##### Ruby + + + + + + + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + + + +##### TypeScript + + + +### Name: Interface + +Name of a interface + +##### C# + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Scala + + + +##### TypeScript + + + +### Name: Method + +Name of a class method + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + + + +##### JavaScript + + + + + + + + + + + + + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + + + +### Name: Method interface + +Name of a interface method + +##### C# + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Scala + + + +##### TypeScript + + + +### Name: Namespace + +Name of a namespace + +##### C++ + + + +##### C# + + + +##### PHP + + + +##### Rust + + + +##### Scala + + + +### Name: Resource + +Name in a 'with' / 'use' / 'using' statement + +##### C# + + + +##### Java + + + +##### Python + + + +### Name: Type alias + +Name of a type alias + +##### C + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Kotlin + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Name: Variable destructuring + +Name (LHS) of a variable declaration with pattern destructuring + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +### Name: Variable initialized + +Name (LHS) of an initialized variable declaration + +##### C + + + +##### C# + + + + + +##### Dart + + + +##### Go + + + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Properties + + + + + +##### Python + + + +##### R + + + +##### Rust + + + +##### Scala + + + +##### Talon-list + + + + + +##### Talon + + + +##### TypeScript + + + + + +### Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + +##### C + + + + + + + +##### C# + + + + + + + + + +##### CSS + + + +##### Dart + + + + + + + + + +##### Go + + + + + + + +##### Java + + + + + + + + + +##### JavaScript + + + + + + + + + +##### Kotlin + + + + + + + + + +##### Lua + + + + + + + +##### PHP + + + + + + + + + +##### Python + + + + + + + + + +##### R + + + + + + + +##### Ruby + + + + + + + + + +##### Rust + + + + + + + +##### Scala + + + + + + + + + +##### SCSS + + + +##### Talon + + + + + + + +### Name (iteration class) + +Iteration scope for names: class bodies. + +##### C + + + + + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + + + + + +##### Scala + + + +##### TypeScript + + + +### Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + +##### C + + + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Properties + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + +##### Talon-list + + + +##### Talon + + + +### Name (iteration enum) + +Iteration scope for names: enum bodies. + +##### C + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Name (iteration interface) + +Iteration scope for names: interface bodies. + +##### C# + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Scala + + + +##### TypeScript + + + +### Name: Argument actual (iteration) + +Iteration scope for names of (keyword) arguments in a function call: the argument list. + +##### C# + + + +##### Dart + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Scala + + + +### Name: Argument formal (iteration) + +Iteration scope for names of formal parameters in a function declaration: the parameters list. + +##### C + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + +### Name: Argument formal constructor (iteration) + +Iteration scope for names of formal parameters in a constructor declaration: the parameters list. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Name: Argument formal lambda (iteration) + +Iteration scope for names of formal parameters in a lambda declaration: the parameters list. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Name: Argument formal method (iteration) + +Iteration scope for names of formal parameters in a method declaration: the parameters list. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx b/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx index 4ae0f275d3d..b1bbc9d3d0d 100644 --- a/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx @@ -2,7 +2,7 @@ sidebar_label: Funk --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Funk (Named function) @@ -20,4 +20,388 @@ Default: `funk` - `"take funk blue air"` - Selects the named function containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Named function + +A named function declaration + +##### C + + + + + + + + + +##### Clojure + + + +##### C# + + + +##### Dart + + + +##### Go + + + + + + + + + +##### JavaScript + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +##### Kotlin + + + + + +##### Lua + + + +##### PHP + + + + + + + +##### Python + + + + + +##### R + + + +##### Ruby + + + + + + + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + + + +##### TypeScript + + + + + +### Named function: Constructor + +A constructor declaration in a class + +##### C++ + + + + + +##### C# + + + +##### Dart + + + +##### Java + + + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### TypeScript + + + +### Named function: Method + +A named method declaration in a class + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + + + +##### JavaScript + + + + + + + + + + + + + + + + + +##### Kotlin + + + + + + + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + + + +### Named function (iteration class) + +Iteration scope for named functions: class bodies. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + + + +##### Scala + + + +##### SCSS + + + +### Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + +##### C + + + +##### Clojure + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/namedParagraph.mdx b/packages/app-web-docs/src/docs/user/scopes/namedParagraph.mdx index 55afe80ba5e..0d4cce192de 100644 --- a/packages/app-web-docs/src/docs/user/scopes/namedParagraph.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/namedParagraph.mdx @@ -2,8 +2,6 @@ sidebar_label: Paragraph --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Paragraph (Named paragraph) Cursorless ID: `namedParagraph` @@ -19,5 +17,3 @@ Default: `paragraph` ## Examples - `"take paragraph blue air"` - Selects the named paragraph containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/nonWhitespaceSequence.mdx b/packages/app-web-docs/src/docs/user/scopes/nonWhitespaceSequence.mdx index 8f4ed905da1..403edf87d32 100644 --- a/packages/app-web-docs/src/docs/user/scopes/nonWhitespaceSequence.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/nonWhitespaceSequence.mdx @@ -2,7 +2,7 @@ sidebar_label: Paint --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Paint (Non-whitespace sequence) @@ -22,4 +22,18 @@ Default: `paint` - `"take paint blue air"` - Selects the non-whitespace sequence containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Non whitespace sequence + +A sequence of non-whitespace characters + +##### Plaintext + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/notebookCell.mdx b/packages/app-web-docs/src/docs/user/scopes/notebookCell.mdx index 3be71e4309d..915bfc2df6b 100644 --- a/packages/app-web-docs/src/docs/user/scopes/notebookCell.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/notebookCell.mdx @@ -2,7 +2,7 @@ sidebar_label: Cell --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Cell (Notebook cell) @@ -20,4 +20,20 @@ Default: `cell` - `"take cell blue air"` - Selects the notebook cell containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Notebook cell + +A cell in a notebook or a markdown code block + +##### Markdown + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/paragraph.mdx b/packages/app-web-docs/src/docs/user/scopes/paragraph.mdx index 3b17a423a25..4c17860ba90 100644 --- a/packages/app-web-docs/src/docs/user/scopes/paragraph.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/paragraph.mdx @@ -2,7 +2,7 @@ sidebar_label: Block --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Block (Paragraph) @@ -22,4 +22,18 @@ Default: `block` - `"take block blue air"` - Selects the paragraph containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Paragraph + +A single paragraph(contiguous block of lines) in the document + +##### Plaintext + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/part.mdx b/packages/app-web-docs/src/docs/user/scopes/part.mdx index 322db0d0fca..64099e4aec6 100644 --- a/packages/app-web-docs/src/docs/user/scopes/part.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/part.mdx @@ -2,8 +2,6 @@ sidebar_label: Part --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Part Cursorless ID: `part` @@ -19,5 +17,3 @@ Default: `part` ## Examples - `"take part blue air"` - Selects the part containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/regularExpression.mdx b/packages/app-web-docs/src/docs/user/scopes/regularExpression.mdx index 3c15712adf7..f5655dabbc5 100644 --- a/packages/app-web-docs/src/docs/user/scopes/regularExpression.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/regularExpression.mdx @@ -2,7 +2,7 @@ sidebar_label: Regex --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Regex (Regular expression) @@ -20,4 +20,22 @@ Default: `regex` - `"take regex blue air"` - Selects the regular expression containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Regular expression + +A regular expression + +##### JavaScript + + + +##### Ruby + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/section.mdx b/packages/app-web-docs/src/docs/user/scopes/section.mdx index c8d4e76295b..36318304817 100644 --- a/packages/app-web-docs/src/docs/user/scopes/section.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/section.mdx @@ -2,7 +2,7 @@ sidebar_label: Section --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Section @@ -20,4 +20,42 @@ Default: `section` - `"take section blue air"` - Selects the section containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Section + +A document section + +##### Latex + + + +##### Markdown + + + +### Section (iteration document) + +Iteration scope for sections: the entire document including leading and trailing empty lines. + +##### Latex + + + +##### Markdown + + + +### Section (iteration parent) + +Iteration scope for sections: the parent section. + +##### Markdown + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/sectionLevelFive.mdx b/packages/app-web-docs/src/docs/user/scopes/sectionLevelFive.mdx index f0bc7e49c3f..c5631ac3b7e 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sectionLevelFive.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sectionLevelFive.mdx @@ -2,8 +2,6 @@ sidebar_label: Five section --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Five section (Section level five) Cursorless ID: `sectionLevelFive` @@ -20,5 +18,3 @@ Default: `five section`\ ## Examples - `"take five section blue air"` - Selects the section level five containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/sectionLevelFour.mdx b/packages/app-web-docs/src/docs/user/scopes/sectionLevelFour.mdx index 24ebf154266..2815abbf6ad 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sectionLevelFour.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sectionLevelFour.mdx @@ -2,8 +2,6 @@ sidebar_label: Four section --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Four section (Section level four) Cursorless ID: `sectionLevelFour` @@ -20,5 +18,3 @@ Default: `four section`\ ## Examples - `"take four section blue air"` - Selects the section level four containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/sectionLevelOne.mdx b/packages/app-web-docs/src/docs/user/scopes/sectionLevelOne.mdx index de34f5c132d..356b6dd9866 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sectionLevelOne.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sectionLevelOne.mdx @@ -2,8 +2,6 @@ sidebar_label: One section --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # One section (Section level one) Cursorless ID: `sectionLevelOne` @@ -20,5 +18,3 @@ Default: `one section`\ ## Examples - `"take one section blue air"` - Selects the section level one containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/sectionLevelSix.mdx b/packages/app-web-docs/src/docs/user/scopes/sectionLevelSix.mdx index 4657c14d6cb..b854c063935 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sectionLevelSix.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sectionLevelSix.mdx @@ -2,8 +2,6 @@ sidebar_label: Six section --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Six section (Section level six) Cursorless ID: `sectionLevelSix` @@ -20,5 +18,3 @@ Default: `six section`\ ## Examples - `"take six section blue air"` - Selects the section level six containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/sectionLevelThree.mdx b/packages/app-web-docs/src/docs/user/scopes/sectionLevelThree.mdx index 8a6d26e1859..3489dc30777 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sectionLevelThree.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sectionLevelThree.mdx @@ -2,8 +2,6 @@ sidebar_label: Three section --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Three section (Section level three) Cursorless ID: `sectionLevelThree` @@ -20,5 +18,3 @@ Default: `three section`\ ## Examples - `"take three section blue air"` - Selects the section level three containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/sectionLevelTwo.mdx b/packages/app-web-docs/src/docs/user/scopes/sectionLevelTwo.mdx index 8fe88e3c175..e97ec1a211a 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sectionLevelTwo.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sectionLevelTwo.mdx @@ -2,8 +2,6 @@ sidebar_label: Two section --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Two section (Section level two) Cursorless ID: `sectionLevelTwo` @@ -20,5 +18,3 @@ Default: `two section`\ ## Examples - `"take two section blue air"` - Selects the section level two containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/selector.mdx b/packages/app-web-docs/src/docs/user/scopes/selector.mdx index 6e1e7ec59e4..98c04ac70e8 100644 --- a/packages/app-web-docs/src/docs/user/scopes/selector.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/selector.mdx @@ -2,7 +2,7 @@ sidebar_label: Selector --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Selector @@ -20,4 +20,30 @@ Default: `selector` - `"take selector blue air"` - Selects the selector containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Selector + +A selector in a css rule set + +##### CSS + + + + + + + + + + + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/sentence.mdx b/packages/app-web-docs/src/docs/user/scopes/sentence.mdx index 775011df5af..f438ed3f577 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sentence.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sentence.mdx @@ -2,7 +2,7 @@ sidebar_label: Sentence --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Sentence @@ -20,4 +20,24 @@ Default: `sentence` - `"take sentence blue air"` - Selects the sentence containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Sentence + +A single sentence in the document + +##### Plaintext + + + + + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/statement.mdx b/packages/app-web-docs/src/docs/user/scopes/statement.mdx index 63eecf47996..59446d95749 100644 --- a/packages/app-web-docs/src/docs/user/scopes/statement.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/statement.mdx @@ -2,7 +2,7 @@ sidebar_label: State --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # State (Statement) @@ -20,4 +20,2076 @@ Default: `state` - `"take state blue air"` - Selects the statement containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Statement: Assignment + +An assignment statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon + + + +### Statement: Assignment compound + +A compound assignment statement, eg +=/-= + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +### Statement: Assignment destructuring + +An assignment statement with pattern destructuring + +##### JavaScript + + + +##### Lua + + + +##### Python + + + +##### Rust + + + +### Statement: Break + +A break statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +### Statement: Class + +A class/struct declaration + +##### C + + + + + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + + + +##### JavaScript + + + + + + + +##### Kotlin + + + + + + + +##### PHP + + + +##### Python + + + + + +##### Ruby + + + +##### Rust + + + + + + + +##### Scala + + + +### Statement: Command + +A command statement, eg Talon spoken command or bash + +##### Talon + + + +### Statement: Constant + +A constant declaration + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Rust + + + +##### Scala + + + +### Statement: Constructor + +A constructor declaration + +##### C++ + + + + + +##### C# + + + +##### Dart + + + +##### Java + + + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +### Statement: Continue + +A continue statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +### Statement: Do while + +A do-while loop statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Scala + + + +### Statement: Enum + +An enum declaration + +##### C + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Statement: Field class + +A field declaration in a class/struct + +##### C + + + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +### Statement: Field interface + +A field declaration in a interface + +##### C# + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + + + +##### Scala + + + +##### TypeScript + + + +### Statement: For + +A for loop statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Lua + + + +##### PHP + + + +### Statement: Foreach + +A for-each loop statement + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon + + + +### Statement: Function + +A named function declaration + +##### C + + + + + + + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + + + +##### R + + + +##### Ruby + + + + + + + + + +##### Rust + + + +##### Scala + + + +### Statement: Function call + +A function call statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Latex + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon + + + +### Statement: If + +A if/elif/else statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon + + + +### Statement: Import + +An import statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +### Statement: Interface + +An interface declaration + +##### C# + + + +##### Go + + + +##### Java + + + + + +##### Kotlin + + + +##### PHP + + + +##### Scala + + + +##### TypeScript + + + +### Statement: Method + +A method declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + + + +##### JavaScript + + + + + + + + + + + + + + + + + +##### Kotlin + + + + + + + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Statement: Method interface + +A method declaration in a interface + +##### C# + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Scala + + + +##### TypeScript + + + +### Statement: Misc + +A miscellaneous statement + +##### CSS + + + +##### Java + + + +##### Ruby + + + +##### Tree sitter query (SCM) + + + +##### TypeScript + + + +### Statement: Namespace + +A namespace declaration + +##### C++ + + + +##### C# + + + +##### PHP + + + +##### Rust + + + +##### Scala + + + +### Statement: Package + +A package declaration + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### Rust + + + +##### Scala + + + +### Statement: Resource + +A 'with' / 'use' / 'using' statement + +##### C# + + + +##### Java + + + +##### Python + + + +### Statement: Return + +A return statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Statement: Static + +A static statement + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +### Statement: Switch + +A switch statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + + + +##### Rust + + + +##### Scala + + + +### Statement: Throw + +A throw statement + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Scala + + + +### Statement: Try + +A try/catch/finally statement + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Scala + + + +### Statement: Type alias + +A type alias declaration + +##### C + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Kotlin + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Statement: Update + +An update statement, eg ++/-- + +##### C + + + +##### C# + + + + + +##### Dart + + + +##### Go + + + + + +##### Java + + + + + +##### JavaScript + + + + + +##### Kotlin + + + + + +##### PHP + + + +##### Rust + + + + + +##### Scala + + + + + +### Statement: Variable destructuring + +A variable declaration pattern destructuring + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +### Statement: Variable initialized + +An initialized variable declaration + +##### C + + + +##### C# + + + + + +##### Dart + + + +##### Go + + + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Properties + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon-list + + + + + +##### Talon + + + +### Statement: Variable uninitialized + +An uninitialized variable declaration + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +### Statement: While + +A while loop statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Statement: Yield + +A yield statement + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +### Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + +##### C + + + + + + + +##### C# + + + + + + + + + +##### Dart + + + + + + + + + +##### Go + + + + + + + +##### Java + + + + + + + + + +##### JavaScript + + + + + + + + + +##### Kotlin + + + + + + + + + +##### Lua + + + + + + + +##### PHP + + + + + + + + + +##### Python + + + + + + + + + +##### R + + + + + + + +##### Ruby + + + + + + + + + +##### Rust + + + + + + + +##### Scala + + + + + + + + + +##### Talon + + + +### Statement (iteration class) + +Iteration scope for statements: class bodies. + +##### C + + + + + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + + + + + +##### Scala + + + +### Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + +##### C + + + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Properties + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon-list + + + +##### Talon + + + +### Statement (iteration interface) + +Iteration scope for statements: interface bodies. + +##### C# + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Scala + + + +##### TypeScript + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/subParagraph.mdx b/packages/app-web-docs/src/docs/user/scopes/subParagraph.mdx index 1d6ff474ae3..6790bdaf0db 100644 --- a/packages/app-web-docs/src/docs/user/scopes/subParagraph.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/subParagraph.mdx @@ -2,8 +2,6 @@ sidebar_label: Subparagraph --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Subparagraph Cursorless ID: `subParagraph` @@ -19,5 +17,3 @@ Default: `subparagraph` ## Examples - `"take subparagraph blue air"` - Selects the subparagraph containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/subSection.mdx b/packages/app-web-docs/src/docs/user/scopes/subSection.mdx index 6796f651c26..81c99ac1f3d 100644 --- a/packages/app-web-docs/src/docs/user/scopes/subSection.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/subSection.mdx @@ -2,8 +2,6 @@ sidebar_label: Subsection --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Subsection Cursorless ID: `subSection` @@ -19,5 +17,3 @@ Default: `subsection` ## Examples - `"take subsection blue air"` - Selects the subsection containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/subSubSection.mdx b/packages/app-web-docs/src/docs/user/scopes/subSubSection.mdx index c6900f121c2..db6058bbe74 100644 --- a/packages/app-web-docs/src/docs/user/scopes/subSubSection.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/subSubSection.mdx @@ -2,8 +2,6 @@ sidebar_label: Subsubsection --- -import { Scopes } from "@site/src/docs/components/Scopes"; - # Subsubsection Cursorless ID: `subSubSection` @@ -19,5 +17,3 @@ Default: `subsubsection` ## Examples - `"take subsubsection blue air"` - Selects the subsubsection containing the token containing letter 'a' with a blue hat. - - diff --git a/packages/app-web-docs/src/docs/user/scopes/surroundingPair.mdx b/packages/app-web-docs/src/docs/user/scopes/surroundingPair.mdx index 0b3b55c0378..e6581a35cb8 100644 --- a/packages/app-web-docs/src/docs/user/scopes/surroundingPair.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/surroundingPair.mdx @@ -1,4 +1,4 @@ -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Surrounding pair @@ -16,4 +16,38 @@ Cursorless ID: `surroundingPair` - `"take round blue air"` - Selects the parentheses containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Surrounding pair + +A delimiter pair, such as parentheses or quotes + +##### Plaintext + + + + + + + + + + + + + +### Surrounding pair (iteration) + +The iteration scope for delimiter pairs + +##### Plaintext + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/token.mdx b/packages/app-web-docs/src/docs/user/scopes/token.mdx index fc60454aef5..63f5041bbd9 100644 --- a/packages/app-web-docs/src/docs/user/scopes/token.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/token.mdx @@ -2,7 +2,7 @@ sidebar_label: Token --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Token @@ -22,4 +22,18 @@ Default: `token` - `"take token blue air"` - Selects the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Token + +A single token in the document + +##### Plaintext + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/type.mdx b/packages/app-web-docs/src/docs/user/scopes/type.mdx index 700e0624992..626ffca0b4f 100644 --- a/packages/app-web-docs/src/docs/user/scopes/type.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/type.mdx @@ -2,7 +2,7 @@ sidebar_label: Type --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Type @@ -20,4 +20,1366 @@ Default: `type` - `"take type blue air"` - Selects the type containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Type: Alias + +A type alias declaration + +##### C + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Kotlin + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + + + +### Type: Argument catch + +Type of a parameter in a catch clause + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +##### TypeScript + + + +### Type: Argument formal + +Type of a formal parameter in a function declaration + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Kotlin + + + + + +##### PHP + + + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + + + +### Type: Argument formal constructor + +Type of a formal parameter in a constructor declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +##### TypeScript + + + +### Type: Argument formal lambda + +Type of a formal parameter in a lambda declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Type: Argument formal method + +Type of a formal parameter in a class method declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Type: Cast + +A type cast + +##### C + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### PHP + + + +##### Rust + + + +##### TypeScript + + + + + + + +### Type: Class + +A class declaration + +##### C + + + + + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + + + + + +##### PHP + + + +##### Python + + + + + +##### Rust + + + + + + + + + +##### Scala + + + +##### TypeScript + + + + + + + + + + + + + +### Type: Constant + +Type of a constant declaration + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Type: Enum + +An enum declaration + +##### C + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + + + +### Type: Field class + +Type of a field in a class + +##### C + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Type: Field interface + +Type of a field in a interface + +##### C# + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Scala + + + +##### TypeScript + + + +### Type: Foreach + +Type of a variable in a for each loop + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### Kotlin + + + +##### Scala + + + +### Type: Interface + +An interface declaration + +##### C# + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Scala + + + +##### TypeScript + + + +### Type: Resource + +Type in a 'with' / 'use' / 'using' statement + +##### C# + + + +##### Java + + + +### Type: Return + +Type of a return value in a function declaration + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Kotlin + + + + + + + + + + + +##### PHP + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + + + +### Type: Return lambda + +Type of a return value in a lambda declaration + +##### C++ + + + +##### Go + + + +##### PHP + + + + + +##### Rust + + + +##### TypeScript + + + +### Type: Return method + +Type of a return value in a method declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Type: Type argument + +Type argument to a generic / parametrized type + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### Python + + + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + + + +### Type: Variable initialized + +Type of an initialized variable declaration + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Type: Variable uninitialized + +Type of an uninitialized variable declaration + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + + + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Type (iteration block) + +Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). + +##### C + + + + + + + +##### C# + + + + + + + + + +##### Dart + + + + + + + + + +##### Go + + + + + + + +##### Java + + + + + + + + + +##### Kotlin + + + + + + + + + +##### Python + + + + + + + + + +##### Rust + + + + + + + +##### Scala + + + + + + + + + +##### TypeScript + + + + + + + + + +### Type (iteration class) + +Iteration scope for types: class bodies. + +##### C + + + + + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Rust + + + + + + + +##### Scala + + + +##### TypeScript + + + +### Type (iteration document) + +Iteration scope for types: the entire document including leading and trailing empty lines. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Type (iteration interface) + +Iteration scope for types: interface bodies. + +##### C# + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Scala + + + +##### TypeScript + + + +### Type: Argument formal (iteration) + +Iteration scope for types of formal parameters in a function declaration: the parameters list. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Type: Argument formal constructor (iteration) + +Iteration scope for types of formal parameters in a constructor declaration: the parameters list. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +##### TypeScript + + + +### Type: Argument formal lambda (iteration) + +Iteration scope for types of formal parameters in a lambda declaration: the parameters list. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Type: Argument formal method (iteration) + +Iteration scope for types of formal parameters in a method declaration: the parameters list. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + +### Type: Type argument (iteration) + +Iteration scope for type arguments to a generic / parametrized type: the type argument list. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### Kotlin + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/unit.mdx b/packages/app-web-docs/src/docs/user/scopes/unit.mdx index ec021debbd3..81308329f77 100644 --- a/packages/app-web-docs/src/docs/user/scopes/unit.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/unit.mdx @@ -2,7 +2,7 @@ sidebar_label: Unit --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Unit @@ -20,4 +20,26 @@ Default: `unit` - `"take unit blue air"` - Selects the unit containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Unit + +A unit in a css rule set + +##### CSS + + + + + + + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/url.mdx b/packages/app-web-docs/src/docs/user/scopes/url.mdx index 77b2c7c01f7..fec0511fa93 100644 --- a/packages/app-web-docs/src/docs/user/scopes/url.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/url.mdx @@ -2,7 +2,7 @@ sidebar_label: Link --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Link (URL) @@ -20,4 +20,24 @@ Default: `link` - `"take link blue air"` - Selects the url containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Url + +A url + +##### Plaintext + + + + + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/value.mdx b/packages/app-web-docs/src/docs/user/scopes/value.mdx index 8d3f3370882..3dc9d4fcd81 100644 --- a/packages/app-web-docs/src/docs/user/scopes/value.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/value.mdx @@ -2,7 +2,7 @@ sidebar_label: Value --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Value @@ -20,4 +20,1658 @@ Default: `value` - `"take value blue air"` - Selects the value containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Value: Argument actual + +The value of a (keyword) argument in a function call + +##### C# + + + +##### Dart + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Scala + + + +### Value: Argument formal + +The (default) value of a argument in a function declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Scala + + + +##### SCSS + + + +##### TypeScript + + + +### Value: Argument formal constructor + +The (default) value of a parameter in a constructor declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Value: Argument formal lambda + +The (default) value of a parameter in a lambda declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### JavaScript + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +### Value: Argument formal method + +The (default) value of a parameter in a method declaration + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Scala + + + +### Value: Assignment + +Value (RHS) of an assignment + +##### C + + + + + +##### C# + + + + + +##### Dart + + + +##### Go + + + +##### Java + + + + + +##### JavaScript + + + + + +##### Kotlin + + + +##### Lua + + + + + +##### PHP + + + + + +##### Python + + + + + +##### R + + + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon + + + +### Value: Assignment compound + +Value (RHS) of a compound assignment, eg +=/-= + +##### C + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +### Value: Assignment destructuring + +Value (RHS) of an assignment with pattern destructuring + +##### JavaScript + + + +##### Lua + + + +##### Python + + + +##### Rust + + + +### Value: Attribute + +Value (RHS) of an attribute eg in a xml element + +##### HTML + + + +##### JavaScript React + + + +##### XML + + + +### Value: Command + +Value (RHS) of an command, eg Talon spoken command + +##### Talon + + + +### Value: Constant + +Value (RHS) of a constant declaration + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Rust + + + +##### Scala + + + +### Value: Field class + +Value (RHS) of a field in a class + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +##### TypeScript + + + +### Value: Field enum + +Value (RHS) of a field in an enum + +##### C + + + +##### C++ + + + +##### C# + + + +##### PHP + + + +##### TypeScript + + + +### Value: Field interface + +Value (RHS) of a field in an interface + +##### C# + + + +##### Java + + + +##### PHP + + + +##### Scala + + + +### Value: Foreach + +Iterable in a for each loop + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon + + + +### Value: Map pair + +Value (RHS) of a key-value pair in a map + +##### C# + + + +##### CSS + + + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + + + +##### JSON + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Properties + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Talon-list + + + +##### Talon + + + + + +##### Yaml + + + +### Value: Resource + +Value of a 'with' / 'use' / 'using' statement + +##### C# + + + +##### Java + + + +### Value: Return + +Return value of a function + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### SCSS + + + +### Value: Return lambda + +Implicit return value from a lambda + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +### Value: Switch + +The value / subject of a switch statement + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + + + +##### Rust + + + +##### Scala + + + +### Value: Throw + +Value of a throw statement + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Scala + + + +### Value: Type alias + +Value of a type alias declaration + +##### C + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Kotlin + + + + + +##### Rust + + + +##### Scala + + + +##### TypeScript + + + + + +### Value: Variable + +Value (RHS) of a variable declaration + +##### C + + + +##### C# + + + + + +##### Dart + + + +##### Go + + + + + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + + + + + + + + + +##### Lua + + + +##### PHP + + + +##### Properties + + + +##### Python + + + + + +##### R + + + +##### Ruby + + + +##### Rust + + + + + +##### Scala + + + + + +##### Talon-list + + + + + +##### Talon + + + +### Value: Variable destructuring + +Value (RHS) of a variable declaration with pattern destructuring + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### Python + + + +##### Rust + + + +##### Scala + + + +### Value: Yield + +Value of a yield statement + +##### C# + + + +##### Dart + + + +##### Java + + + +##### JavaScript + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +### Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + +##### C + + + + + + + +##### C# + + + + + + + + + +##### Dart + + + + + + + + + +##### Go + + + + + + + +##### Java + + + + + + + + + +##### JavaScript + + + + + + + +##### Kotlin + + + + + + + + + +##### Lua + + + + + + + +##### PHP + + + + + + + + + +##### Python + + + + + + + + + +##### R + + + + + + + +##### Ruby + + + + + + + + + +##### Rust + + + + + + + +##### Scala + + + + + + + + + +##### Talon + + + + + + + +### Value (iteration class) + +Iteration scope for values: class bodies. + +##### C + + + + + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### Java + + + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + + + + + +##### Scala + + + +##### TypeScript + + + +### Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + +##### C + + + +##### C# + + + +##### Dart + + + +##### Go + + + +##### Java + + + +##### JavaScript + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Properties + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Rust + + + +##### Scala + + + +##### Talon-list + + + +##### Talon + + + +### Value (iteration enum) + +Iteration scope for values: enum bodies. + +##### C + + + +##### C++ + + + +##### C# + + + +##### PHP + + + +##### TypeScript + + + +### Value: Argument actual (iteration) + +Iteration scope for values of (keyword) arguments in a function call: the arguments list. + +##### C# + + + +##### Dart + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Scala + + + +### Value: Argument formal (iteration) + +Iteration scope for values of formal parameters in a function declaration: the parameters list. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +##### Scala + + + +##### SCSS + + + +### Value: Argument formal constructor (iteration) + +Iteration scope for values of formal parameters in a constructor declaration: the parameters list. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### JavaScript + + + +##### Kotlin + + + + + +##### PHP + + + +##### Python + + + +##### Scala + + + +### Value: Argument formal lambda (iteration) + +Iteration scope for values of formal parameters in a lambda declaration: the parameters list. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### JavaScript + + + +##### PHP + + + +##### Python + + + +##### R + + + +##### Ruby + + + +### Value: Argument formal method (iteration) + +Iteration scope for values of formal parameters in a method declaration: the parameters list. + +##### C++ + + + +##### C# + + + +##### Dart + + + +##### JavaScript + + + +##### Kotlin + + + +##### PHP + + + +##### Python + + + +##### Ruby + + + +##### Scala + + + +### Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + +##### C# + + + +##### CSS + + + +##### Dart + + + +##### Go + + + +##### JavaScript + + + + + +##### JSON + + + +##### Kotlin + + + +##### Lua + + + +##### PHP + + + +##### Properties + + + +##### Python + + + +##### Ruby + + + +##### Rust + + + +##### Talon-list + + + +##### Talon + + + + + + + +##### Yaml + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/word.mdx b/packages/app-web-docs/src/docs/user/scopes/word.mdx index b98365e9f4f..a21878c19ec 100644 --- a/packages/app-web-docs/src/docs/user/scopes/word.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/word.mdx @@ -2,7 +2,7 @@ sidebar_label: Sub --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Sub (Sub token word) @@ -24,4 +24,20 @@ Legacy: `word` - `"take first sub blue air"` - Selects the first sub token word in the token containing letter 'a' with a blue hat. - `"take second past fourth sub blue air"` - Selects the second through fourth sub token words in the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Word + +A single word in a token + +##### Plaintext + + + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/xmlBothTags.mdx b/packages/app-web-docs/src/docs/user/scopes/xmlBothTags.mdx index 61624b5d4c0..a56c94b494f 100644 --- a/packages/app-web-docs/src/docs/user/scopes/xmlBothTags.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/xmlBothTags.mdx @@ -2,7 +2,7 @@ sidebar_label: Tags --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Tags (XML both tags) @@ -20,4 +20,30 @@ Default: `tags` - `"take tags blue air"` - Selects both tags of the XML element containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Tags + +Both tags in a xml element + +##### HTML + + + +##### JavaScript React + + + +##### Latex + + + +##### XML + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/xmlElement.mdx b/packages/app-web-docs/src/docs/user/scopes/xmlElement.mdx index 99cdcfcff3b..0ac60c978cb 100644 --- a/packages/app-web-docs/src/docs/user/scopes/xmlElement.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/xmlElement.mdx @@ -2,7 +2,7 @@ sidebar_label: Element --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Element (XML element) @@ -20,4 +20,30 @@ Default: `element` - `"take element blue air"` - Selects the XML element containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Element + +A xml/html element. Also used for LaTeX environments + +##### HTML + + + +##### JavaScript React + + + +##### Latex + + + +##### XML + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/xmlEndTag.mdx b/packages/app-web-docs/src/docs/user/scopes/xmlEndTag.mdx index 72248b7b17d..dce9ec14ecd 100644 --- a/packages/app-web-docs/src/docs/user/scopes/xmlEndTag.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/xmlEndTag.mdx @@ -2,7 +2,7 @@ sidebar_label: End tag --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # End tag (XML end tag) @@ -20,4 +20,30 @@ Default: `end tag` - `"take end tag blue air"` - Selects the XML end tag containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### End tag + +The end tag of a xml element + +##### HTML + + + +##### JavaScript React + + + +##### Latex + + + +##### XML + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/xmlStartTag.mdx b/packages/app-web-docs/src/docs/user/scopes/xmlStartTag.mdx index 56600039feb..9ab4ba95a79 100644 --- a/packages/app-web-docs/src/docs/user/scopes/xmlStartTag.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/xmlStartTag.mdx @@ -2,7 +2,7 @@ sidebar_label: Start tag --- -import { Scopes } from "@site/src/docs/components/Scopes"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Start tag (XML start tag) @@ -20,4 +20,30 @@ Default: `start tag` - `"take start tag blue air"` - Selects the XML start tag containing the token containing letter 'a' with a blue hat. - + + +## Scopes + + + +### Start tag + +The start tag of a xml element + +##### HTML + + + +##### JavaScript React + + + +##### Latex + + + +##### XML + + + + diff --git a/packages/app-web-docs/src/theme/DocItem/Layout/index.tsx b/packages/app-web-docs/src/theme/DocItem/Layout/index.tsx deleted file mode 100644 index 45e07736ea4..00000000000 --- a/packages/app-web-docs/src/theme/DocItem/Layout/index.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import OriginalDocItemLayout from "@theme-original/DocItem/Layout"; -import React from "react"; -import type { ComponentProps } from "react"; -import { DynamicTOCProvider } from "../../../docs/components/DynamicTOCContext"; - -// oxlint-disable-next-line import/no-default-export -export default function DocItemLayout( - props: ComponentProps, -) { - return ( - - {/* oxlint-disable-next-line react/jsx-props-no-spreading */} - - - ); -} diff --git a/packages/app-web-docs/src/theme/DocItem/TOC/Desktop/index.tsx b/packages/app-web-docs/src/theme/DocItem/TOC/Desktop/index.tsx deleted file mode 100644 index 1e910ddb79e..00000000000 --- a/packages/app-web-docs/src/theme/DocItem/TOC/Desktop/index.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { ThemeClassNames } from "@docusaurus/theme-common"; -import OriginalDocItemTOCDesktop from "@theme-original/DocItem/TOC/Desktop"; -import TOC from "@theme/TOC"; -import React from "react"; -import { useDynamicTOC } from "../../../../docs/components/DynamicTOCContext"; - -// oxlint-disable-next-line import/no-default-export -export default function DocItemTOCDesktop() { - const { dynamicTOC } = useDynamicTOC(); - - if (dynamicTOC == null) { - return ; - } - - return ( - // oxlint-disable-next-line react/jsx-pascal-case - - ); -} diff --git a/packages/app-web-docs/src/theme/DocItem/TOC/Mobile/index.tsx b/packages/app-web-docs/src/theme/DocItem/TOC/Mobile/index.tsx deleted file mode 100644 index db1624a85de..00000000000 --- a/packages/app-web-docs/src/theme/DocItem/TOC/Mobile/index.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { ThemeClassNames } from "@docusaurus/theme-common"; -import OriginalDocItemTOCMobile from "@theme-original/DocItem/TOC/Mobile"; -import TOCCollapsible from "@theme/TOCCollapsible"; -import React from "react"; -import { useDynamicTOC } from "../../../../docs/components/DynamicTOCContext"; -import styles from "./styles.module.css"; - -// oxlint-disable-next-line import/no-default-export -export default function DocItemTOCMobile() { - const { dynamicTOC } = useDynamicTOC(); - - if (dynamicTOC == null) { - return ; - } - - return ( - - ); -} diff --git a/packages/app-web-docs/src/theme/DocItem/TOC/Mobile/styles.module.css b/packages/app-web-docs/src/theme/DocItem/TOC/Mobile/styles.module.css deleted file mode 100644 index 293d6f07b56..00000000000 --- a/packages/app-web-docs/src/theme/DocItem/TOC/Mobile/styles.module.css +++ /dev/null @@ -1,12 +0,0 @@ -@media (width >= 997px) { - /* Prevent hydration FOUC, as the mobile TOC needs to be server-rendered */ - .toc-mobile { - display: none; - } -} - -@media print { - .toc-mobile { - display: none; - } -} diff --git a/packages/lib-common/src/references/modifierReferences.ts b/packages/lib-common/src/references/modifierReferences.ts index 41e74cb2eec..82affa30284 100644 --- a/packages/lib-common/src/references/modifierReferences.ts +++ b/packages/lib-common/src/references/modifierReferences.ts @@ -638,7 +638,7 @@ Relative modifiers select scopes before or after the input target. Without \`"ev ], examples: [ { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, + command: `${SET_SELECTION} ${ITEM} ${TARGET}`, description: `Selects the closest item to the ${TARGET_DESC}.`, }, ], diff --git a/packages/tool-meta-updater/src/metaUpdater.ts b/packages/tool-meta-updater/src/metaUpdater.ts index 5fcccca59fc..72afa464bc5 100644 --- a/packages/tool-meta-updater/src/metaUpdater.ts +++ b/packages/tool-meta-updater/src/metaUpdater.ts @@ -5,6 +5,7 @@ import { readWantedLockfile } from "@pnpm/lockfile-file"; import { createUpdateOptions } from "@pnpm/meta-updater"; +import type { ScopeTypeType } from "@cursorless/lib-common"; import { actionReferenceGroups, actionReferences, @@ -16,11 +17,11 @@ import { scopeReferences, } from "@cursorless/lib-common"; import type { Context } from "./Context"; +import { createScopeFixtureGroups } from "./scopeFixtureGroups"; import { textFormat } from "./textFormat"; import { updateLanguageMdx } from "./updateLanguageMdx"; import { updatePackageJson } from "./updatePackageJson"; import { updatePairedDelimitersMd } from "./updatePairedDelimitersMd"; -import { updatePrivateScopeMdx } from "./updatePrivateScopeMdx"; import { updateReferenceMdx } from "./updateReferenceMdx"; import { updateReferenceReadmeMd } from "./updateReferenceReadmeMd"; import { updateScopeSupportFacetInfos } from "./updateScopeSupportFacetInfos"; @@ -44,6 +45,7 @@ export const updater = async (workspaceDir: string) => { const userDir = "src/docs/user"; const contributingDir = "src/docs/contributing"; + const scopeFixtureGroups = createScopeFixtureGroups(workspaceDir); return createUpdateOptions({ files: { @@ -55,7 +57,11 @@ export const updater = async (workspaceDir: string) => { ...Object.fromEntries( Object.keys(languageScopeSupport).map((languageId) => [ `${userDir}/languages/${languageId}.mdx`, - updateLanguageMdx.bind(null, languageId), + updateLanguageMdx.bind( + null, + languageId, + scopeFixtureGroups.forLanguage(languageId), + ), ]), ), [`${userDir}/paired-delimiters.md`]: updatePairedDelimitersMd.bind( @@ -81,28 +87,46 @@ export const updater = async (workspaceDir: string) => { scopeReferenceGroups, ), ...Object.fromEntries( - Object.entries(actionReferences).map(([id, entry]) => [ - `${userDir}/actions/${cleanId(id)}.mdx`, - updateReferenceMdx.bind(null, "action", id, entry), - ]), + Object.entries(actionReferences) + .filter(([_, entry]) => !isPrivate(entry)) + .map(([id, entry]) => [ + `${userDir}/actions/${cleanId(id)}.mdx`, + updateReferenceMdx.bind(null, id, entry, undefined), + ]), ), ...Object.fromEntries( - Object.entries(modifierReferences).map(([id, entry]) => [ - `${userDir}/modifiers/${cleanId(id)}.mdx`, - updateReferenceMdx.bind(null, "modifier", id, entry), - ]), + Object.entries(modifierReferences) + .filter(([_, entry]) => !isPrivate(entry)) + .map(([id, entry]) => [ + `${userDir}/modifiers/${cleanId(id)}.mdx`, + updateReferenceMdx.bind(null, id, entry, undefined), + ]), ), ...Object.fromEntries( - Object.entries(scopeReferences).map(([id, entry]) => [ - `${userDir}/scopes/${cleanId(id)}.mdx`, - updateReferenceMdx.bind(null, "scope", id, entry), - ]), + Object.entries(scopeReferences) + .filter(([_, entry]) => !isPrivate(entry)) + .map(([id, entry]) => [ + `${userDir}/scopes/${cleanId(id)}.mdx`, + updateReferenceMdx.bind( + null, + id, + entry, + scopeFixtureGroups.forScope(id as ScopeTypeType), + ), + ]), ), ...Object.fromEntries( - Object.entries(scopeReferences).map(([id, entry]) => [ - `${contributingDir}/private-scopes/${cleanId(id)}.mdx`, - updatePrivateScopeMdx.bind(null, id, entry), - ]), + Object.entries(scopeReferences) + .filter(([_, entry]) => isPrivate(entry)) + .map(([id, entry]) => [ + `${contributingDir}/private-scopes/${cleanId(id)}.mdx`, + updateReferenceMdx.bind( + null, + id, + entry, + scopeFixtureGroups.forScope(id as ScopeTypeType), + ), + ]), ), }, formats: { @@ -111,3 +135,7 @@ export const updater = async (workspaceDir: string) => { }, }); }; + +function isPrivate(entry: object): boolean { + return "private" in entry && entry.private === true; +} diff --git a/packages/tool-meta-updater/src/renderScopeVisualizerMdx.ts b/packages/tool-meta-updater/src/renderScopeVisualizerMdx.ts new file mode 100644 index 00000000000..433222dded1 --- /dev/null +++ b/packages/tool-meta-updater/src/renderScopeVisualizerMdx.ts @@ -0,0 +1,131 @@ +import { prettifyLanguageName } from "@cursorless/lib-common"; +import type { + ScopeFixtureFacet, + ScopeFixtureGroup, +} from "./scopeFixtureGroups"; + +export const scopeVisualizerImport = `import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer";`; + +export function renderLanguageScopeVisualizer( + languageId: string, + groups: ScopeFixtureGroup[], +): string { + const publicScopes = groups.filter((scope) => !scope.private); + const internalScopes = groups.filter((scope) => scope.private); + const lines = [ + "", + "", + "Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint.", + "", + "## Scopes", + "", + "", + "", + ]; + + renderScopeGroups(lines, publicScopes, { + languageId, + showScopeHeading: true, + }); + + if (internalScopes.length > 0) { + lines.push( + "## Internal scopes", + "", + "The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality.", + "", + ); + renderScopeGroups(lines, internalScopes, { + languageId, + showScopeHeading: true, + }); + } + + lines.push(""); + return lines.join("\n"); +} + +export function renderScopeVisualizer( + groups: ScopeFixtureGroup[], +): string | undefined { + const scope = groups[0]; + if (scope == null) { + return undefined; + } + if (groups.length > 1) { + throw new Error("Expected fixtures for exactly one scope"); + } + + const lines = [ + "", + "", + scope.private ? "## Internal scopes" : "## Scopes", + "", + ]; + if (scope.private) { + lines.push( + "The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality.", + "", + ); + } + lines.push("", ""); + renderFacets(lines, scope.facets, {}); + lines.push(""); + + return lines.join("\n"); +} + +function renderScopeGroups( + lines: string[], + groups: ScopeFixtureGroup[], + options: RenderOptions, +) { + for (const scope of groups) { + if (options.showScopeHeading) { + lines.push(`### ${scope.name}`, ""); + } + renderFacets(lines, scope.facets, options); + } +} + +interface RenderOptions { + languageId?: string; + showScopeHeading?: boolean; +} + +function renderFacets( + lines: string[], + facets: ScopeFixtureFacet[], + options: RenderOptions, +) { + for (const [index, facet] of facets.entries()) { + const headingLevel = options.showScopeHeading ? "####" : "###"; + const heading = options.showScopeHeading + ? `${index + 1}. ${facet.name}` + : facet.name; + lines.push( + `${headingLevel} ${heading}`, + "", + `${facet.description}`, + "", + ); + + let previousLanguageId: string | undefined; + for (const fixture of facet.fixtures) { + if ( + options.languageId == null && + fixture.languageId !== previousLanguageId + ) { + previousLanguageId = fixture.languageId; + lines.push(`##### ${prettifyLanguageName(fixture.languageId)}`, ""); + } + + const languageProp = + options.languageId == null ? "" : ` languageId="${options.languageId}"`; + lines.push( + ``, + "", + ); + } + } +} diff --git a/packages/tool-meta-updater/src/scopeFixtureGroups.ts b/packages/tool-meta-updater/src/scopeFixtureGroups.ts new file mode 100644 index 00000000000..cf8bde4419e --- /dev/null +++ b/packages/tool-meta-updater/src/scopeFixtureGroups.ts @@ -0,0 +1,282 @@ +import fs from "node:fs"; +import path from "node:path"; +import type { + PlaintextScopeSupportFacet, + ScopeSupportFacet, + ScopeSupportFacetInfo, + ScopeTypeType, +} from "@cursorless/lib-common"; +import { + camelCaseToAllDown, + capitalize, + plaintextScopeSupportFacetInfos, + prettifyScopeType, + scopeReferences, + scopeSupportFacetInfos, + serializeScopeType, +} from "@cursorless/lib-common"; + +type FacetValue = ScopeSupportFacet | PlaintextScopeSupportFacet; + +interface ScopeTestConfig { + imports?: string[]; +} + +interface FixtureMetadata { + facet: FacetValue; + languageId: string; + name: string; + scopeTypeType: ScopeTypeType; +} + +export interface ScopeFixture { + languageId: string; + name: string; +} + +export interface ScopeFixtureFacet { + description: string; + facet: FacetValue; + fixtures: ScopeFixture[]; + isIteration: boolean; + name: string; +} + +export interface ScopeFixtureGroup { + facets: ScopeFixtureFacet[]; + name: string; + private: boolean; + scopeTypeType: ScopeTypeType; +} + +export interface ScopeFixtureGroups { + forLanguage(languageId: string): ScopeFixtureGroup[]; + forScope(scopeTypeType: ScopeTypeType): ScopeFixtureGroup[]; +} + +export function createScopeFixtureGroups( + workspaceDir: string, +): ScopeFixtureGroups { + const scopeFixturesDir = path.join( + workspaceDir, + "resources", + "fixtures", + "scopes", + ); + const fixturesDir = path.dirname(scopeFixturesDir); + const files = walkFiles(scopeFixturesDir); + const configs = readConfigs(files, scopeFixturesDir); + const fixtures = files + .filter((file) => file.endsWith(".scope")) + .map((file) => getFixtureMetadata(file, fixturesDir, scopeFixturesDir)); + + return { + forLanguage(languageId) { + const languageIds = getImportedLanguageIds(languageId, configs); + return groupFixtures( + fixtures.filter( + (fixture) => + languageIds.has(fixture.languageId) && + !fixture.scopeTypeType.startsWith("private."), + ), + ); + }, + forScope(scopeTypeType) { + return groupFixtures( + fixtures.filter((fixture) => fixture.scopeTypeType === scopeTypeType), + ); + }, + }; +} + +function walkFiles(directory: string): string[] { + const result: string[] = []; + + for (const entry of fs.readdirSync(directory, { withFileTypes: true })) { + const entryPath = path.join(directory, entry.name); + if (entry.isDirectory()) { + result.push(...walkFiles(entryPath)); + } else { + result.push(entryPath); + } + } + + return result; +} + +function readConfigs( + files: string[], + scopeFixturesDir: string, +): Record { + const result: Record = {}; + + for (const file of files.filter((file) => file.endsWith("index.json"))) { + const languageId = path + .relative(scopeFixturesDir, path.dirname(file)) + .split(path.sep)[0]; + result[languageId] = JSON.parse( + fs.readFileSync(file, "utf8"), + ) as ScopeTestConfig; + } + + return result; +} + +function getFixtureMetadata( + file: string, + fixturesDir: string, + scopeFixturesDir: string, +): FixtureMetadata { + const relativePath = path.relative(scopeFixturesDir, file); + const languageId = relativePath.split(path.sep)[0]; + const facetMatch = path.basename(file).match(/([a-zA-Z.]+)\d*\.scope/u); + if (facetMatch == null) { + throw new Error(`Unable to determine scope facet from ${file}`); + } + + const facet = facetMatch[1] as FacetValue; + const info = getFacetInfo(languageId, facet); + + return { + facet, + languageId, + name: path + .relative(fixturesDir, file.slice(0, -path.extname(file).length)) + .replaceAll("\\", "/"), + scopeTypeType: serializeScopeType(info.scopeType), + }; +} + +function getImportedLanguageIds( + languageId: string, + configs: Record, +): Set { + const result = new Set(); + + function add(currentLanguageId: string) { + if (result.has(currentLanguageId)) { + return; + } + result.add(currentLanguageId); + for (const importedLanguageId of configs[currentLanguageId]?.imports ?? + []) { + add(importedLanguageId); + } + } + + add(languageId); + return result; +} + +function groupFixtures(fixtures: FixtureMetadata[]): ScopeFixtureGroup[] { + const scopeMap = new Map(); + + for (const fixture of fixtures) { + let scope = scopeMap.get(fixture.scopeTypeType); + if (scope == null) { + const reference = scopeReferences[fixture.scopeTypeType]; + if (reference == null) { + throw new Error( + `Missing scope reference for: ${fixture.scopeTypeType}`, + ); + } + scope = { + facets: [], + name: prettifyScopeType( + getFacetInfo(fixture.languageId, fixture.facet).scopeType, + ), + private: "private" in reference && reference.private === true, + scopeTypeType: fixture.scopeTypeType, + }; + scopeMap.set(fixture.scopeTypeType, scope); + } + + let facet = scope.facets.find((item) => item.facet === fixture.facet); + if (facet == null) { + const info = getFacetInfo(fixture.languageId, fixture.facet); + facet = { + description: info.description, + facet: fixture.facet, + fixtures: [], + isIteration: info.isIteration ?? false, + name: prettifyFacet(fixture.facet), + }; + scope.facets.push(facet); + } + + facet.fixtures.push({ + languageId: normalizeLanguageId(fixture.languageId), + name: fixture.name, + }); + } + + const scopes = [...scopeMap.values()].toSorted(nameComparator); + for (const scope of scopes) { + scope.facets.sort(facetComparator); + for (const facet of scope.facets) { + facet.fixtures.sort(nameComparator); + } + } + return scopes; +} + +function getFacetInfo( + languageId: string, + facet: FacetValue, +): ScopeSupportFacetInfo { + const info = + languageId === "plaintext" + ? plaintextScopeSupportFacetInfos[facet as PlaintextScopeSupportFacet] + : scopeSupportFacetInfos[facet as ScopeSupportFacet]; + if (info == null) { + throw new Error(`Missing scope support facet info for: ${facet}`); + } + return info; +} + +function prettifyFacet(facet: FacetValue): string { + const parts = facet.split(".").map(camelCaseToAllDown); + if (parts.length === 1) { + return capitalize(parts[0]); + } + + const iterationIndex = parts.indexOf("iteration"); + parts[0] = capitalize(parts[0]); + if (iterationIndex === -1 || iterationIndex > 1) { + parts[0] += ":"; + parts[1] = capitalize(parts[1]); + } + if (iterationIndex > 0) { + const iteration = parts.slice(iterationIndex).join(" "); + parts.length = iterationIndex; + parts.push(`(${iteration})`); + } + return parts.join(" "); +} + +function facetComparator(a: ScopeFixtureFacet, b: ScopeFixtureFacet): number { + if (a.isIteration && !b.isIteration) { + return 1; + } + if (!a.isIteration && b.isIteration) { + return -1; + } + return nameComparator(a, b); +} + +function nameComparator(a: { name: string }, b: { name: string }): number { + return a.name.localeCompare(b.name, undefined, { numeric: true }); +} + +function normalizeLanguageId(languageId: string): string { + switch (languageId) { + case "javascript.core": + return "javascript"; + case "typescript.core": + return "typescript"; + case "javascript.jsx": + return "javascriptreact"; + default: + return languageId; + } +} diff --git a/packages/tool-meta-updater/src/updateLanguageMdx.ts b/packages/tool-meta-updater/src/updateLanguageMdx.ts index 2eee6581753..67dac4480ac 100644 --- a/packages/tool-meta-updater/src/updateLanguageMdx.ts +++ b/packages/tool-meta-updater/src/updateLanguageMdx.ts @@ -1,8 +1,14 @@ import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; import { prettifyLanguageName } from "@cursorless/lib-common"; +import { + renderLanguageScopeVisualizer, + scopeVisualizerImport, +} from "./renderScopeVisualizerMdx"; +import type { ScopeFixtureGroup } from "./scopeFixtureGroups"; export function updateLanguageMdx( languageId: string, + scopeFixtureGroups: ScopeFixtureGroup[], actual: string | null, options: FormatPluginFnOptions, ): string | null { @@ -10,17 +16,14 @@ export function updateLanguageMdx( return null; } - if (actual != null) { - return actual; - } - - const expected = ` -import { Language } from "@site/src/docs/components/Language"; - -# ${prettifyLanguageName(languageId)} - - -`.trimStart(); + const expected = [ + scopeVisualizerImport, + "", + `# ${prettifyLanguageName(languageId)}`, + "", + renderLanguageScopeVisualizer(languageId, scopeFixtureGroups), + "", + ]; - return expected; + return expected.join("\n"); } diff --git a/packages/tool-meta-updater/src/updatePrivateScopeMdx.ts b/packages/tool-meta-updater/src/updatePrivateScopeMdx.ts deleted file mode 100644 index 0af55742de0..00000000000 --- a/packages/tool-meta-updater/src/updatePrivateScopeMdx.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; -import type { ReferenceEntry } from "@cursorless/lib-common"; - -export function updatePrivateScopeMdx( - id: string, - entry: ReferenceEntry, - actual: string | null, - options: FormatPluginFnOptions, -): string | null { - if (options.manifest.name !== "@cursorless/app-web-docs" || !entry.private) { - return null; - } - - const expected = ` -import { Scopes } from "@site/src/docs/components/Scopes"; - -# ${entry.name} - - -`.trimStart(); - - return expected; -} diff --git a/packages/tool-meta-updater/src/updateReferenceMdx.ts b/packages/tool-meta-updater/src/updateReferenceMdx.ts index 44b89d7a730..8c061538f73 100644 --- a/packages/tool-meta-updater/src/updateReferenceMdx.ts +++ b/packages/tool-meta-updater/src/updateReferenceMdx.ts @@ -1,18 +1,23 @@ import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; import type { ReferenceEntry } from "@cursorless/lib-common"; import { capitalize } from "@cursorless/lib-common"; +import { + renderScopeVisualizer, + scopeVisualizerImport, +} from "./renderScopeVisualizerMdx"; +import type { ScopeFixtureGroup } from "./scopeFixtureGroups"; import { DISABLED_BY_DEFAULT } from "./util/constants"; import { formatVariables } from "./util/formatVariables"; import { injectSpokenForm } from "./util/injectSpokenForm"; export function updateReferenceMdx( - kind: "action" | "modifier" | "scope", id: string, entry: ReferenceEntry, + scopeFixtureGroups: ScopeFixtureGroup[] | undefined, actual: string | null, options: FormatPluginFnOptions, ): string | null { - if (options.manifest.name !== "@cursorless/app-web-docs" || entry.private) { + if (options.manifest.name !== "@cursorless/app-web-docs") { return null; } @@ -22,8 +27,7 @@ export function updateReferenceMdx( ); } - const isScope = kind === "scope"; - + const scopeVisualizer = renderScopeVisualizer(scopeFixtureGroups ?? []); const expected: string[] = []; let title = entry.name; @@ -35,11 +39,8 @@ export function updateReferenceMdx( } } - if (isScope) { - expected.push( - `import { Scopes } from "@site/src/docs/components/Scopes";`, - "", - ); + if (scopeVisualizer != null) { + expected.push(scopeVisualizerImport, ""); } expected.push(`# ${title}`, ""); @@ -94,8 +95,8 @@ export function updateReferenceMdx( expected.push(""); } - if (isScope) { - expected.push(``, ""); + if (scopeVisualizer != null) { + expected.push(scopeVisualizer, ""); } return expected.join("\n"); From 2b4d3bca5c59226d621003cbe3775a0ff2c6fd27 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sun, 30 Aug 2026 14:17:27 +0200 Subject: [PATCH 3/4] Restore fix:meta command --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0b1dc0b0a87..4d844aac528 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "lint:style": "stylelint --ignore-path .gitignore '**/*.{css,scss}'", "lint:fmt": "oxfmt --check .", "lint": "pnpm typecheck &&pnpm lint:meta && pnpm lint:syncpack && pnpm lint:ts && pnpm lint:style && pnpm lint:fmt", - "fix:meta": "pnpm meta-updater", + "fix:meta": "pnpm meta-updater && pnpm -r exec oxfmt tsconfig.json package.json", "fix:syncpack": "syncpack fix", "fix:ts": "oxlint -c oxlint.config.mts --fix .", "fix:style": "stylelint --ignore-path .gitignore --fix '**/*.{css,scss}'", From 45ad7135b5cab931c0bdfc13b804f33af0d83579 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sun, 30 Aug 2026 14:20:17 +0200 Subject: [PATCH 4/4] Added plain text --- .../src/docs/user/languages/plaintext.mdx | 354 +++++------------- packages/tool-meta-updater/src/metaUpdater.ts | 3 +- 2 files changed, 106 insertions(+), 251 deletions(-) diff --git a/packages/app-web-docs/src/docs/user/languages/plaintext.mdx b/packages/app-web-docs/src/docs/user/languages/plaintext.mdx index 8f19e943274..81237a3b94f 100644 --- a/packages/app-web-docs/src/docs/user/languages/plaintext.mdx +++ b/packages/app-web-docs/src/docs/user/languages/plaintext.mdx @@ -1,13 +1,7 @@ -import { - Scope, - ScopeVisualizerOptions, - ScopeVisualizerProvider, -} from "@site/src/docs/components/ScopeVisualizer"; +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; # Plaintext -{/* START GENERATED SCOPE VISUALIZER */} - Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. @@ -20,365 +14,229 @@ Below are visualizations of all our scope tests for this language. These were cr #### 1. Bounded non whitespace sequence -{"A sequence of non-whitespace characters bounded by matching pair"} +A sequence of non-whitespace characters bounded by matching pair - + - + - + #### 2. Bounded non whitespace sequence (iteration) -{"Iteration scope for bounded non-whitespace sequence"} +Iteration scope for bounded non-whitespace sequence - + ### Bounded paragraph #### 1. Bounded paragraph - - { - "A single paragraph(contiguous block of lines) in the document bounded by matching pair" - } - - - - - - - - - - - - - +A single paragraph(contiguous block of lines) in the document bounded by matching pair + + + + + + + + + + + + #### 2. Bounded paragraph (iteration) -{"Iteration scope for bounded paragraph"} +Iteration scope for bounded paragraph - + ### Character #### 1. Character -{"A single character in the document"} +A single character in the document - + ### Collection item #### 1. Collection item: Textual -{"A text based collection item"} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +A text based collection item + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #### 2. Collection item: Textual (iteration) -{"Iteration scope for text based collection items"} +Iteration scope for text based collection items - + - + - + - + - + - + - + ### Document #### 1. Document -{"The entire document"} +The entire document - + ### Full line #### 1. Full line - - { - "A single full line in the document. Includes leading and trailing whitespace." - } - +A single full line in the document. Includes leading and trailing whitespace. - + - + ### Identifier #### 1. Identifier -{"A single alphanumeric identifier in the document"} +A single alphanumeric identifier in the document - + ### Line #### 1. Line - - {"A single line in the document. Excludes leading and trailing whitespace."} - +A single line in the document. Excludes leading and trailing whitespace. - + - + ### Non whitespace sequence #### 1. Non whitespace sequence -{"A sequence of non-whitespace characters"} +A sequence of non-whitespace characters - + ### Paragraph #### 1. Paragraph -{"A single paragraph(contiguous block of lines) in the document"} +A single paragraph(contiguous block of lines) in the document - + ### Sentence #### 1. Sentence -{"A single sentence in the document"} +A single sentence in the document - + - + - + - + ### Surrounding pair #### 1. Surrounding pair -{"A delimiter pair, such as parentheses or quotes"} +A delimiter pair, such as parentheses or quotes - + - + - + - + - + - + #### 2. Surrounding pair (iteration) -{"The iteration scope for delimiter pairs"} +The iteration scope for delimiter pairs - + - + ### Token #### 1. Token -{"A single token in the document"} +A single token in the document - + ### Url #### 1. Url -{"A url"} +A url - + - + - + - + ### Word #### 1. Word -{"A single word in a token"} +A single word in a token - + - + ## Internal scopes @@ -388,12 +246,8 @@ The following are internal scopes. They are not intended for user interaction or #### 1. Interior: Surrounding pair -{"The interior scope of a surrounding pair"} +The interior scope of a surrounding pair - + -{/* END GENERATED SCOPE VISUALIZER */} diff --git a/packages/tool-meta-updater/src/metaUpdater.ts b/packages/tool-meta-updater/src/metaUpdater.ts index 72afa464bc5..d781ab02d9a 100644 --- a/packages/tool-meta-updater/src/metaUpdater.ts +++ b/packages/tool-meta-updater/src/metaUpdater.ts @@ -46,6 +46,7 @@ export const updater = async (workspaceDir: string) => { const userDir = "src/docs/user"; const contributingDir = "src/docs/contributing"; const scopeFixtureGroups = createScopeFixtureGroups(workspaceDir); + const languageIds = [...Object.keys(languageScopeSupport), "plaintext"]; return createUpdateOptions({ files: { @@ -55,7 +56,7 @@ export const updater = async (workspaceDir: string) => { "resources/fixtures/scope-support-facet-infos.md": updateScopeSupportFacetInfos, ...Object.fromEntries( - Object.keys(languageScopeSupport).map((languageId) => [ + languageIds.map((languageId) => [ `${userDir}/languages/${languageId}.mdx`, updateLanguageMdx.bind( null,