refactor: Change to use topLevelModule helper function (#6264)
This commit is contained in:
@ -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) {
|
||||||
|
Reference in New Issue
Block a user