mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-20 00:11:37 +00:00
keep legacy IMPORTS for python (heritage needs importMap), scope phase owns CALLS only
Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/c474dc66-5cf7-445d-8eb4-76501c5e6d67 Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com>
This commit is contained in:
parent
f67061cd66
commit
3e08e73c6a
2 changed files with 6 additions and 19 deletions
|
|
@ -5,8 +5,7 @@ import { isLanguageAvailable, loadParser, loadLanguage } from '../tree-sitter/pa
|
|||
import { getProvider, getProviderForFile, providersWithImplicitWiring } from './languages/index.js';
|
||||
import type { LanguageProvider } from './language-provider.js';
|
||||
import { generateId } from '../../lib/utils.js';
|
||||
import { getLanguageFromFilename, SupportedLanguages } from 'gitnexus-shared';
|
||||
import { isRegistryPrimary } from './registry-primary-flag.js';
|
||||
import { getLanguageFromFilename } from 'gitnexus-shared';
|
||||
import { isVerboseIngestionEnabled } from './utils/verbose.js';
|
||||
import { yieldToEventLoop } from './utils/event-loop.js';
|
||||
import type { ExtractedImport } from './workers/parse-worker.js';
|
||||
|
|
@ -43,8 +42,6 @@ function wireImplicitImports(
|
|||
|
||||
const grouped = new Map<LanguageProvider, string[]>();
|
||||
for (const file of files) {
|
||||
const lang = getLanguageFromFilename(file);
|
||||
if (lang && isRegistryPrimary(lang)) continue;
|
||||
const provider = getProviderForFile(file);
|
||||
if (!provider?.implicitImportWirer) continue;
|
||||
let list = grouped.get(provider);
|
||||
|
|
@ -285,11 +282,6 @@ export const processImports = async (
|
|||
// 1. Check language support first
|
||||
const language = getLanguageFromFilename(file.path);
|
||||
if (!language) continue;
|
||||
// Registry-primary gate: when REGISTRY_PRIMARY_<LANG>=1, the
|
||||
// scope-based pipeline phase (`pythonScopePhase`, etc.) owns
|
||||
// IMPORTS/CALLS emission for this language. Skip the legacy path
|
||||
// here so we don't double-emit edges.
|
||||
if (isRegistryPrimary(language)) continue;
|
||||
if (!isLanguageAvailable(language)) {
|
||||
if (skippedByLang) {
|
||||
skippedByLang.set(language, (skippedByLang.get(language) ?? 0) + 1);
|
||||
|
|
@ -475,10 +467,6 @@ export const processImportsFromExtracted = async (
|
|||
}
|
||||
|
||||
for (const imp of fileImports) {
|
||||
// Registry-primary gate: skip when the scope-based phase owns
|
||||
// emission for this language. `imp.language` is set by the parse
|
||||
// worker; trust it here.
|
||||
if (isRegistryPrimary(imp.language)) continue;
|
||||
totalImportsFound++;
|
||||
|
||||
const provider = getProvider(imp.language);
|
||||
|
|
|
|||
|
|
@ -179,12 +179,11 @@ export function runPythonScopeResolution(
|
|||
nodeLookup,
|
||||
);
|
||||
|
||||
// IMPORTS edges: mirror the legacy file-to-file shape so existing
|
||||
// queries that aggregate by `File → File` continue to work. Done here
|
||||
// (not in `emit-references.emitScopeGraph`) because that path emits
|
||||
// scope-to-scope edges, which are a different schema. Keeping the
|
||||
// legacy shape avoids churn in downstream consumers and tests.
|
||||
const importsEmitted = emitImportEdges(graph, indexes.imports, indexes.scopeTree);
|
||||
// IMPORTS edges are emitted by the legacy `processImports` path
|
||||
// (which heritage resolution depends on for `ctx.resolve` to find
|
||||
// imported symbols). We intentionally do NOT emit IMPORTS here to
|
||||
// avoid duplicates and to keep heritage's resolution chain intact.
|
||||
const importsEmitted = 0;
|
||||
|
||||
return {
|
||||
filesProcessed: parsedFiles.length,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue