cleanup
This commit is contained in:
parent
8c49bd8e84
commit
c837378c2e
4 changed files with 0 additions and 12 deletions
|
|
@ -39,13 +39,11 @@ class DocsCrawler {
|
|||
maxRequestsPerCrawl: number = this.MAX_REQUESTS_PER_CRAWL,
|
||||
): AsyncGenerator<PageData, undefined, undefined> {
|
||||
if (startUrl.host === this.GITHUB_HOST) {
|
||||
console.log("GITHUB DETECTED: Using Github");
|
||||
yield* new GitHubCrawler(startUrl).crawl();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
console.log(`Crawling ${startUrl.toString()}: Trying default crawler`);
|
||||
const pageData = await new DefaultCrawler(startUrl).crawl();
|
||||
if (pageData.length > 0) {
|
||||
yield* pageData;
|
||||
|
|
@ -56,11 +54,9 @@ class DocsCrawler {
|
|||
}
|
||||
|
||||
if (this.shouldUseChromium()) {
|
||||
console.log(`Crawling ${startUrl.toString()}: Trying chromium crawler`);
|
||||
yield* new ChromiumCrawler(startUrl, maxRequestsPerCrawl).crawl();
|
||||
} else {
|
||||
let didCrawlSinglePage = false;
|
||||
console.log(`Crawling ${startUrl.toString()}: Trying cheerio crawler`);
|
||||
|
||||
for await (const pageData of new CheerioCrawler(
|
||||
startUrl,
|
||||
|
|
@ -77,10 +73,6 @@ class DocsCrawler {
|
|||
this.chromiumInstaller.shouldProposeUseChromiumOnCrawlFailure();
|
||||
|
||||
if (shouldProposeUseChromium) {
|
||||
console.log(
|
||||
`Crawling ${startUrl.toString()}: Cheerio failed: proposing chromium crawler`,
|
||||
);
|
||||
|
||||
const didInstall =
|
||||
await this.chromiumInstaller.proposeAndAttemptInstall(
|
||||
startUrl.toString(),
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ export const Mention = Node.create<MentionOptions>({
|
|||
char: "@",
|
||||
pluginKey: MentionPluginKey,
|
||||
command: ({ editor, range, props }) => {
|
||||
console.log(props);
|
||||
// increase range.to by one when the next node is of type "text"
|
||||
// and starts with a space character
|
||||
const nodeAfter = editor.view.state.selection.$to.nodeAfter;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ async function resolveEditorContent({
|
|||
for (const p of editorState.content) {
|
||||
if (p.type === "paragraph") {
|
||||
const [text, ctxItems, foundSlashCommand] = resolveParagraph(p);
|
||||
console.log("PARAGRAPH RESOLVE", ctxItems);
|
||||
// Only take the first slash command\
|
||||
if (foundSlashCommand && typeof slashCommand === "undefined") {
|
||||
slashCommand = foundSlashCommand;
|
||||
|
|
@ -137,7 +136,6 @@ async function resolveEditorContent({
|
|||
}
|
||||
}
|
||||
|
||||
console.log(stripImages(parts), contextItems);
|
||||
// cmd+enter to use codebase
|
||||
if (modifiers.useCodebase) {
|
||||
const result = await ideMessenger.request("context/getContextItems", {
|
||||
|
|
@ -218,7 +216,6 @@ function resolveParagraph(
|
|||
if (child.type === "text") {
|
||||
text += text === "" ? child.text?.trimStart() : child.text;
|
||||
} else if (child.type === "mention") {
|
||||
console.log("CHILD", child);
|
||||
text +=
|
||||
typeof child.attrs?.renderInlineAs === "string"
|
||||
? child.attrs.renderInlineAs
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue