Changesets · Branches · Tags · Compare
| Changeset | f96bfd141fb650aecda9f5c08b54343c7988660071cd8f3d899d6ae327460d02 |
|---|---|
| Author | Tomasz Stefaniak <tomasz.p.stefaniak@gmail.com> · 2025-06-11 15:00 -07:00 |
| Committer | Tomasz Stefaniak <tomasz.p.stefaniak@gmail.com> · 2025-06-11 15:04 -07:00 |
| Parents | a840de7f3a7a |
4 files changed
modified core/config/markdown/loadCodebaseRules.ts +2 −1
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | import { ConfigValidationError } from "@continuedev/config-yaml"; |
| 2 | 2 | import { IDE, RuleWithSource } from "../.."; |
| 3 | 3 | import { walkDirs } from "../../indexing/walkDir"; |
| 4 | +import { RULES_MARKDOWN_FILENAME } from "../../llm/rules/constants"; | |
| 4 | 5 | import { getUriPathBasename } from "../../util/uri"; |
| 5 | 6 | import { convertMarkdownRuleToContinueRule } from "./parseMarkdownRule"; |
| 6 | 7 | |
| @@ -21,7 +22,7 @@ | ||
| 21 | 22 | // Filter to just rules.md files |
| 22 | 23 | const rulesMdFiles = allFiles.filter((file) => { |
| 23 | 24 | const filename = getUriPathBasename(file); |
| 24 | - return filename === "rules.md"; | |
| 25 | + return filename === RULES_MARKDOWN_FILENAME; | |
| 25 | 26 | }); |
| 26 | 27 | |
| 27 | 28 | // Process each rules.md file |
modified core/core.ts +4 −3
| @@ -59,6 +59,7 @@ | ||
| 59 | 59 | import { shouldIgnore } from "./indexing/shouldIgnore"; |
| 60 | 60 | import { walkDirCache } from "./indexing/walkDir"; |
| 61 | 61 | import { LLMLogger } from "./llm/logger"; |
| 62 | +import { RULES_MARKDOWN_FILENAME } from "./llm/rules/constants"; | |
| 62 | 63 | import { llmStreamChat } from "./llm/streamChat"; |
| 63 | 64 | import type { FromCoreProtocol, ToCoreProtocol } from "./protocol"; |
| 64 | 65 | import { OnboardingModes } from "./protocol/core"; |
| @@ -583,7 +584,7 @@ | ||
| 583 | 584 | let rulesFileCreated = false; |
| 584 | 585 | for (const uri of data.uris) { |
| 585 | 586 | const filename = getUriPathBasename(uri); |
| 586 | - if (filename === "rules.md") { | |
| 587 | + if (filename === RULES_MARKDOWN_FILENAME) { | |
| 587 | 588 | rulesFileCreated = true; |
| 588 | 589 | break; |
| 589 | 590 | } |
| @@ -614,7 +615,7 @@ | ||
| 614 | 615 | let rulesFileDeleted = false; |
| 615 | 616 | for (const uri of data.uris) { |
| 616 | 617 | const filename = getUriPathBasename(uri); |
| 617 | - if (filename === "rules.md") { | |
| 618 | + if (filename === RULES_MARKDOWN_FILENAME) { | |
| 618 | 619 | rulesFileDeleted = true; |
| 619 | 620 | break; |
| 620 | 621 | } |
| @@ -850,7 +851,7 @@ | ||
| 850 | 851 | uri.endsWith(".prompt") || |
| 851 | 852 | uri.endsWith(SYSTEM_PROMPT_DOT_FILE) || |
| 852 | 853 | (uri.includes(".continue") && uri.endsWith(".yaml")) || |
| 853 | - uri.endsWith("rules.md") | |
| 854 | + uri.endsWith(RULES_MARKDOWN_FILENAME) | |
| 854 | 855 | ) { |
| 855 | 856 | await this.configHandler.reloadConfig(); |
| 856 | 857 | } else if ( |
added core/llm/rules/constants.ts +4 −0
| @@ -0,0 +1,4 @@ | ||
| 1 | +/** | |
| 2 | + * The filename used for colocated markdown rules | |
| 3 | + */ | |
| 4 | +export const RULES_MARKDOWN_FILENAME = "rules.md"; | |
| No newline at the end of the file |
modified core/llm/rules/getSystemMessageWithRules.ts +2 −1
| @@ -8,6 +8,7 @@ | ||
| 8 | 8 | import { renderChatMessage } from "../../util/messageContent"; |
| 9 | 9 | import { getCleanUriPath } from "../../util/uri"; |
| 10 | 10 | import { extractPathsFromCodeBlocks } from "../utils/extractPathsFromCodeBlocks"; |
| 11 | +import { RULES_MARKDOWN_FILENAME } from "./constants"; | |
| 11 | 12 | |
| 12 | 13 | /** |
| 13 | 14 | * Checks if a path matches any of the provided globs |
| @@ -92,7 +93,7 @@ | ||
| 92 | 93 | return ( |
| 93 | 94 | !rule.ruleFile || |
| 94 | 95 | rule.ruleFile.startsWith(".continue/") || |
| 95 | - rule.ruleFile === ".continue/rules.md" | |
| 96 | + rule.ruleFile === `.continue/${RULES_MARKDOWN_FILENAME}` | |
| 96 | 97 | ); |
| 97 | 98 | }; |
| 98 | 99 |