From 5de52c8c4f95832caa80cda0275099500e7a20ef Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Thu, 14 Nov 2024 10:30:49 -0800 Subject: [PATCH] test: hardcode gotoDefinition --- .../RootPathContextService.ts | 18 +++++++++--------- core/util/filesystem.ts | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/autocomplete/context/root-path-context/RootPathContextService.ts b/core/autocomplete/context/root-path-context/RootPathContextService.ts index 9c47138cd..2602b5acf 100644 --- a/core/autocomplete/context/root-path-context/RootPathContextService.ts +++ b/core/autocomplete/context/root-path-context/RootPathContextService.ts @@ -90,15 +90,15 @@ export class RootPathContextService { return snippets; } - await Promise.all( - query.matches(node).map(async (match) => { - for (const item of match.captures) { - const endPosition = item.node.endPosition; - const newSnippets = await this.getSnippets(filepath, endPosition); - snippets.push(...newSnippets); - } - }), - ); + const queries = query.matches(node).map(async (match) => { + for (const item of match.captures) { + const endPosition = item.node.endPosition; + const newSnippets = await this.getSnippets(filepath, endPosition); + snippets.push(...newSnippets); + } + }); + + await Promise.all(queries); return snippets; } diff --git a/core/util/filesystem.ts b/core/util/filesystem.ts index de71c15e2..42900edb5 100644 --- a/core/util/filesystem.ts +++ b/core/util/filesystem.ts @@ -20,7 +20,7 @@ import { GetGhTokenArgs } from "../protocol/ide.js"; import { getContinueGlobalPath } from "./paths.js"; class FileSystemIde implements IDE { - constructor(private readonly workspaceDir: string) { } + constructor(private readonly workspaceDir: string) {} showToast( type: ToastType, message: string, @@ -36,7 +36,7 @@ class FileSystemIde implements IDE { } gotoDefinition(location: Location): Promise { - throw new Error("Method not implemented."); + return Promise.resolve([]); } onDidChangeActiveTextEditor(callback: (filepath: string) => void): void { return;