refactor: Change to use topLevelModule helper function (#6264)

This commit is contained in:
Jonathan Tran
2025-04-11 01:13:10 -04:00
committed by GitHub
parent 0d899694b2
commit 6f2e6d14b6

View File

@ -12,6 +12,7 @@ import {
getSweepFromSuspectedSweepSurface,
getWallCodeRef,
} from '@src/lang/std/artifactGraph'
import { isTopLevelModule } from '@src/lang/util'
import type { CallExpression, CallExpressionKw } from '@src/lang/wasm'
import { defaultSourceRange } from '@src/lang/wasm'
import type { DefaultPlaneStr } from '@src/lib/planes'
@ -190,8 +191,8 @@ export function useEngineConnectionSubscriptions() {
kclManager.artifactGraph
)
if (!err(extrusion)) {
const fileIndex = getModuleId(extrusion.codeRef.range)
if (fileIndex !== 0) {
if (!isTopLevelModule(extrusion.codeRef.range)) {
const fileIndex = getModuleId(extrusion.codeRef.range)
const importDetails =
kclManager.execState.filenames[fileIndex]
if (!importDetails) {