File tree 2 files changed +14
-12
lines changed
2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -70,20 +70,14 @@ export class LanguageMapping {
70
70
}
71
71
}
72
72
73
- function isSpecialConcept ( classifier : Classifier | null ) {
74
- return classifier ?. key == PositionClassifier . key ;
75
- }
76
-
77
73
function importFeature ( feature : LWFeature ) : Feature | undefined {
74
+ if ( feature . parent == AST_NODE_CLASSIFIER ) {
75
+ return undefined ;
76
+ }
78
77
const def : Feature = { name : feature . name } ;
79
78
if ( feature instanceof Containment ) {
80
- if ( ! isSpecialConcept ( feature . type ) ) {
81
- def . child = true ;
82
- def . multiple = feature . multiple ;
83
- } else {
84
- // We don't import the containment because we handle it specially
85
- return undefined ;
86
- }
79
+ def . child = true ;
80
+ def . multiple = feature . multiple ;
87
81
}
88
82
return def ;
89
83
}
@@ -141,7 +135,11 @@ export class TylasuInstantiationFacade implements InstantiationFacade<TylasuWrap
141
135
142
136
setFeatureValue ( node : TylasuWrapper , feature : LWFeature , value : unknown ) : void {
143
137
if ( node instanceof TylasuNodeWrapper ) {
144
- if ( feature instanceof Containment ) {
138
+ if ( feature . parent == AST_NODE_CLASSIFIER ) {
139
+ if ( feature . name == "position" ) {
140
+ node . node . position = value as Position ;
141
+ }
142
+ } else if ( feature instanceof Containment ) {
145
143
if ( feature . multiple ) {
146
144
node . node . addChild ( feature . name , ( value as TylasuNodeWrapper ) ?. node ) ;
147
145
} else {
Original file line number Diff line number Diff line change @@ -122,6 +122,10 @@ describe('Lionweb integration', function() {
122
122
expect ( root . getRole ( ) ) . to . be . undefined ;
123
123
expect ( root . nodeDefinition . name ) . to . equal ( "EglCompilationUnit" ) ;
124
124
expect ( root . containment ( "position" ) ) . to . be . undefined ;
125
+ expect ( ( ) => root . getAttributeValue ( "position" ) ) . to . throw ( ) ;
126
+ expect ( root . nodeDefinition . features . position ) . to . be . undefined ;
127
+ expect ( root . nodeDefinition . features . originalNode ) . to . be . undefined ;
128
+ expect ( root . nodeDefinition . features . transpiledNode ) . to . be . undefined ;
125
129
expect ( root . position ) . not . to . be . undefined ;
126
130
expect ( root . position ?. start . line ) . to . equal ( 1 ) ;
127
131
expect ( root . position ?. start . column ) . to . equal ( 0 ) ;
You can’t perform that action at this time.
0 commit comments