Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/chunking/core.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ describe('constants', () => {
})

describe('isSupportedLanguage', () => {
it('returns false for unknown languages (Unit 4 stub)', () => {
expect(isSupportedLanguage('typescript')).toBe(false)
expect(isSupportedLanguage('python')).toBe(false)
it('returns true for known languages and false for unknown ones', () => {
expect(isSupportedLanguage('typescript')).toBe(true)
expect(isSupportedLanguage('python')).toBe(true)
expect(isSupportedLanguage('not-a-real-language')).toBe(false)
})
})
Expand Down
5 changes: 1 addition & 4 deletions src/chunking/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
// loads even when the package is not yet installed, falling back to the
// line chunker in that case.

// Stub for ALL_LANGUAGES until Unit 4 (language detection) lands.
// Once `src/indexing/files.ts` exists, replace this with:
// import { ALL_LANGUAGES } from '../indexing/files.ts'
const ALL_LANGUAGES: ReadonlySet<string> = new Set<string>()
import { ALL_LANGUAGES } from '../languages.ts'

export const RECURSION_DEPTH = 500
export const MIN_CHUNK_SIZE = 50
Expand Down
2 changes: 1 addition & 1 deletion src/indexing/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import { chmodSync, existsSync, mkdirSync, readdirSync, realpathSync, rmSync } f
import { readFile, stat } from 'node:fs/promises'
import { homedir } from 'node:os'
import { basename, dirname, join, normalize, relative } from 'node:path'
import { getExtensions } from '../languages.ts'
import { isGitUrl } from '../utils.ts'
import { MAX_FILE_BYTES } from './create.ts'
import { walkFiles } from './file-walker.ts'
import { getExtensions } from './files.ts'
import { CspIndex, DEFAULT_CONTENT, parseManifest } from './index.ts'

/** Directory permissions for every cache directory (owner-only). NFR-003. */
Expand Down
2 changes: 1 addition & 1 deletion src/indexing/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import type { Model } from './dense.ts'
import { readFileSync, statSync } from 'node:fs'
import { relative } from 'node:path'
import { chunkSource } from '../chunking/chunk-source.ts'
import { detectLanguage, getExtensions } from '../languages.ts'
import { tokenize } from '../tokens.ts'
import { ContentType } from '../types.ts'
import { embedChunks, SelectableBasicBackend } from './dense.ts'
import { walkFiles } from './file-walker.ts'
import { detectLanguage, getExtensions } from './files.ts'
import { Bm25Index, enrichForBm25 } from './sparse.ts'

/** 1 MB max file size to read and index. */
Expand Down
2 changes: 1 addition & 1 deletion src/indexing/files.test.ts → src/languages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
DOC_LANGUAGES,
EXTENSION_TO_LANGUAGE,
getExtensions,
} from './files.ts'
} from './languages.ts'

describe('detectLanguage', () => {
it('detects typescript from .ts', () => {
Expand Down
File renamed without changes.
Loading