diff --git a/core/autocomplete/constants/AutocompleteLanguageInfo.ts b/core/autocomplete/constants/AutocompleteLanguageInfo.ts index ccd5a9717a..2f21c5a3e9 100644 --- a/core/autocomplete/constants/AutocompleteLanguageInfo.ts +++ b/core/autocomplete/constants/AutocompleteLanguageInfo.ts @@ -9,7 +9,6 @@ export interface AutocompleteLanguageInfo { topLevelKeywords: string[]; singleLineComment?: string; endOfLine: string[]; - stopWords?: string[]; lineFilters?: LineFilter[]; charFilters?: CharacterFilter[]; useMultiline?: (args: { prefix: string; suffix: string }) => boolean; diff --git a/core/autocomplete/context/NearbyDefinitionsService.ts b/core/autocomplete/context/NearbyDefinitionsService.ts deleted file mode 100644 index 8b526b2614..0000000000 --- a/core/autocomplete/context/NearbyDefinitionsService.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { IDE, Location } from "../.."; -import { LANGUAGES } from "../constants/AutocompleteLanguageInfo"; - -import { getSymbolsForSnippet } from "./ranking"; - -interface FileInfo { - filepath: string; -} - -export class NearbyDefinitionsService { - static N = 10; - - constructor(private readonly ide: IDE) {} - - async getDefinitionsForLine(filepath: string, line: number) { - const lineContent = await this.ide.readRangeInFile(filepath, { - start: { - line, - character: 0, - }, - end: { - line: line + 1, - character: 0, - }, - }); - - // Remove keywords - const lang = LANGUAGES[filepath.split(".").slice(-1)[0]]; - const symbols = Array.from(getSymbolsForSnippet(lineContent)) - .filter((s) => s.length > 0) - .filter((s) => !(lang && lang?.stopWords?.includes(s))); - - return Promise.all( - symbols.map((s) => { - const character = lineContent.indexOf(s); - const pos: Location = { - filepath, - position: { - line, - character, - }, - }; - }), - ); - } -} diff --git a/core/autocomplete/templating/getStopTokens.ts b/core/autocomplete/templating/getStopTokens.ts index fffb5351ba..85131953b6 100644 --- a/core/autocomplete/templating/getStopTokens.ts +++ b/core/autocomplete/templating/getStopTokens.ts @@ -25,7 +25,6 @@ export function getStopTokens( ...(model.toLowerCase().includes("starcoder2") ? STARCODER2_T_ARTIFACTS : []), - ...(lang.stopWords ?? []), // ...lang.topLevelKeywords.map((word) => `\n${word}`), ];