diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a73cd3987..98ca8db1e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,14 +58,6 @@ Continue is continuously improving, but a feature isn't complete until it is ref #### VS Code - -Pre-requisite: you have Node.js version 20.11.0 (LTS) or higher installed. [get it on https://nodejs.org](https://nodejs.org/en/download/ -Alternatively, if you are using NVM (Node Version Manager), you can set the correct version of Node.js for this project by running the following command in the root of the project: - -```bash -nvm use - - Pre-requisite: You should have Node.js version 20.11.0 (LTS) or higher installed. You can get it on [nodejs.org](https://nodejs.org/en/download) or, if you are using NVM (Node Version Manager), you can set the correct version of Node.js for this project by running the following command in the root of the project: ```bash diff --git a/core/indexing/docs/article.ts b/core/indexing/docs/article.ts index 227f86a71..e97bd3aec 100644 --- a/core/indexing/docs/article.ts +++ b/core/indexing/docs/article.ts @@ -94,9 +94,7 @@ export function chunkArticle(articleResult: Article): Chunk[] { return chunks; } -async function extractTitlesAndBodies( - html: string, -): Promise { +function extractTitlesAndBodies(html: string): ArticleComponent[] { const dom = new JSDOM(html); const document = dom.window.document; @@ -117,13 +115,13 @@ async function extractTitlesAndBodies( return result; } -export async function stringToArticle( +export function stringToArticle( url: string, - htmlContent: string, + html: string, subpath: string, -): Promise
{ +): Article | undefined { try { - const dom = new JSDOM(htmlContent); + const dom = new JSDOM(html); let reader = new Readability(dom.window.document); let article = reader.parse(); @@ -131,7 +129,8 @@ export async function stringToArticle( return undefined; } - let article_components = await extractTitlesAndBodies(article.content); + let article_components = extractTitlesAndBodies(article.content); + return { url, subpath, @@ -144,9 +143,7 @@ export async function stringToArticle( } } -export async function pageToArticle( - page: PageData, -): Promise
{ +export function pageToArticle(page: PageData): Article | undefined { try { return stringToArticle(page.url, page.html, page.path); } catch (err) { diff --git a/core/indexing/docs/index.ts b/core/indexing/docs/index.ts index 89906f0f1..79d96371c 100644 --- a/core/indexing/docs/index.ts +++ b/core/indexing/docs/index.ts @@ -29,7 +29,7 @@ export async function* indexDocs( const articles: Article[] = []; for await (const page of crawlPage(baseUrl)) { - const article = await pageToArticle(page); + const article = pageToArticle(page); if (!article) continue; articles.push(article); diff --git a/core/yarn.lock b/core/yarn.lock index e3d3fc3d9..795d82637 100644 --- a/core/yarn.lock +++ b/core/yarn.lock @@ -326,6 +326,11 @@ resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@esbuild/darwin-arm64@0.19.12": + version "0.19.12" + resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz" + integrity sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g== + "@eslint-community/eslint-utils@^4.2.0": version "4.4.0" resolved "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz" @@ -2662,6 +2667,11 @@ fs.realpath@^1.0.0: resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== +fsevents@^2.3.2: + version "2.3.3" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + function-bind@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz" diff --git a/extensions/vscode/src/extension/vscodeExtension.ts b/extensions/vscode/src/extension/vscodeExtension.ts index 5593beee6..6af26350d 100644 --- a/extensions/vscode/src/extension/vscodeExtension.ts +++ b/extensions/vscode/src/extension/vscodeExtension.ts @@ -15,7 +15,6 @@ import { registerAllCodeLensProviders } from "../lang-server/codeLens"; import { setupRemoteConfigSync } from "../stubs/activation"; import { TabAutocompleteModel } from "../util/loadAutocompleteModel"; import { VsCodeWebviewProtocol } from "../webviewProtocol"; -import { registerDebugTracker } from "../debug/debug"; export class VsCodeExtension { private configHandler: ConfigHandler; @@ -49,26 +48,26 @@ export class VsCodeExtension { // Config Handler with output channel const outputChannel = vscode.window.createOutputChannel( - "Continue - LLM Prompt/Completion" + "Continue - LLM Prompt/Completion", ); this.configHandler = new ConfigHandler( this.ide, Promise.resolve(ideSettings), async (log: string) => { outputChannel.appendLine( - "==========================================================================" + "==========================================================================", ); outputChannel.appendLine( - "==========================================================================" + "==========================================================================", ); outputChannel.append(log); }, - () => this.webviewProtocol?.request("configUpdate", undefined) + () => this.webviewProtocol?.request("configUpdate", undefined), ); this.configHandler.reloadConfig(); this.verticalDiffManager = new VerticalPerLineDiffManager( - this.configHandler + this.configHandler, ); this.extensionContext = context; this.tabAutocompleteModel = new TabAutocompleteModel(this.configHandler); @@ -78,7 +77,7 @@ export class VsCodeExtension { this.ide, this.windowId, this.extensionContext, - this.verticalDiffManager + this.verticalDiffManager, ); setupRemoteConfigSync( @@ -92,14 +91,14 @@ export class VsCodeExtension { this.sidebar, { webviewOptions: { retainContextWhenHidden: true }, - } - ) + }, + ), ); this.webviewProtocol = this.sidebar.webviewProtocol; // Indexing + pause token const indexingPauseToken = new PauseToken( - context.globalState.get("continue.indexingPaused") === true + context.globalState.get("continue.indexingPaused") === true, ); this.webviewProtocol.on("index/setPaused", (msg) => { context.globalState.update("continue.indexingPaused", msg.data); @@ -110,14 +109,14 @@ export class VsCodeExtension { this.indexer = new CodebaseIndexer( this.configHandler, this.ide, - indexingPauseToken + indexingPauseToken, ); // CodeLens registerAllCodeLensProviders( context, this.diffManager, - this.verticalDiffManager.editorToVerticalDiffCodeLens + this.verticalDiffManager.editorToVerticalDiffCodeLens, ); // Tab autocomplete @@ -132,9 +131,9 @@ export class VsCodeExtension { new ContinueCompletionProvider( this.configHandler, this.ide, - this.tabAutocompleteModel - ) - ) + this.tabAutocompleteModel, + ), + ), ); // Commands @@ -145,7 +144,7 @@ export class VsCodeExtension { this.sidebar, this.configHandler, this.diffManager, - this.verticalDiffManager + this.verticalDiffManager, ); registerDebugTracker(this.webviewProtocol, this.ide); @@ -196,7 +195,7 @@ export class VsCodeExtension { } }); } - }) + }), ); // Register a content provider for the readonly virtual documents @@ -214,8 +213,8 @@ export class VsCodeExtension { context.subscriptions.push( vscode.workspace.registerTextDocumentContentProvider( VsCodeExtension.continueVirtualDocumentScheme, - documentContentProvider - ) + documentContentProvider, + ), ); }