Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
YannanGao-gs committed Nov 16, 2023
1 parent 766237f commit d21c45b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 43 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import {
V1_buildSnowflakeAppType,
} from './v1/transformation/pureGraph/to/V1_DSL_SnowflakeApp_BuilderHelper.js';
import { V1_transformSnowflakeApp } from './v1/transformation/pureGraph/from/V1_DSL_SnowflakeApp_TransformerHelper.js';
import { getOwnSnowflakeApp } from '../../DSL_SnowflakeApp_GraphManagerHelper.js';

const SNOWFLAKE_APP_ELEMENT_CLASSIFIER_PATH =
'meta::external::function::activator::snowflakeApp::SnowflakeApp';
Expand Down Expand Up @@ -86,11 +85,9 @@ export class DSL_SnowflakeApp_PureProtocolProcessorPlugin extends PureProtocolPr
elementProtocol.name,
);
V1_checkDuplicatedElement(path, context, undefined);
context.currentSubGraph.setOwnElementInExtension(
path,
metamodel,
SnowflakeApp,
);
// since FunctionActivator is in core and SnowflakeApp extends FunctionActivator, we will index SnowflakeApp
// as FunctionActivator in the graph.
context.currentSubGraph.setOwnFunctionActivator(path, metamodel);
metamodel.applicationName = elementProtocol.applicationName;
metamodel.description = elementProtocol.description;
metamodel.owner = elementProtocol.owner;
Expand All @@ -104,9 +101,10 @@ export class DSL_SnowflakeApp_PureProtocolProcessorPlugin extends PureProtocolPr
context: V1_GraphBuilderContext,
): void => {
assertType(elementProtocol, V1_SnowflakeApp);
const metamodel = getOwnSnowflakeApp(
// since FunctionActivator is in core and SnowflakeApp extends FunctionActivator, we will index SnowflakeApp
// as FunctionActivator in the graph.
const metamodel = context.currentSubGraph.getOwnFunctionActivator(
V1_buildFullPath(elementProtocol.package, elementProtocol.name),
context.currentSubGraph,
);
metamodel.function = PackageableElementExplicitReference.create(
guaranteeNonNullable(
Expand Down

0 comments on commit d21c45b

Please sign in to comment.