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