From 4436ea85c6834ae841999c6681708e2723bd78df Mon Sep 17 00:00:00 2001 From: rinOfTheStars Date: Sat, 6 Sep 2025 20:40:08 -0400 Subject: [PATCH 01/11] Initial setup --- packages/common/src/extensionDependencies.ts | 1 + packages/common/src/scopeSupportFacets/gdscript.ts | 8 ++++++++ .../common/src/scopeSupportFacets/languageScopeSupport.ts | 2 ++ queries/gdscript.scm | 0 4 files changed, 11 insertions(+) create mode 100644 packages/common/src/scopeSupportFacets/gdscript.ts create mode 100644 queries/gdscript.scm diff --git a/packages/common/src/extensionDependencies.ts b/packages/common/src/extensionDependencies.ts index d748061247..14ab6ed3e3 100644 --- a/packages/common/src/extensionDependencies.ts +++ b/packages/common/src/extensionDependencies.ts @@ -7,6 +7,7 @@ export const extensionDependencies = [ "mrob95.vscode-talonscript", // talon "jrieken.vscode-tree-sitter-query", // scm "mathiasfrohlich.kotlin", // kotlin + "geequlim.godot-tools", //gdscript // Necessary for the `drink cell` and `pour cell` tests "ms-toolsai.jupyter", diff --git a/packages/common/src/scopeSupportFacets/gdscript.ts b/packages/common/src/scopeSupportFacets/gdscript.ts new file mode 100644 index 0000000000..c71d7c91fd --- /dev/null +++ b/packages/common/src/scopeSupportFacets/gdscript.ts @@ -0,0 +1,8 @@ +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; + +const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; + +export const gdscriptScopeSupport: LanguageScopeSupportFacetMap = { + +} \ No newline at end of file diff --git a/packages/common/src/scopeSupportFacets/languageScopeSupport.ts b/packages/common/src/scopeSupportFacets/languageScopeSupport.ts index d1cfc7879b..b84adfb911 100644 --- a/packages/common/src/scopeSupportFacets/languageScopeSupport.ts +++ b/packages/common/src/scopeSupportFacets/languageScopeSupport.ts @@ -6,6 +6,7 @@ import { csharpScopeSupport } from "./csharp"; import { cssScopeSupport } from "./css"; import { dartScopeSupport } from "./dart"; import { goScopeSupport } from "./go"; +import { gdscriptScopeSupport } from "./gdscript"; import { htmlScopeSupport } from "./html"; import { javaScopeSupport } from "./java"; import { javascriptScopeSupport } from "./javascript"; @@ -45,6 +46,7 @@ export const languageScopeSupport: StringRecord = css: cssScopeSupport, dart: dartScopeSupport, go: goScopeSupport, + gdscript: gdscriptScopeSupport, html: htmlScopeSupport, java: javaScopeSupport, javascript: javascriptScopeSupport, diff --git a/queries/gdscript.scm b/queries/gdscript.scm new file mode 100644 index 0000000000..e69de29bb2 From 659337d1ad3fdd98991db616b425c36b11c069d6 Mon Sep 17 00:00:00 2001 From: rinOfTheStars Date: Sat, 6 Sep 2025 21:07:36 -0400 Subject: [PATCH 02/11] gdscript doesnt have explicit interfaces, so this is an easy one --- packages/common/src/scopeSupportFacets/gdscript.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/common/src/scopeSupportFacets/gdscript.ts b/packages/common/src/scopeSupportFacets/gdscript.ts index c71d7c91fd..31190c2305 100644 --- a/packages/common/src/scopeSupportFacets/gdscript.ts +++ b/packages/common/src/scopeSupportFacets/gdscript.ts @@ -5,4 +5,16 @@ const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const gdscriptScopeSupport: LanguageScopeSupportFacetMap = { + // not applicable + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.field.interface": notApplicable, + "type.interface": notApplicable, + "type.iteration.interface": notApplicable, + "interior.interface": notApplicable, + } \ No newline at end of file From 18196caf0e65de31719e58a42ee827f46dd5d3d5 Mon Sep 17 00:00:00 2001 From: rinOfTheStars Date: Sat, 6 Sep 2025 21:50:07 -0400 Subject: [PATCH 03/11] formatting changes --- packages/common/src/scopeSupportFacets/gdscript.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/common/src/scopeSupportFacets/gdscript.ts b/packages/common/src/scopeSupportFacets/gdscript.ts index 31190c2305..be94af9961 100644 --- a/packages/common/src/scopeSupportFacets/gdscript.ts +++ b/packages/common/src/scopeSupportFacets/gdscript.ts @@ -4,7 +4,6 @@ import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const gdscriptScopeSupport: LanguageScopeSupportFacetMap = { - // not applicable "statement.interface": notApplicable, "statement.field.interface": notApplicable, @@ -16,5 +15,4 @@ export const gdscriptScopeSupport: LanguageScopeSupportFacetMap = { "type.interface": notApplicable, "type.iteration.interface": notApplicable, "interior.interface": notApplicable, - -} \ No newline at end of file +}; From 2861cb97389f38f6624fa7d9c5e7ddf4ec9751c2 Mon Sep 17 00:00:00 2001 From: rinOfTheStars Date: Sat, 11 Oct 2025 17:13:37 -0400 Subject: [PATCH 04/11] add lang doc file --- .../cursorless-org-docs/src/docs/user/languages/gdscript.mdx | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 packages/cursorless-org-docs/src/docs/user/languages/gdscript.mdx diff --git a/packages/cursorless-org-docs/src/docs/user/languages/gdscript.mdx b/packages/cursorless-org-docs/src/docs/user/languages/gdscript.mdx new file mode 100644 index 0000000000..61c32aeb58 --- /dev/null +++ b/packages/cursorless-org-docs/src/docs/user/languages/gdscript.mdx @@ -0,0 +1,5 @@ +import { Language } from "./components/Language"; + +# GDScript + + From 92e746fa0311208ede8e8e337de373a36e1edd81 Mon Sep 17 00:00:00 2001 From: rinOfTheStars Date: Sat, 11 Oct 2025 17:21:52 -0400 Subject: [PATCH 05/11] disable no-unused-vars err for one line bc yes, I know they're unused, that's the point actually, it's a work in progress!!! --- packages/common/src/scopeSupportFacets/gdscript.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/common/src/scopeSupportFacets/gdscript.ts b/packages/common/src/scopeSupportFacets/gdscript.ts index be94af9961..e00ebe326c 100644 --- a/packages/common/src/scopeSupportFacets/gdscript.ts +++ b/packages/common/src/scopeSupportFacets/gdscript.ts @@ -1,6 +1,7 @@ import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; +//eslint-disable-next-line no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const gdscriptScopeSupport: LanguageScopeSupportFacetMap = { From 72929788002a0f037c54896bdb20a67d6d7b0e1b Mon Sep 17 00:00:00 2001 From: rinOfTheStars Date: Sat, 11 Oct 2025 17:21:52 -0400 Subject: [PATCH 06/11] disable no-unused-vars err for one line bc yes, I know they're unused, that's the point actually, it's a work in progress!!! --- packages/common/src/scopeSupportFacets/gdscript.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/common/src/scopeSupportFacets/gdscript.ts b/packages/common/src/scopeSupportFacets/gdscript.ts index be94af9961..f98629147f 100644 --- a/packages/common/src/scopeSupportFacets/gdscript.ts +++ b/packages/common/src/scopeSupportFacets/gdscript.ts @@ -1,6 +1,7 @@ import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; +//eslint-disable-next-line typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const gdscriptScopeSupport: LanguageScopeSupportFacetMap = { From 5a8338fa4c4da74cdc1a73d6eab98ac55b20860f Mon Sep 17 00:00:00 2001 From: rinOfTheStars Date: Sat, 11 Oct 2025 17:41:57 -0400 Subject: [PATCH 07/11] i have no clue what the syntax to disable a specific rule is, apparently, so screw it --- packages/common/src/scopeSupportFacets/gdscript.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/src/scopeSupportFacets/gdscript.ts b/packages/common/src/scopeSupportFacets/gdscript.ts index f98629147f..7fa73d55a0 100644 --- a/packages/common/src/scopeSupportFacets/gdscript.ts +++ b/packages/common/src/scopeSupportFacets/gdscript.ts @@ -1,7 +1,7 @@ import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; -//eslint-disable-next-line typescript-eslint/no-unused-vars +//eslint-disable-next-line const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const gdscriptScopeSupport: LanguageScopeSupportFacetMap = { From 73b29a059ffbed09d6d1e6e71e63bf21004e22b6 Mon Sep 17 00:00:00 2001 From: rinOfTheStars Date: Mon, 13 Oct 2025 13:59:20 -0400 Subject: [PATCH 08/11] run prettier and fix comment formatting as suggested --- packages/common/src/extensionDependencies.ts | 2 +- .../common/src/scopeSupportFacets/gdscript.ts | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/common/src/extensionDependencies.ts b/packages/common/src/extensionDependencies.ts index 14ab6ed3e3..4b7321bb3e 100644 --- a/packages/common/src/extensionDependencies.ts +++ b/packages/common/src/extensionDependencies.ts @@ -7,7 +7,7 @@ export const extensionDependencies = [ "mrob95.vscode-talonscript", // talon "jrieken.vscode-tree-sitter-query", // scm "mathiasfrohlich.kotlin", // kotlin - "geequlim.godot-tools", //gdscript + "geequlim.godot-tools", // gdscript // Necessary for the `drink cell` and `pour cell` tests "ms-toolsai.jupyter", diff --git a/packages/common/src/scopeSupportFacets/gdscript.ts b/packages/common/src/scopeSupportFacets/gdscript.ts index 7fa73d55a0..8bd93686ea 100644 --- a/packages/common/src/scopeSupportFacets/gdscript.ts +++ b/packages/common/src/scopeSupportFacets/gdscript.ts @@ -1,19 +1,19 @@ import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; -//eslint-disable-next-line +// eslint-disable-next-line const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const gdscriptScopeSupport: LanguageScopeSupportFacetMap = { - // not applicable - "statement.interface": notApplicable, - "statement.field.interface": notApplicable, - "statement.iteration.interface": notApplicable, - "name.interface": notApplicable, - "name.field.interface": notApplicable, - "name.iteration.interface": notApplicable, - "type.field.interface": notApplicable, - "type.interface": notApplicable, - "type.iteration.interface": notApplicable, - "interior.interface": notApplicable, + // not applicable + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.field.interface": notApplicable, + "type.interface": notApplicable, + "type.iteration.interface": notApplicable, + "interior.interface": notApplicable, }; From 769e9c58cc36ae6e58820cf473e53a62b10393db Mon Sep 17 00:00:00 2001 From: rinOfTheStars Date: Fri, 17 Oct 2025 20:09:26 -0400 Subject: [PATCH 09/11] hand-written scope files --- .../scopes/gdscript/comment.line.scope | 9 ++++++ .../gdscript/statement/statement.return.scope | 28 +++++++++++++++++++ .../common/src/scopeSupportFacets/gdscript.ts | 10 +++++-- queries/gdscript.scm | 3 ++ 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 data/fixtures/scopes/gdscript/comment.line.scope create mode 100644 data/fixtures/scopes/gdscript/statement/statement.return.scope diff --git a/data/fixtures/scopes/gdscript/comment.line.scope b/data/fixtures/scopes/gdscript/comment.line.scope new file mode 100644 index 0000000000..51753d197c --- /dev/null +++ b/data/fixtures/scopes/gdscript/comment.line.scope @@ -0,0 +1,9 @@ +# This is a comment +--- +[Content] = +[Removal] = +[Domain] = 0:0-0:19 + >-------------------< +0| # This is a comment + +[Insertion delimiter] = "\n" \ No newline at end of file diff --git a/data/fixtures/scopes/gdscript/statement/statement.return.scope b/data/fixtures/scopes/gdscript/statement/statement.return.scope new file mode 100644 index 0000000000..a1e7931a39 --- /dev/null +++ b/data/fixtures/scopes/gdscript/statement/statement.return.scope @@ -0,0 +1,28 @@ +func foo_bar(): + return 0 +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-1:12 + >--------------- +0| func foo_bar(): +1| return 0 + --------< + +[#1 Insertion delimiter] = "\n" + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| return 0 + +[#2 Removal] = 1:0-1:12 + >------------< +1| return 0 + +[#2 Leading delimiter 1:0-1:4] + >----< +1| return 0 + +[#2 Insertion delimiter] = "\n" \ No newline at end of file diff --git a/packages/common/src/scopeSupportFacets/gdscript.ts b/packages/common/src/scopeSupportFacets/gdscript.ts index 8bd93686ea..10aa1e2c4a 100644 --- a/packages/common/src/scopeSupportFacets/gdscript.ts +++ b/packages/common/src/scopeSupportFacets/gdscript.ts @@ -1,11 +1,17 @@ import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; -// eslint-disable-next-line -const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; +const { supported, notApplicable } = ScopeSupportFacetLevel; export const gdscriptScopeSupport: LanguageScopeSupportFacetMap = { + // supported + "comment.line": supported, + "statement.return": supported, + + // unsupported (none currently defined) + // not applicable + "comment.block": notApplicable, "statement.interface": notApplicable, "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, diff --git a/queries/gdscript.scm b/queries/gdscript.scm index e69de29bb2..8a9b2ffea4 100644 --- a/queries/gdscript.scm +++ b/queries/gdscript.scm @@ -0,0 +1,3 @@ +;; # comment +;; ^^^^^^^^^ + From 400fa0566dee46c3a5d1e5dc84bc4eee3abbc84d Mon Sep 17 00:00:00 2001 From: rinOfTheStars Date: Sat, 18 Oct 2025 13:45:52 -0400 Subject: [PATCH 10/11] run precommit --- queries/gdscript.scm | 1 - 1 file changed, 1 deletion(-) diff --git a/queries/gdscript.scm b/queries/gdscript.scm index 8a9b2ffea4..b6ba357764 100644 --- a/queries/gdscript.scm +++ b/queries/gdscript.scm @@ -1,3 +1,2 @@ ;; # comment ;; ^^^^^^^^^ - From 20be27fd851deb4e7729a1f6af7c5fd6ca5eb2f0 Mon Sep 17 00:00:00 2001 From: rinOfTheStars Date: Sat, 18 Oct 2025 13:50:02 -0400 Subject: [PATCH 11/11] Revert "hand-written scope files" This reverts commit 769e9c58cc36ae6e58820cf473e53a62b10393db. --- .../scopes/gdscript/comment.line.scope | 9 ------ .../gdscript/statement/statement.return.scope | 28 ------------------- .../common/src/scopeSupportFacets/gdscript.ts | 10 ++----- queries/gdscript.scm | 2 -- 4 files changed, 2 insertions(+), 47 deletions(-) delete mode 100644 data/fixtures/scopes/gdscript/comment.line.scope delete mode 100644 data/fixtures/scopes/gdscript/statement/statement.return.scope diff --git a/data/fixtures/scopes/gdscript/comment.line.scope b/data/fixtures/scopes/gdscript/comment.line.scope deleted file mode 100644 index 51753d197c..0000000000 --- a/data/fixtures/scopes/gdscript/comment.line.scope +++ /dev/null @@ -1,9 +0,0 @@ -# This is a comment ---- -[Content] = -[Removal] = -[Domain] = 0:0-0:19 - >-------------------< -0| # This is a comment - -[Insertion delimiter] = "\n" \ No newline at end of file diff --git a/data/fixtures/scopes/gdscript/statement/statement.return.scope b/data/fixtures/scopes/gdscript/statement/statement.return.scope deleted file mode 100644 index a1e7931a39..0000000000 --- a/data/fixtures/scopes/gdscript/statement/statement.return.scope +++ /dev/null @@ -1,28 +0,0 @@ -func foo_bar(): - return 0 ---- - -[#1 Content] = -[#1 Removal] = -[#1 Domain] = 0:0-1:12 - >--------------- -0| func foo_bar(): -1| return 0 - --------< - -[#1 Insertion delimiter] = "\n" - -[#2 Content] = -[#2 Domain] = 1:4-1:12 - >--------< -1| return 0 - -[#2 Removal] = 1:0-1:12 - >------------< -1| return 0 - -[#2 Leading delimiter 1:0-1:4] - >----< -1| return 0 - -[#2 Insertion delimiter] = "\n" \ No newline at end of file diff --git a/packages/common/src/scopeSupportFacets/gdscript.ts b/packages/common/src/scopeSupportFacets/gdscript.ts index 10aa1e2c4a..8bd93686ea 100644 --- a/packages/common/src/scopeSupportFacets/gdscript.ts +++ b/packages/common/src/scopeSupportFacets/gdscript.ts @@ -1,17 +1,11 @@ import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; -const { supported, notApplicable } = ScopeSupportFacetLevel; +// eslint-disable-next-line +const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const gdscriptScopeSupport: LanguageScopeSupportFacetMap = { - // supported - "comment.line": supported, - "statement.return": supported, - - // unsupported (none currently defined) - // not applicable - "comment.block": notApplicable, "statement.interface": notApplicable, "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, diff --git a/queries/gdscript.scm b/queries/gdscript.scm index b6ba357764..e69de29bb2 100644 --- a/queries/gdscript.scm +++ b/queries/gdscript.scm @@ -1,2 +0,0 @@ -;; # comment -;; ^^^^^^^^^