diff --git a/build/tests/mpsHttpSupport.xml b/build/tests/mpsHttpSupport.xml index 553ad37293c7..0399e1b48a2a 100644 --- a/build/tests/mpsHttpSupport.xml +++ b/build/tests/mpsHttpSupport.xml @@ -92,6 +92,7 @@ + @@ -105,6 +106,12 @@ + + + + + + @@ -317,11 +324,13 @@ + + @@ -382,6 +391,7 @@ + diff --git a/plugins/mps-build/solutions/mpsBuild/source_gen/jetbrains/mps/ide/build/tests/mpsHttpSupport.xml b/plugins/mps-build/solutions/mpsBuild/source_gen/jetbrains/mps/ide/build/tests/mpsHttpSupport.xml index 553ad37293c7..0399e1b48a2a 100644 --- a/plugins/mps-build/solutions/mpsBuild/source_gen/jetbrains/mps/ide/build/tests/mpsHttpSupport.xml +++ b/plugins/mps-build/solutions/mpsBuild/source_gen/jetbrains/mps/ide/build/tests/mpsHttpSupport.xml @@ -92,6 +92,7 @@ + @@ -105,6 +106,12 @@ + + + + + + @@ -317,11 +324,13 @@ + + @@ -382,6 +391,7 @@ + diff --git a/plugins/mps-build/solutions/mpsBuild/source_gen/jetbrains/mps/ide/build/tests/trace.info b/plugins/mps-build/solutions/mpsBuild/source_gen/jetbrains/mps/ide/build/tests/trace.info index 0df5b39fe991..57201cc0018e 100644 --- a/plugins/mps-build/solutions/mpsBuild/source_gen/jetbrains/mps/ide/build/tests/trace.info +++ b/plugins/mps-build/solutions/mpsBuild/source_gen/jetbrains/mps/ide/build/tests/trace.info @@ -77,7 +77,7 @@ - + diff --git a/plugins/mps-httpsupport/language/generator/source_gen.caches/jetbrains/mps/ide/httpsupport/generated b/plugins/mps-httpsupport/language/generator/source_gen.caches/jetbrains/mps/ide/httpsupport/generated index a44e1d975355..f2a4dce8fc42 100644 --- a/plugins/mps-httpsupport/language/generator/source_gen.caches/jetbrains/mps/ide/httpsupport/generated +++ b/plugins/mps-httpsupport/language/generator/source_gen.caches/jetbrains/mps/ide/httpsupport/generated @@ -1,5 +1,5 @@ - + diff --git a/plugins/mps-httpsupport/language/generator/source_gen.caches/jetbrains/mps/ide/httpsupport/generator/template/main/generated b/plugins/mps-httpsupport/language/generator/source_gen.caches/jetbrains/mps/ide/httpsupport/generator/template/main/generated index 4c2d95b83421..4a0119761a9f 100644 --- a/plugins/mps-httpsupport/language/generator/source_gen.caches/jetbrains/mps/ide/httpsupport/generator/template/main/generated +++ b/plugins/mps-httpsupport/language/generator/source_gen.caches/jetbrains/mps/ide/httpsupport/generator/template/main/generated @@ -1,5 +1,5 @@ - + diff --git a/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/Generator.java b/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/Generator.java index 41d977e7f7ce..5e80e976d638 100644 --- a/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/Generator.java +++ b/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/Generator.java @@ -36,18 +36,20 @@ protected void fillTemplateModels(TemplateModuleInterpreted2.TemplateModels mode @Override public Collection getTargetLanguages() { - SLanguage[] rv = new SLanguage[6]; + SLanguage[] rv = new SLanguage[8]; rv[0] = MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"); - rv[1] = MetaAdapterFactory.getLanguage(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, "jetbrains.mps.baseLanguage.collections"); - rv[2] = MetaAdapterFactory.getLanguage(0xc7d5b9dda05f4be2L, 0xbc73f2e16994cc67L, "jetbrains.mps.baseLanguage.lightweightdsl"); - rv[3] = MetaAdapterFactory.getLanguage(0xdf345b11b8c74213L, 0xac6648d2a9b75d88L, "jetbrains.mps.baseLanguageInternal"); - rv[4] = MetaAdapterFactory.getLanguage(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, "jetbrains.mps.lang.core"); - rv[5] = MetaAdapterFactory.getLanguage(0xc0080a477e374558L, 0xbee99ae18e690549L, "jetbrains.mps.lang.extension"); + rv[1] = MetaAdapterFactory.getLanguage(0xfd3920347849419dL, 0x907112563d152375L, "jetbrains.mps.baseLanguage.closures"); + rv[2] = MetaAdapterFactory.getLanguage(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, "jetbrains.mps.baseLanguage.collections"); + rv[3] = MetaAdapterFactory.getLanguage(0xc7d5b9dda05f4be2L, 0xbc73f2e16994cc67L, "jetbrains.mps.baseLanguage.lightweightdsl"); + rv[4] = MetaAdapterFactory.getLanguage(0xdf345b11b8c74213L, 0xac6648d2a9b75d88L, "jetbrains.mps.baseLanguageInternal"); + rv[5] = MetaAdapterFactory.getLanguage(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, "jetbrains.mps.ide.httpsupport"); + rv[6] = MetaAdapterFactory.getLanguage(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, "jetbrains.mps.lang.core"); + rv[7] = MetaAdapterFactory.getLanguage(0xc0080a477e374558L, 0xbee99ae18e690549L, "jetbrains.mps.lang.extension"); return Arrays.asList(rv); } @Override public Collection getPriorities() { - return TemplateUtil.asCollection(TemplateUtil.createStrictlyAfterRule(TemplateUtil.createRefExternal("69433612-0c08-4d65-8f7c-839ae8b13b0d(jetbrains.mps.ide.httpsupport#4517832885627178591)", TemplateUtil.createRefNormal("r:54a5f1cc-4056-4ebe-b91a-271cac338c49(jetbrains.mps.ide.httpsupport.generator.template.main@generator)", "4622937352056028158", "main_request")), TemplateUtil.createRefExternal("1d6e05d7-9de9-40a7-9dad-7b8444280942(jetbrains.mps.lang.plugin#1203080439937)", TemplateUtil.createRefNormal("r:00000000-0000-4000-0000-011c89590369(jetbrains.mps.lang.plugin.generator.baseLanguage.template.main@generator)", "1204478979997", "Actions")))); + return TemplateUtil.asCollection(TemplateUtil.createStrictlyAfterRule(TemplateUtil.createRefExternal("69433612-0c08-4d65-8f7c-839ae8b13b0d(jetbrains.mps.ide.httpsupport#4517832885627178591)", TemplateUtil.createRefNormal("r:54a5f1cc-4056-4ebe-b91a-271cac338c49(jetbrains.mps.ide.httpsupport.generator.template.main@generator)", "4622937352056028158", "main_request")), TemplateUtil.createRefExternal("1d6e05d7-9de9-40a7-9dad-7b8444280942(jetbrains.mps.lang.plugin#1203080439937)", TemplateUtil.createRefNormal("r:00000000-0000-4000-0000-011c89590369(jetbrains.mps.lang.plugin.generator.baseLanguage.template.main@generator)", "1204478979997", "Actions"))), TemplateUtil.createStrictlyBeforeRule(TemplateUtil.createRefExternal("69433612-0c08-4d65-8f7c-839ae8b13b0d(jetbrains.mps.ide.httpsupport#4517832885627178591)", TemplateUtil.createRefNormal("r:54a5f1cc-4056-4ebe-b91a-271cac338c49(jetbrains.mps.ide.httpsupport.generator.template.main@generator)", "2345521174008440735", "mappingRessourceHandler")), TemplateUtil.createRefExternal("69433612-0c08-4d65-8f7c-839ae8b13b0d(jetbrains.mps.ide.httpsupport#4517832885627178591)", TemplateUtil.createRefNormal("r:54a5f1cc-4056-4ebe-b91a-271cac338c49(jetbrains.mps.ide.httpsupport.generator.template.main@generator)", "5573986434797587359", "main")))); } } diff --git a/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/generator/template/main/QueriesGenerated.java b/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/generator/template/main/QueriesGenerated.java index 1cc490bc88d6..a5d1ddc2e049 100644 --- a/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/generator/template/main/QueriesGenerated.java +++ b/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/generator/template/main/QueriesGenerated.java @@ -216,6 +216,12 @@ public static Object propertyMacro_GetValue_10_0(final PropertyMacroContext _con public static Object propertyMacro_GetValue_12_0(final PropertyMacroContext _context) { return String.valueOf((int) PortProvider__BehaviorDescriptor.getPort_id6WBmrsjA4L4.invoke(_context.getNode())); } + public static Object propertyMacro_GetValue_14_0(final PropertyMacroContext _context) { + return ListSequence.fromList(SLinkOperations.getChildren(SLinkOperations.getTarget(_context.getNode(), LINKS.queryPrefix$UK48), LINKS.segmetns$sMjR)).count(); + } + public static Object propertyMacro_GetValue_14_1(final PropertyMacroContext _context) { + return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL); + } public static Object referenceMacro_GetReferent_1_0(final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(_context.getNode(), LINKS.queryParameter$QWu8), "QUERY"); } @@ -234,6 +240,9 @@ public static boolean ifMacro_Condition_4_0(final IfMacroContext _context) { public static boolean ifMacro_Condition_10_0(final IfMacroContext _context) { return (SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.declaration$TFiC), LINKS.defaultValueFunction$2M9p) != null); } + public static boolean ifMacro_Condition_14_0(final IfMacroContext _context) { + return (SLinkOperations.getTarget(_context.getNode(), LINKS.contentTypeFunction$GjmS) == null); + } public static SNode sourceNodeQuery_1_0(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), LINKS.buffer$1881); } @@ -408,11 +417,17 @@ public static SNode sourceNodeQuery_13_0(final SourceSubstituteMacroNodeContext public static SNode sourceNodeQuery_13_1(final SourceSubstituteMacroNodeContext _context) { return SLinkOperations.getTarget(_context.getNode(), LINKS.operation$gs9E); } + public static SNode sourceNodeQuery_14_0(final SourceSubstituteMacroNodeContext _context) { + return SLinkOperations.getTarget(_context.getNode(), LINKS.queryPrefix$UK48); + } + public static SNode sourceNodeQuery_14_1(final SourceSubstituteMacroNodeContext _context) { + return SLinkOperations.getTarget(_context.getNode(), LINKS.canHandleFunction$UKLb); + } public static Object templateArgumentQuery_6_0(final TemplateArgumentContext _context) { - return _quotation_createNode_x583g4_a0a511(IParameterConverter__BehaviorDescriptor.getParameterType_id4rKp80ZJrgq.invoke(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.parameter$DxS8), LINKS.parameterConverter$QDBo)), SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), LINKS.parameter$DxS8), PROPS.name$MnvL)); + return _quotation_createNode_x583g4_a0a021(IParameterConverter__BehaviorDescriptor.getParameterType_id4rKp80ZJrgq.invoke(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.parameter$DxS8), LINKS.parameterConverter$QDBo)), SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), LINKS.parameter$DxS8), PROPS.name$MnvL)); } public static Object templateArgumentQuery_2_0(final TemplateArgumentContext _context) { - return _quotation_createNode_x583g4_a0a611(SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL) + "_serialized"); + return _quotation_createNode_x583g4_a0a121(SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL) + "_serialized"); } public static Iterable sourceNodesQuery_2_0(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(SLinkOperations.getTarget(_context.getNode(), LINKS.queryPrefix$HsUP), LINKS.segmetns$sMjR); @@ -428,7 +443,7 @@ public static Iterable sourceNodesQuery_2_3(final SourceSubstituteMacroNo } public static Iterable sourceNodesQuery_2_4(final SourceSubstituteMacroNodesContext _context) { if ((SLinkOperations.getTarget(_context.getNode(), LINKS.canHandleFunction$Shog) == null)) { - return Sequence.singleton(_quotation_createNode_x583g4_a0a0a0a121()); + return Sequence.singleton(_quotation_createNode_x583g4_a0a0a0a621()); } return SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.canHandleFunction$Shog), LINKS.body$e68K), LINKS.statement$53DE); } @@ -453,6 +468,9 @@ public static Iterable sourceNodesQuery_6_1(final SourceSubstituteMacroNo public static Iterable sourceNodesQuery_6_2(final SourceSubstituteMacroNodesContext _context) { return SLinkOperations.getChildren(_context.getNode(), LINKS.initializer$Xe8); } + public static Iterable sourceNodesQuery_14_0(final SourceSubstituteMacroNodesContext _context) { + return SLinkOperations.getChildren(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), LINKS.contentTypeFunction$GjmS), LINKS.body$e68K), LINKS.statement$53DE); + } public static boolean mc_Condition_7(final TemplateQueryContext _context) { return !(ListSequence.fromList(SModelOperations.nodes(_context.getInputModel(), CONCEPTS.RequestURLBuilderExpression$pg)).isEmpty()); } @@ -656,6 +674,8 @@ public boolean check(TemplateQueryContext ctx) throws GenerationFailureException snqMethods.put("3286885855910483636", new SNQ(i++)); snqMethods.put("1829257266377441241", new SNQ(i++)); snqMethods.put("8659513752524931867", new SNQ(i++)); + snqMethods.put("2345521174007702708", new SNQ(i++)); + snqMethods.put("2345521174007640660", new SNQ(i++)); } @NotNull @Override @@ -790,6 +810,10 @@ public SNode evaluate(@NotNull SourceSubstituteMacroNodeContext ctx) throws Gene return QueriesGenerated.sourceNodeQuery_13_0(ctx); case 57: return QueriesGenerated.sourceNodeQuery_13_1(ctx); + case 58: + return QueriesGenerated.sourceNodeQuery_14_0(ctx); + case 59: + return QueriesGenerated.sourceNodeQuery_14_1(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } @@ -810,6 +834,7 @@ public SNode evaluate(@NotNull SourceSubstituteMacroNodeContext ctx) throws Gene snsqMethods.put("4622937352056075756", new SNsQ(i++)); snsqMethods.put("4622937352055440759", new SNsQ(i++)); snsqMethods.put("5111696079054987314", new SNsQ(i++)); + snsqMethods.put("3726061952476974940", new SNsQ(i++)); } @NotNull @Override @@ -852,6 +877,8 @@ public Collection evaluate(@NotNull SourceSubstituteMacroNodesContext ctx return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_6_1(ctx)); case 11: return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_6_2(ctx)); + case 12: + return IterableUtil.asCollection(QueriesGenerated.sourceNodesQuery_14_0(ctx)); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } @@ -881,6 +908,8 @@ public Collection evaluate(@NotNull SourceSubstituteMacroNodesContext ctx pvqMethods.put("5111696079055182095", new PVQ(i++, MetaAdapterFactory.getProperty(0xdf345b11b8c74213L, 0xac6648d2a9b75d88L, 0x1115749abe3L, 0x1115767a8eeL, "fqClassName"), "converter.name")); pvqMethods.put("3286885855910478413", new PVQ(i++, MetaAdapterFactory.getProperty(0xdf345b11b8c74213L, 0xac6648d2a9b75d88L, 0x1115749abe3L, 0x1115767a8eeL, "fqClassName"), "converter.name")); pvqMethods.put("8009469105144847067", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L, 0xf93d565d11L, "value"), null)); + pvqMethods.put("2345521174007962140", new PVQ(i++, MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc59b314L, 0xf8cc59b315L, "value"), "2")); + pvqMethods.put("2345521174008670427", new PVQ(i++, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "map_RessourceHandler")); } @NotNull @Override @@ -942,6 +971,10 @@ public Object evaluate(@NotNull PropertyMacroContext ctx) throws GenerationFailu return QueriesGenerated.propertyMacro_GetValue_10_0(ctx); case 20: return QueriesGenerated.propertyMacro_GetValue_12_0(ctx); + case 21: + return QueriesGenerated.propertyMacro_GetValue_14_0(ctx); + case 22: + return QueriesGenerated.propertyMacro_GetValue_14_1(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } @@ -953,6 +986,7 @@ public Object evaluate(@NotNull PropertyMacroContext ctx) throws GenerationFailu imcMethods.put("1546095305979194294", new IfMC(i++)); imcMethods.put("1546095305979810535", new IfMC(i++)); imcMethods.put("1546095305979349200", new IfMC(i++)); + imcMethods.put("3726061952476961083", new IfMC(i++)); } @NotNull @Override @@ -977,6 +1011,8 @@ public boolean check(@NotNull IfMacroContext ctx) throws GenerationFailureExcept return QueriesGenerated.ifMacro_Condition_4_0(ctx); case 2: return QueriesGenerated.ifMacro_Condition_10_0(ctx); + case 3: + return QueriesGenerated.ifMacro_Condition_14_0(ctx); default: throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no condition method for if macro %s (key: #%d)", ctx.getTemplateReference(), methodKey)); } @@ -1281,7 +1317,7 @@ private static SNode _quotation_createNode_x583g4_b0a0a82() { quotedNode_1.setReference(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"), SReference.create(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"), quotedNode_1, facade.createModelReference("6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.project(MPS.Core/)"), facade.createNodeId("~Project"))); return quotedNode_1; } - private static SNode _quotation_createNode_x583g4_a0a511(Object parameter_1, Object parameter_2) { + private static SNode _quotation_createNode_x583g4_a0a021(Object parameter_1, Object parameter_2) { PersistenceFacade facade = PersistenceFacade.getInstance(); SNode quotedNode_3 = null; SNode quotedNode_4 = null; @@ -1293,7 +1329,7 @@ private static SNode _quotation_createNode_x583g4_a0a511(Object parameter_1, Obj } return quotedNode_3; } - private static SNode _quotation_createNode_x583g4_a0a611(Object parameter_1) { + private static SNode _quotation_createNode_x583g4_a0a121(Object parameter_1) { PersistenceFacade facade = PersistenceFacade.getInstance(); SNode quotedNode_2 = null; SNode quotedNode_3 = null; @@ -1304,7 +1340,7 @@ private static SNode _quotation_createNode_x583g4_a0a611(Object parameter_1) { quotedNode_2.addChild(MetaAdapterFactory.getContainmentLink(0xdf345b11b8c74213L, 0xac6648d2a9b75d88L, 0x111fb5bb1f2L, 0x111fb5c4f4cL, "type"), quotedNode_3); return quotedNode_2; } - private static SNode _quotation_createNode_x583g4_a0a0a0a121() { + private static SNode _quotation_createNode_x583g4_a0a0a0a621() { PersistenceFacade facade = PersistenceFacade.getInstance(); SNode quotedNode_1 = null; SNode quotedNode_2 = null; @@ -1323,13 +1359,16 @@ private static final class LINKS { /*package*/ static final SContainmentLink segmetns$sMjR = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x53d29f104fa64ed7L, 0x53d29f104fa64ef2L, "segmetns"); /*package*/ static final SReferenceLink parameter$DxS8 = MetaAdapterFactory.getReferenceLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4027f9073ff5cf17L, 0x4027f9073ff5cf18L, "parameter"); /*package*/ static final SReferenceLink declaration$TFiC = MetaAdapterFactory.getReferenceLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdb465L, 0x46f064803fbdb466L, "declaration"); + /*package*/ static final SContainmentLink queryPrefix$UK48 = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x208cf714a5de8e0dL, 0x208cf714a5de8e0eL, "queryPrefix"); /*package*/ static final SReferenceLink queryParameter$QWu8 = MetaAdapterFactory.getReferenceLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x205f4376c5884e95L, 0x205f4376c5884e96L, "queryParameter"); /*package*/ static final SContainmentLink defaultValueFunction$2M9p = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d1bb14fe8385046L, 0x2d9d5d4572ccb260L, "defaultValueFunction"); + /*package*/ static final SContainmentLink contentTypeFunction$GjmS = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x208cf714a5de8e0dL, 0x33b5a19ab0799c63L, "contentTypeFunction"); /*package*/ static final SContainmentLink parameterConverter$QDBo = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x205f4376c585b439L, 0x46f064803fbfba0fL, "parameterConverter"); /*package*/ static final SContainmentLink parameterType$5sXM = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d1bb14fe8385046L, 0x3d1bb14fe83869abL, "parameterType"); /*package*/ static final SContainmentLink port$JG9s = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4027f9073ff5ce93L, 0x6f2759b71399b650L, "port"); /*package*/ static final SContainmentLink value$DBhv = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4027f9073ff5cf17L, 0x4027f9073ff5cf1aL, "value"); /*package*/ static final SContainmentLink parameterType$pSvb = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdcb2eL, 0x46f064803fbdcb48L, "parameterType"); + /*package*/ static final SContainmentLink canHandleFunction$UKLb = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x208cf714a5de8e0dL, 0x208cf714a5de8e11L, "canHandleFunction"); /*package*/ static final SContainmentLink queryParameters$sPtY = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4d5ac72154f4d780L, 0x205f4376c585d782L, "queryParameters"); /*package*/ static final SContainmentLink canHandleFunction$Shog = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4d5ac72154f4d780L, 0x5354a94149f3cfcaL, "canHandleFunction"); /*package*/ static final SContainmentLink body$e68K = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L, 0x108bbd29b4aL, "body"); diff --git a/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/generator/template/main/trace.info b/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/generator/template/main/trace.info index ac3f584e7d4e..f03b98da6b0f 100644 --- a/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/generator/template/main/trace.info +++ b/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/generator/template/main/trace.info @@ -8,97 +8,155 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - + + + - - - - - - - + + + + + + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - + + + - - - - - - - + + + + + + + - + - + - + @@ -106,25 +164,25 @@ - - - - - - - + + + + + + + - + - + - + - + @@ -132,21 +190,21 @@ - - - - - - + + + + + + - - - + + + @@ -172,144 +230,144 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -322,36 +380,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -364,54 +422,54 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -448,194 +506,194 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - + - + - + - + - + - + @@ -654,144 +712,144 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -804,36 +862,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -846,54 +904,54 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -930,120 +988,120 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - + + + + + + + + + + + + @@ -1054,80 +1112,80 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -1135,28 +1193,28 @@ - + - + - + - + - + - + - + - + @@ -1168,12 +1226,12 @@ - + - + @@ -1181,13 +1239,13 @@ - - - - - - - + + + + + + + @@ -1195,39 +1253,39 @@ - - - - - - - - - - - + + + + + + + + + + + - - - + + + - - - - - - - + + + + + + + - + - + - + @@ -1235,30 +1293,30 @@ - - - - - - - - + + + + + + + + - - + + - - - - - + + + + + - + - + @@ -1273,51 +1331,51 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1326,13 +1384,13 @@ - - - - - - - + + + + + + + @@ -1341,22 +1399,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -1381,44 +1439,44 @@ - + - + - + - + - + - + - - + + - - + + - - + + - + @@ -1431,130 +1489,130 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1570,58 +1628,58 @@ - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + diff --git a/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/trace.info b/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/trace.info index c5a70ed23e78..ebd46f3fb478 100644 --- a/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/trace.info +++ b/plugins/mps-httpsupport/language/generator/source_gen/jetbrains/mps/ide/httpsupport/trace.info @@ -2,7 +2,7 @@ - + diff --git a/plugins/mps-httpsupport/language/generator/template/main@generator.mps b/plugins/mps-httpsupport/language/generator/template/main@generator.mps index 2944b0a9e82a..521f666f4b25 100644 --- a/plugins/mps-httpsupport/language/generator/template/main@generator.mps +++ b/plugins/mps-httpsupport/language/generator/template/main@generator.mps @@ -30,9 +30,14 @@ + + + + + + - @@ -97,6 +102,10 @@ + + + + @@ -130,6 +139,7 @@ + @@ -159,6 +169,10 @@ + + + + @@ -187,6 +201,11 @@ + + + + + @@ -199,6 +218,9 @@ + + + @@ -310,6 +332,16 @@ + + + + + + + + + + @@ -355,6 +387,7 @@ + @@ -421,6 +454,7 @@ + @@ -446,10 +480,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4964,5 +5024,401 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/mps-httpsupport/language/jetbrains.mps.ide.httpsupport.mpl b/plugins/mps-httpsupport/language/jetbrains.mps.ide.httpsupport.mpl index fa0203357cc6..eb974e2486dd 100644 --- a/plugins/mps-httpsupport/language/jetbrains.mps.ide.httpsupport.mpl +++ b/plugins/mps-httpsupport/language/jetbrains.mps.ide.httpsupport.mpl @@ -102,6 +102,20 @@ + + + + + + + + + + + + + + diff --git a/plugins/mps-httpsupport/language/models/behavior.mps b/plugins/mps-httpsupport/language/models/behavior.mps index ca5ac5e8d3cd..e2e746784fb6 100644 --- a/plugins/mps-httpsupport/language/models/behavior.mps +++ b/plugins/mps-httpsupport/language/models/behavior.mps @@ -1269,5 +1269,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/mps-httpsupport/language/models/editor.mps b/plugins/mps-httpsupport/language/models/editor.mps index 941d28f3cd12..4dd816766993 100644 --- a/plugins/mps-httpsupport/language/models/editor.mps +++ b/plugins/mps-httpsupport/language/models/editor.mps @@ -1021,5 +1021,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/mps-httpsupport/language/models/structure.mps b/plugins/mps-httpsupport/language/models/structure.mps index a5d55bd0aba8..743aff589599 100644 --- a/plugins/mps-httpsupport/language/models/structure.mps +++ b/plugins/mps-httpsupport/language/models/structure.mps @@ -533,5 +533,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/behavior/dependencies b/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/behavior/dependencies index b68ea7464b1b..371ea5c8950f 100644 --- a/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/behavior/dependencies +++ b/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/behavior/dependencies @@ -3,6 +3,7 @@ + @@ -55,6 +56,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/behavior/generated b/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/behavior/generated index 80ee389e3665..29581d931745 100644 --- a/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/behavior/generated +++ b/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/behavior/generated @@ -1,5 +1,5 @@ - - + + diff --git a/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/editor/dependencies b/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/editor/dependencies index 63b7023e5472..8abd87424872 100644 --- a/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/editor/dependencies +++ b/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/editor/dependencies @@ -59,6 +59,7 @@ + @@ -897,5 +898,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/editor/generated b/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/editor/generated index 957145687d35..4164484ab829 100644 --- a/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/editor/generated +++ b/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/editor/generated @@ -1,5 +1,5 @@ - - + + diff --git a/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/generated b/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/generated index 99990efc63e1..b25e0928f414 100644 --- a/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/generated +++ b/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/generated @@ -1,5 +1,5 @@ - + diff --git a/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/structure/generated b/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/structure/generated index 9c52b510abec..cbe51f4bc5eb 100644 --- a/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/structure/generated +++ b/plugins/mps-httpsupport/language/source_gen.caches/jetbrains/mps/ide/httpsupport/structure/generated @@ -1,5 +1,5 @@ - + diff --git a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/behavior/BehaviorAspectDescriptor.java b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/behavior/BehaviorAspectDescriptor.java index eced07251d05..355316f6b94b 100644 --- a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/behavior/BehaviorAspectDescriptor.java +++ b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/behavior/BehaviorAspectDescriptor.java @@ -15,6 +15,7 @@ public final class BehaviorAspectDescriptor extends BaseBehaviorAspectDescriptor private final BHDescriptor myNode_getURLOperation__BehaviorDescriptor = new Node_getURLOperation__BehaviorDescriptor(); private final BHDescriptor myQueryParameterReference__BehaviorDescriptor = new QueryParameterReference__BehaviorDescriptor(); private final BHDescriptor myDefaultValueFunction__BehaviorDescriptor = new DefaultValueFunction__BehaviorDescriptor(); + private final BHDescriptor myContentTypeFunction__BehaviorDescriptor = new ContentTypeFunction__BehaviorDescriptor(); private final BHDescriptor mySerializeFunction__BehaviorDescriptor = new SerializeFunction__BehaviorDescriptor(); private final BHDescriptor mySerializedValueParameter__BehaviorDescriptor = new SerializedValueParameter__BehaviorDescriptor(); private final BHDescriptor myValueToSerializeParameter__BehaviorDescriptor = new ValueToSerializeParameter__BehaviorDescriptor(); @@ -42,44 +43,46 @@ public BHDescriptor getDescriptor(@NotNull SAbstractConcept concept) { case 0: return myCanHandleRequestFunction__BehaviorDescriptor; case 1: - return myDefaultParameterConverter__BehaviorDescriptor; + return myContentTypeFunction__BehaviorDescriptor; case 2: - return myDefaultValueFunction__BehaviorDescriptor; + return myDefaultParameterConverter__BehaviorDescriptor; case 3: - return myDeserializeFunction__BehaviorDescriptor; + return myDefaultValueFunction__BehaviorDescriptor; case 4: - return myHandleRequestFunction__BehaviorDescriptor; + return myDeserializeFunction__BehaviorDescriptor; case 5: - return myIDEAPlatformPortProvider__BehaviorDescriptor; + return myHandleRequestFunction__BehaviorDescriptor; case 6: - return myIParameterConverter__BehaviorDescriptor; + return myIDEAPlatformPortProvider__BehaviorDescriptor; case 7: - return myMPSIntegrationPortProvider__BehaviorDescriptor; + return myIParameterConverter__BehaviorDescriptor; case 8: - return myMPSInternalPortProvider__BehaviorDescriptor; + return myMPSIntegrationPortProvider__BehaviorDescriptor; case 9: - return myNode_getURLOperation__BehaviorDescriptor; + return myMPSInternalPortProvider__BehaviorDescriptor; case 10: - return myParameterConverterReference__BehaviorDescriptor; + return myNode_getURLOperation__BehaviorDescriptor; case 11: - return myPort__BehaviorDescriptor; + return myParameterConverterReference__BehaviorDescriptor; case 12: - return myPortProvider__BehaviorDescriptor; + return myPort__BehaviorDescriptor; case 13: - return myQueryParameterReference__BehaviorDescriptor; + return myPortProvider__BehaviorDescriptor; case 14: - return myRequestHandler__BehaviorDescriptor; + return myQueryParameterReference__BehaviorDescriptor; case 15: - return myRequestURLBuilderExpression__BehaviorDescriptor; + return myRequestHandler__BehaviorDescriptor; case 16: - return mySerializeFunction__BehaviorDescriptor; + return myRequestURLBuilderExpression__BehaviorDescriptor; case 17: - return mySerializedValueParameter__BehaviorDescriptor; + return mySerializeFunction__BehaviorDescriptor; case 18: + return mySerializedValueParameter__BehaviorDescriptor; + case 19: return myValueToSerializeParameter__BehaviorDescriptor; default: } return null; } - private static final ConceptSwitchIndex conceptIndex = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x5354a94149f37316L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdcb2eL), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x2d9d5d4572ccaf5cL), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d1bb14fe83a1b05L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4d5ac72154f64136L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x6f2759b713980630L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdb3f3L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x6f2759b71399ad9bL), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d72d05b47f59025L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x1962d3cabd393132L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdb465L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x6f2759b7139c32c2L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x6f2759b713980586L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x205f4376c5884e95L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4d5ac72154f4d780L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4027f9073ff5ce93L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d1bb14fe838a4f9L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d1bb14fe838c5e4L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d1bb14fe8393f24L)).seal(); + private static final ConceptSwitchIndex conceptIndex = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x5354a94149f37316L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x33b5a19ab079956aL), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdcb2eL), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x2d9d5d4572ccaf5cL), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d1bb14fe83a1b05L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4d5ac72154f64136L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x6f2759b713980630L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdb3f3L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x6f2759b71399ad9bL), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d72d05b47f59025L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x1962d3cabd393132L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdb465L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x6f2759b7139c32c2L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x6f2759b713980586L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x205f4376c5884e95L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4d5ac72154f4d780L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4027f9073ff5ce93L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d1bb14fe838a4f9L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d1bb14fe838c5e4L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d1bb14fe8393f24L)).seal(); } diff --git a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/behavior/ContentTypeFunction__BehaviorDescriptor.java b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/behavior/ContentTypeFunction__BehaviorDescriptor.java new file mode 100644 index 000000000000..fc5739ecc687 --- /dev/null +++ b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/behavior/ContentTypeFunction__BehaviorDescriptor.java @@ -0,0 +1,109 @@ +package jetbrains.mps.ide.httpsupport.behavior; + +/*Generated by MPS */ + +import jetbrains.mps.core.aspects.behaviour.BaseBHDescriptor; +import org.jetbrains.mps.openapi.language.SAbstractConcept; +import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; +import jetbrains.mps.core.aspects.behaviour.api.SMethod; +import java.util.List; +import org.jetbrains.mps.openapi.language.SConcept; +import jetbrains.mps.core.aspects.behaviour.SMethodBuilder; +import jetbrains.mps.core.aspects.behaviour.SJavaCompoundTypeImpl; +import jetbrains.mps.core.aspects.behaviour.SModifiersImpl; +import jetbrains.mps.core.aspects.behaviour.AccessPrivileges; +import org.jetbrains.mps.openapi.model.SNode; +import java.util.Arrays; +import org.jetbrains.annotations.NotNull; +import jetbrains.mps.internal.collections.runtime.ListSequence; +import java.util.ArrayList; +import jetbrains.mps.core.aspects.behaviour.api.SConstructor; +import org.jetbrains.annotations.Nullable; +import jetbrains.mps.core.aspects.behaviour.api.BHMethodNotFoundException; +import org.jetbrains.mps.openapi.persistence.PersistenceFacade; +import jetbrains.mps.smodel.builder.SNodeBuilder; + +public final class ContentTypeFunction__BehaviorDescriptor extends BaseBHDescriptor { + private static final SAbstractConcept CONCEPT = MetaAdapterFactory.getConcept(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x33b5a19ab079956aL, "jetbrains.mps.ide.httpsupport.structure.ContentTypeFunction"); + + public static final SMethod> getParameterConcepts_id2xELmDxyi2v = new SMethodBuilder>(new SJavaCompoundTypeImpl((Class>) ((Class) Object.class))).name("getParameterConcepts").modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC)).concept(CONCEPT).id("2xELmDxyi2v").build(); + public static final SMethod getExpectedReturnType_idhEwIGRD = new SMethodBuilder(new SJavaCompoundTypeImpl((Class) ((Class) Object.class))).name("getExpectedReturnType").modifiers(SModifiersImpl.create(8, AccessPrivileges.PUBLIC)).concept(CONCEPT).id("hEwIGRD").build(); + public static final SMethod showName_id1653mnvAgry = new SMethodBuilder(new SJavaCompoundTypeImpl(Boolean.TYPE)).name("showName").modifiers(SModifiersImpl.create(9, AccessPrivileges.PUBLIC)).concept(CONCEPT).id("1653mnvAgry").build(); + + private static final List> BH_METHODS = Arrays.>asList(getParameterConcepts_id2xELmDxyi2v, getExpectedReturnType_idhEwIGRD, showName_id1653mnvAgry); + + private static void ___init___(@NotNull SNode __thisNode__) { + } + + /*package*/ static List getParameterConcepts_id2xELmDxyi2v(@NotNull SNode __thisNode__) { + List result = ListSequence.fromList(new ArrayList()); + ListSequence.fromList(result).addElement(CONCEPTS.HttpRequestParameter$jR); + return result; + } + /*package*/ static SNode getExpectedReturnType_idhEwIGRD(@NotNull SNode __thisNode__) { + return _quotation_createNode_85wver_a0a1(); + } + /*package*/ static boolean showName_id1653mnvAgry(@NotNull SAbstractConcept __thisConcept__) { + return true; + } + + /*package*/ ContentTypeFunction__BehaviorDescriptor() { + } + + @Override + protected void initNode(@NotNull SNode node, @NotNull SConstructor constructor, @Nullable Object[] parameters) { + ___init___(node); + } + + @Override + protected T invokeSpecial0(@NotNull SNode node, @NotNull SMethod method, @Nullable Object[] parameters) { + int methodIndex = BH_METHODS.indexOf(method); + if (methodIndex < 0) { + throw new BHMethodNotFoundException(this, method); + } + switch (methodIndex) { + case 0: + return (T) ((List) getParameterConcepts_id2xELmDxyi2v(node)); + case 1: + return (T) ((SNode) getExpectedReturnType_idhEwIGRD(node)); + default: + throw new BHMethodNotFoundException(this, method); + } + } + + @Override + protected T invokeSpecial0(@NotNull SAbstractConcept concept, @NotNull SMethod method, @Nullable Object[] parameters) { + int methodIndex = BH_METHODS.indexOf(method); + if (methodIndex < 0) { + throw new BHMethodNotFoundException(this, method); + } + switch (methodIndex) { + case 2: + return (T) ((Boolean) showName_id1653mnvAgry(concept)); + default: + throw new BHMethodNotFoundException(this, method); + } + } + + @NotNull + @Override + public List> getDeclaredMethods() { + return BH_METHODS; + } + + @NotNull + @Override + public SAbstractConcept getConcept() { + return CONCEPT; + } + private static SNode _quotation_createNode_85wver_a0a1() { + PersistenceFacade facade = PersistenceFacade.getInstance(); + SNode quotedNode_1 = null; + quotedNode_1 = new SNodeBuilder(null, null).init(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, "jetbrains.mps.baseLanguage"), 0x11d47da71ecL, "StringType")).getResult(); + return quotedNode_1; + } + + private static final class CONCEPTS { + /*package*/ static final SConcept HttpRequestParameter$jR = MetaAdapterFactory.getConcept(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4d5ac72154f781d2L, "jetbrains.mps.ide.httpsupport.structure.HttpRequestParameter"); + } +} diff --git a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/behavior/trace.info b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/behavior/trace.info index b026842ceb05..b2cc30f16cff 100644 --- a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/behavior/trace.info +++ b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/behavior/trace.info @@ -12,7 +12,7 @@ - + @@ -181,6 +181,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/EditorAspectDescriptorImpl.java b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/EditorAspectDescriptorImpl.java index b226897e4992..b2498470fc9a 100644 --- a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/EditorAspectDescriptorImpl.java +++ b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/EditorAspectDescriptorImpl.java @@ -50,6 +50,8 @@ public Collection getDeclaredEditors(SAbstractConcept concept) { return Collections.singletonList(new RequestURLBuilderExpression_Editor()); case 14: return Collections.singletonList(new ResponseSendOperation_Editor()); + case 15: + return Collections.singletonList(new RessourceHandler_Editor()); default: } return Collections.emptyList(); @@ -107,7 +109,7 @@ public Collection getDeclaredDefaultSubstituteMenus(SAbstractCon return Collections.emptyList(); } - private static final ConceptSwitchIndex conceptIndex = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdcb2eL), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x30dc5ccbfece894cL), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3019ad6e5265f8c0L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d1bb14fe8385046L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdb465L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4027f9073ff5cf17L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x6f2759b7139c32c2L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x6f2759b713980586L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x205f4376c585b439L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x205f4376c5884e95L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x53d29f104fa64ed7L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x53d29f104fa64ed8L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4d5ac72154f4d780L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4027f9073ff5ce93L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x5f91294323b64fc1L)).seal(); + private static final ConceptSwitchIndex conceptIndex = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdcb2eL), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x30dc5ccbfece894cL), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3019ad6e5265f8c0L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d1bb14fe8385046L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdb465L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4027f9073ff5cf17L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x6f2759b7139c32c2L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x6f2759b713980586L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x205f4376c585b439L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x205f4376c5884e95L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x53d29f104fa64ed7L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x53d29f104fa64ed8L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4d5ac72154f4d780L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4027f9073ff5ce93L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x5f91294323b64fc1L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x208cf714a5de8e0dL)).seal(); private static final ConceptSwitchIndex conceptIndex1 = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x6f2759b713980586L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4d5ac72154f4d780L)).seal(); private static final ConceptSwitchIndex conceptIndex2 = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdb3f3L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x53d29f104fa64ed8L)).seal(); private static final ConceptSwitchIndex conceptIndex3 = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdb465L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4027f9073ff5cf17L), MetaIdFactory.conceptId(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x205f4376c5884e95L)).seal(); diff --git a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/RessourceHandler_Editor.java b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/RessourceHandler_Editor.java new file mode 100644 index 000000000000..eab6f8c7255e --- /dev/null +++ b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/RessourceHandler_Editor.java @@ -0,0 +1,17 @@ +package jetbrains.mps.ide.httpsupport.editor; + +/*Generated by MPS */ + +import jetbrains.mps.nodeEditor.DefaultNodeEditor; +import jetbrains.mps.openapi.editor.cells.EditorCell; +import jetbrains.mps.openapi.editor.EditorContext; +import org.jetbrains.mps.openapi.model.SNode; + +public class RessourceHandler_Editor extends DefaultNodeEditor { + public EditorCell createEditorCell(EditorContext editorContext, SNode node) { + return new RessourceHandler_EditorBuilder_a(editorContext, node).createCell(); + } + public EditorCell createInspectedCell(EditorContext editorContext, SNode node) { + return new RessourceHandler_InspectorBuilder_a(editorContext, node).createCell(); + } +} diff --git a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/RessourceHandler_EditorBuilder_a.java b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/RessourceHandler_EditorBuilder_a.java new file mode 100644 index 000000000000..521e8b1ba2c9 --- /dev/null +++ b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/RessourceHandler_EditorBuilder_a.java @@ -0,0 +1,359 @@ +package jetbrains.mps.ide.httpsupport.editor; + +/*Generated by MPS */ + +import jetbrains.mps.editor.runtime.descriptor.AbstractEditorBuilder; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.mps.openapi.model.SNode; +import jetbrains.mps.openapi.editor.EditorContext; +import jetbrains.mps.openapi.editor.cells.EditorCell; +import jetbrains.mps.nodeEditor.cells.EditorCell_Collection; +import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Indent; +import jetbrains.mps.nodeEditor.cells.EditorCell_Constant; +import jetbrains.mps.openapi.editor.style.Style; +import jetbrains.mps.editor.runtime.style.StyleImpl; +import jetbrains.mps.baseLanguage.editor.BaseLanguageStyle_StyleSheet.KeyWordStyleClass; +import org.jetbrains.mps.openapi.language.SProperty; +import jetbrains.mps.openapi.editor.menus.transformation.SPropertyInfo; +import jetbrains.mps.nodeEditor.cells.EditorCell_Property; +import jetbrains.mps.nodeEditor.cells.SPropertyAccessor; +import jetbrains.mps.nodeEditor.cellMenu.SPropertySubstituteInfo; +import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; +import jetbrains.mps.lang.smodel.generator.smodelAdapter.AttributeOperations; +import jetbrains.mps.lang.smodel.generator.smodelAdapter.IAttributeDescriptor; +import jetbrains.mps.internal.collections.runtime.Sequence; +import jetbrains.mps.internal.collections.runtime.IWhereFilter; +import java.util.Objects; +import jetbrains.mps.lang.core.behavior.PropertyAttribute__BehaviorDescriptor; +import jetbrains.mps.nodeEditor.EditorManager; +import jetbrains.mps.openapi.editor.update.AttributeKind; +import jetbrains.mps.editor.runtime.style.StyleAttributes; +import jetbrains.mps.lang.editor.cellProviders.SingleRoleCellProvider; +import org.jetbrains.mps.openapi.language.SContainmentLink; +import jetbrains.mps.openapi.editor.cells.CellActionType; +import jetbrains.mps.editor.runtime.impl.cellActions.CellAction_DeleteSmart; +import jetbrains.mps.openapi.editor.cells.DefaultSubstituteInfo; +import jetbrains.mps.nodeEditor.cellMenu.SEmptyContainmentSubstituteInfo; +import jetbrains.mps.nodeEditor.cellMenu.SChildSubstituteInfo; +import jetbrains.mps.openapi.editor.menus.transformation.SNodeLocation; +import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; +import org.jetbrains.mps.openapi.language.SConcept; + +/*package*/ class RessourceHandler_EditorBuilder_a extends AbstractEditorBuilder { + @NotNull + private SNode myNode; + + public RessourceHandler_EditorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { + super(context); + myNode = node; + } + + @NotNull + @Override + public SNode getNode() { + return myNode; + } + + /*package*/ EditorCell createCell() { + return createCollection_0(); + } + + private EditorCell createCollection_0() { + EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Indent()); + editorCell.setCellId("Collection_gdm0um_a"); + editorCell.setBig(true); + setCellContext(editorCell); + editorCell.addEditorCell(createConstant_0()); + editorCell.addEditorCell(createProperty_0()); + editorCell.addEditorCell(createConstant_1()); + editorCell.addEditorCell(createConstant_2()); + editorCell.addEditorCell(createConstant_3()); + editorCell.addEditorCell(createRefNode_0()); + editorCell.addEditorCell(createConstant_4()); + editorCell.addEditorCell(createRefNode_1()); + editorCell.addEditorCell(createConstant_5()); + editorCell.addEditorCell(createRefNode_2()); + editorCell.addEditorCell(createConstant_6()); + return editorCell; + } + private EditorCell createConstant_0() { + EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "ressource handler"); + editorCell.setCellId("Constant_gdm0um_a0"); + Style style = new StyleImpl(); + new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); + editorCell.getStyle().putAll(style); + editorCell.setDefaultText(""); + return editorCell; + } + private EditorCell createProperty_0() { + getCellFactory().pushCellContext(); + try { + final SProperty property = PROPS.name$MnvL; + getCellFactory().setPropertyInfo(new SPropertyInfo(myNode, property)); + EditorCell_Property editorCell = EditorCell_Property.create(getEditorContext(), new SPropertyAccessor(myNode, property, false, false), myNode); + editorCell.setDefaultText(""); + editorCell.setCellId("property_name"); + editorCell.setSubstituteInfo(new SPropertySubstituteInfo(editorCell, property)); + setCellContext(editorCell); + Iterable propertyAttributes = SNodeOperations.ofConcept(AttributeOperations.getAttributeList(myNode, new IAttributeDescriptor.AllAttributes()), CONCEPTS.PropertyAttribute$Gb); + Iterable currentPropertyAttributes = Sequence.fromIterable(propertyAttributes).where(new IWhereFilter() { + public boolean accept(SNode it) { + return Objects.equals(PropertyAttribute__BehaviorDescriptor.getProperty_id1avfQ4BBzOo.invoke(it), property); + } + }); + if (Sequence.fromIterable(currentPropertyAttributes).isNotEmpty()) { + EditorManager manager = EditorManager.getInstanceFromContext(getEditorContext()); + return manager.createNodeRoleAttributeCell(Sequence.fromIterable(currentPropertyAttributes).first(), AttributeKind.PROPERTY, editorCell); + } else + return editorCell; + } finally { + getCellFactory().popCellContext(); + } + } + private EditorCell createConstant_1() { + EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "{"); + editorCell.setCellId("Constant_gdm0um_c0"); + Style style = new StyleImpl(); + style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); + editorCell.getStyle().putAll(style); + editorCell.setDefaultText(""); + return editorCell; + } + private EditorCell createConstant_2() { + EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); + editorCell.setCellId("Constant_gdm0um_d0"); + Style style = new StyleImpl(); + style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); + editorCell.getStyle().putAll(style); + editorCell.setDefaultText(""); + return editorCell; + } + private EditorCell createConstant_3() { + EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "query prefix:"); + editorCell.setCellId("Constant_gdm0um_e0"); + Style style = new StyleImpl(); + new KeyWordStyleClass(getEditorContext(), getNode()).apply(style, editorCell); + style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true); + editorCell.getStyle().putAll(style); + editorCell.setDefaultText(""); + return editorCell; + } + private EditorCell createRefNode_0() { + SingleRoleCellProvider provider = new queryPrefixSingleRoleHandler_gdm0um_f0(myNode, LINKS.queryPrefix$UK48, getEditorContext()); + return provider.createCell(); + } + private static class queryPrefixSingleRoleHandler_gdm0um_f0 extends SingleRoleCellProvider { + @NotNull + private SNode myNode; + + public queryPrefixSingleRoleHandler_gdm0um_f0(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) { + super(containmentLink, context); + myNode = ownerNode; + } + + @Override + @NotNull + public SNode getNode() { + return myNode; + } + + protected EditorCell createChildCell(SNode child) { + EditorCell editorCell = getUpdateSession().updateChildNodeCell(child); + editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), LINKS.queryPrefix$UK48, child)); + editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), LINKS.queryPrefix$UK48, child)); + installCellInfo(child, editorCell, false); + return editorCell; + } + + + + private void installCellInfo(SNode child, EditorCell editorCell, boolean isEmpty) { + if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) { + editorCell.setSubstituteInfo((isEmpty ? new SEmptyContainmentSubstituteInfo(editorCell) : new SChildSubstituteInfo(editorCell))); + } + if (editorCell.getSRole() == null) { + editorCell.setSRole(LINKS.queryPrefix$UK48); + } + Style style = new StyleImpl(); + style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); + editorCell.getStyle().putAll(style); + } + @Override + protected EditorCell createEmptyCell() { + getCellFactory().pushCellContext(); + getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), LINKS.queryPrefix$UK48)); + try { + EditorCell editorCell = super.createEmptyCell(); + editorCell.setCellId("empty_queryPrefix"); + installCellInfo(null, editorCell, true); + setCellContext(editorCell); + return editorCell; + } finally { + getCellFactory().popCellContext(); + } + } + protected String getNoTargetText() { + return ""; + } + } + private EditorCell createConstant_4() { + EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); + editorCell.setCellId("Constant_gdm0um_g0"); + Style style = new StyleImpl(); + style.set(StyleAttributes.INDENT_LAYOUT_ON_NEW_LINE, true); + style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); + editorCell.getStyle().putAll(style); + editorCell.setDefaultText(""); + return editorCell; + } + private EditorCell createRefNode_1() { + SingleRoleCellProvider provider = new canHandleFunctionSingleRoleHandler_gdm0um_h0(myNode, LINKS.canHandleFunction$UKLb, getEditorContext()); + return provider.createCell(); + } + private static class canHandleFunctionSingleRoleHandler_gdm0um_h0 extends SingleRoleCellProvider { + @NotNull + private SNode myNode; + + public canHandleFunctionSingleRoleHandler_gdm0um_h0(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) { + super(containmentLink, context); + myNode = ownerNode; + } + + @Override + @NotNull + public SNode getNode() { + return myNode; + } + + protected EditorCell createChildCell(SNode child) { + EditorCell editorCell = getUpdateSession().updateChildNodeCell(child); + editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), LINKS.canHandleFunction$UKLb, child)); + editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), LINKS.canHandleFunction$UKLb, child)); + installCellInfo(child, editorCell, false); + return editorCell; + } + + + + private void installCellInfo(SNode child, EditorCell editorCell, boolean isEmpty) { + if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) { + editorCell.setSubstituteInfo((isEmpty ? new SEmptyContainmentSubstituteInfo(editorCell) : new SChildSubstituteInfo(editorCell))); + } + if (editorCell.getSRole() == null) { + editorCell.setSRole(LINKS.canHandleFunction$UKLb); + } + Style style = new StyleImpl(); + style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true); + style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); + editorCell.getStyle().putAll(style); + } + @Override + protected EditorCell createEmptyCell() { + getCellFactory().pushCellContext(); + getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), LINKS.canHandleFunction$UKLb)); + try { + EditorCell editorCell = super.createEmptyCell(); + editorCell.setCellId("empty_canHandleFunction"); + installCellInfo(null, editorCell, true); + setCellContext(editorCell); + return editorCell; + } finally { + getCellFactory().popCellContext(); + } + } + protected String getNoTargetText() { + return "handle always"; + } + } + private EditorCell createConstant_5() { + EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, ""); + editorCell.setCellId("Constant_gdm0um_i0"); + Style style = new StyleImpl(); + style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); + editorCell.getStyle().putAll(style); + editorCell.setDefaultText(""); + return editorCell; + } + private EditorCell createRefNode_2() { + SingleRoleCellProvider provider = new contentTypeFunctionSingleRoleHandler_gdm0um_j0(myNode, LINKS.contentTypeFunction$GjmS, getEditorContext()); + return provider.createCell(); + } + private static class contentTypeFunctionSingleRoleHandler_gdm0um_j0 extends SingleRoleCellProvider { + @NotNull + private SNode myNode; + + public contentTypeFunctionSingleRoleHandler_gdm0um_j0(SNode ownerNode, SContainmentLink containmentLink, EditorContext context) { + super(containmentLink, context); + myNode = ownerNode; + } + + @Override + @NotNull + public SNode getNode() { + return myNode; + } + + protected EditorCell createChildCell(SNode child) { + EditorCell editorCell = getUpdateSession().updateChildNodeCell(child); + editorCell.setAction(CellActionType.DELETE, new CellAction_DeleteSmart(getNode(), LINKS.contentTypeFunction$GjmS, child)); + editorCell.setAction(CellActionType.BACKSPACE, new CellAction_DeleteSmart(getNode(), LINKS.contentTypeFunction$GjmS, child)); + installCellInfo(child, editorCell, false); + return editorCell; + } + + + + private void installCellInfo(SNode child, EditorCell editorCell, boolean isEmpty) { + if (editorCell.getSubstituteInfo() == null || editorCell.getSubstituteInfo() instanceof DefaultSubstituteInfo) { + editorCell.setSubstituteInfo((isEmpty ? new SEmptyContainmentSubstituteInfo(editorCell) : new SChildSubstituteInfo(editorCell))); + } + if (editorCell.getSRole() == null) { + editorCell.setSRole(LINKS.contentTypeFunction$GjmS); + } + Style style = new StyleImpl(); + style.set(StyleAttributes.INDENT_LAYOUT_INDENT, true); + style.set(StyleAttributes.INDENT_LAYOUT_NEW_LINE, true); + editorCell.getStyle().putAll(style); + } + @Override + protected EditorCell createEmptyCell() { + getCellFactory().pushCellContext(); + getCellFactory().setNodeLocation(new SNodeLocation.FromParentAndLink(getNode(), LINKS.contentTypeFunction$GjmS)); + try { + EditorCell editorCell = super.createEmptyCell(); + editorCell.setCellId("empty_contentTypeFunction"); + installCellInfo(null, editorCell, true); + setCellContext(editorCell); + return editorCell; + } finally { + getCellFactory().popCellContext(); + } + } + protected String getNoTargetText() { + return "guess content type"; + } + } + private EditorCell createConstant_6() { + EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "}"); + editorCell.setCellId("Constant_gdm0um_k0"); + Style style = new StyleImpl(); + style.set(StyleAttributes.INDENT_LAYOUT_ON_NEW_LINE, true); + editorCell.getStyle().putAll(style); + editorCell.setDefaultText(""); + return editorCell; + } + + private static final class PROPS { + /*package*/ static final SProperty name$MnvL = MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"); + } + + private static final class CONCEPTS { + /*package*/ static final SConcept PropertyAttribute$Gb = MetaAdapterFactory.getConcept(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x2eb1ad060897da56L, "jetbrains.mps.lang.core.structure.PropertyAttribute"); + } + + private static final class LINKS { + /*package*/ static final SContainmentLink queryPrefix$UK48 = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x208cf714a5de8e0dL, 0x208cf714a5de8e0eL, "queryPrefix"); + /*package*/ static final SContainmentLink canHandleFunction$UKLb = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x208cf714a5de8e0dL, 0x208cf714a5de8e11L, "canHandleFunction"); + /*package*/ static final SContainmentLink contentTypeFunction$GjmS = MetaAdapterFactory.getContainmentLink(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x208cf714a5de8e0dL, 0x33b5a19ab0799c63L, "contentTypeFunction"); + } +} diff --git a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/RessourceHandler_InspectorBuilder_a.java b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/RessourceHandler_InspectorBuilder_a.java new file mode 100644 index 000000000000..65309bbc8373 --- /dev/null +++ b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/RessourceHandler_InspectorBuilder_a.java @@ -0,0 +1,84 @@ +package jetbrains.mps.ide.httpsupport.editor; + +/*Generated by MPS */ + +import jetbrains.mps.editor.runtime.descriptor.AbstractEditorBuilder; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.mps.openapi.model.SNode; +import jetbrains.mps.openapi.editor.EditorContext; +import jetbrains.mps.openapi.editor.cells.EditorCell; +import jetbrains.mps.nodeEditor.cells.EditorCell_Collection; +import jetbrains.mps.nodeEditor.cellLayout.CellLayout_Vertical; +import jetbrains.mps.openapi.editor.style.Style; +import jetbrains.mps.editor.runtime.style.StyleImpl; +import jetbrains.mps.editor.runtime.style.StyleAttributes; +import jetbrains.mps.nodeEditor.cells.EditorCell_Constant; +import jetbrains.mps.nodeEditor.MPSFonts; + +/*package*/ class RessourceHandler_InspectorBuilder_a extends AbstractEditorBuilder { + @NotNull + private SNode myNode; + + public RessourceHandler_InspectorBuilder_a(@NotNull EditorContext context, @NotNull SNode node) { + super(context); + myNode = node; + } + + @NotNull + @Override + public SNode getNode() { + return myNode; + } + + /*package*/ EditorCell createCell() { + return createCollection_0(); + } + + private EditorCell createCollection_0() { + EditorCell_Collection editorCell = new EditorCell_Collection(getEditorContext(), myNode, new CellLayout_Vertical()); + editorCell.setCellId("Collection_gdm0um_0"); + editorCell.setBig(true); + setCellContext(editorCell); + Style style = new StyleImpl(); + style.set(StyleAttributes.SELECTABLE, false); + editorCell.getStyle().putAll(style); + editorCell.addEditorCell(createConstant_0()); + editorCell.addEditorCell(createConstant_1()); + editorCell.addEditorCell(createConstant_2()); + editorCell.addEditorCell(createConstant_3()); + return editorCell; + } + private EditorCell createConstant_0() { + EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "Handles Incoming HTTP Requests for static ressources. Workflow:"); + editorCell.setCellId("Constant_gdm0um_0"); + editorCell.setDefaultText(""); + return editorCell; + } + private EditorCell createConstant_1() { + EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "1. Checks that 'folder prefix' is a prefix of query path; "); + editorCell.setCellId("Constant_gdm0um_1"); + Style style = new StyleImpl(); + style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); + editorCell.getStyle().putAll(style); + editorCell.setDefaultText(""); + return editorCell; + } + private EditorCell createConstant_2() { + EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "2. Invokes canHandle() method and checks that it returns true;"); + editorCell.setCellId("Constant_gdm0um_2"); + Style style = new StyleImpl(); + style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); + editorCell.getStyle().putAll(style); + editorCell.setDefaultText(""); + return editorCell; + } + private EditorCell createConstant_3() { + EditorCell_Constant editorCell = new EditorCell_Constant(getEditorContext(), myNode, "3. If all criteria are satisfied loads the file from the jar or local file system."); + editorCell.setCellId("Constant_gdm0um_3"); + Style style = new StyleImpl(); + style.set(StyleAttributes.FONT_STYLE, MPSFonts.PLAIN); + editorCell.getStyle().putAll(style); + editorCell.setDefaultText(""); + return editorCell; + } +} diff --git a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/trace.info b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/trace.info index ddac21e527cc..161c7afe909f 100644 --- a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/trace.info +++ b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/editor/trace.info @@ -17,7 +17,7 @@ - + @@ -513,6 +513,507 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/ConceptPresentationAspectImpl.java b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/ConceptPresentationAspectImpl.java index 75b931d649c6..5e21c144ff8f 100644 --- a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/ConceptPresentationAspectImpl.java +++ b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/ConceptPresentationAspectImpl.java @@ -10,6 +10,7 @@ public class ConceptPresentationAspectImpl extends ConceptPresentationAspectBase { private ConceptPresentation props_CanHandleRequestFunction; + private ConceptPresentation props_ContentTypeFunction; private ConceptPresentation props_DefaultParameterConverter; private ConceptPresentation props_DefaultValueFunction; private ConceptPresentation props_DeserializeFunction; @@ -45,6 +46,7 @@ public class ConceptPresentationAspectImpl extends ConceptPresentationAspectBase private ConceptPresentation props_RequestType; private ConceptPresentation props_RequestURLBuilderExpression; private ConceptPresentation props_ResponseSendOperation; + private ConceptPresentation props_RessourceHandler; private ConceptPresentation props_SerializeFunction; private ConceptPresentation props_SerializedValueParameter; private ConceptPresentation props_ValueToSerializeParameter; @@ -62,6 +64,14 @@ public ConceptPresentation getDescriptor(SAbstractConcept c) { props_CanHandleRequestFunction = cpb.create(); } return props_CanHandleRequestFunction; + case LanguageConceptSwitch.ContentTypeFunction: + if (props_ContentTypeFunction == null) { + ConceptPresentationBuilder cpb = new ConceptPresentationBuilder(); + cpb.shortDesc("Content Type for request"); + cpb.rawPresentation("contentType"); + props_ContentTypeFunction = cpb.create(); + } + return props_ContentTypeFunction; case LanguageConceptSwitch.DefaultParameterConverter: if (props_DefaultParameterConverter == null) { ConceptPresentationBuilder cpb = new ConceptPresentationBuilder(); @@ -315,6 +325,13 @@ public ConceptPresentation getDescriptor(SAbstractConcept c) { props_ResponseSendOperation = cpb.create(); } return props_ResponseSendOperation; + case LanguageConceptSwitch.RessourceHandler: + if (props_RessourceHandler == null) { + ConceptPresentationBuilder cpb = new ConceptPresentationBuilder(); + cpb.presentationByName(); + props_RessourceHandler = cpb.create(); + } + return props_RessourceHandler; case LanguageConceptSwitch.SerializeFunction: if (props_SerializeFunction == null) { ConceptPresentationBuilder cpb = new ConceptPresentationBuilder(); diff --git a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/LanguageConceptSwitch.java b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/LanguageConceptSwitch.java index c2c35d4ac8ea..3656df5a540a 100644 --- a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/LanguageConceptSwitch.java +++ b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/LanguageConceptSwitch.java @@ -10,48 +10,51 @@ public final class LanguageConceptSwitch { private final LanguageConceptIndex myIndex; public static final int CanHandleRequestFunction = 0; - public static final int DefaultParameterConverter = 1; - public static final int DefaultValueFunction = 2; - public static final int DeserializeFunction = 3; - public static final int HandleRequestFunction = 4; - public static final int HttpMethod = 5; - public static final int HttpMethod_ANY = 6; - public static final int HttpMethod_Connect = 7; - public static final int HttpMethod_Delete = 8; - public static final int HttpMethod_Get = 9; - public static final int HttpMethod_Head = 10; - public static final int HttpMethod_Options = 11; - public static final int HttpMethod_Patch = 12; - public static final int HttpMethod_Post = 13; - public static final int HttpMethod_Put = 14; - public static final int HttpMethod_Trace = 15; - public static final int HttpRequestOperation = 16; - public static final int HttpRequestParameter = 17; - public static final int IDEAPlatformPortProvider = 18; - public static final int IParameterConverter = 19; - public static final int MPSIntegrationPortProvider = 20; - public static final int MPSInternalPortProvider = 21; - public static final int Node_getURLOperation = 22; - public static final int ParameterConverterDeclaration = 23; - public static final int ParameterConverterReference = 24; - public static final int ParameterInitializer = 25; - public static final int Port = 26; - public static final int PortProvider = 27; - public static final int QueryParameter = 28; - public static final int QueryParameterReference = 29; - public static final int QueryPath = 30; - public static final int QuerySegment = 31; - public static final int RequestHandler = 32; - public static final int RequestType = 33; - public static final int RequestURLBuilderExpression = 34; - public static final int ResponseSendOperation = 35; - public static final int SerializeFunction = 36; - public static final int SerializedValueParameter = 37; - public static final int ValueToSerializeParameter = 38; + public static final int ContentTypeFunction = 1; + public static final int DefaultParameterConverter = 2; + public static final int DefaultValueFunction = 3; + public static final int DeserializeFunction = 4; + public static final int HandleRequestFunction = 5; + public static final int HttpMethod = 6; + public static final int HttpMethod_ANY = 7; + public static final int HttpMethod_Connect = 8; + public static final int HttpMethod_Delete = 9; + public static final int HttpMethod_Get = 10; + public static final int HttpMethod_Head = 11; + public static final int HttpMethod_Options = 12; + public static final int HttpMethod_Patch = 13; + public static final int HttpMethod_Post = 14; + public static final int HttpMethod_Put = 15; + public static final int HttpMethod_Trace = 16; + public static final int HttpRequestOperation = 17; + public static final int HttpRequestParameter = 18; + public static final int IDEAPlatformPortProvider = 19; + public static final int IParameterConverter = 20; + public static final int MPSIntegrationPortProvider = 21; + public static final int MPSInternalPortProvider = 22; + public static final int Node_getURLOperation = 23; + public static final int ParameterConverterDeclaration = 24; + public static final int ParameterConverterReference = 25; + public static final int ParameterInitializer = 26; + public static final int Port = 27; + public static final int PortProvider = 28; + public static final int QueryParameter = 29; + public static final int QueryParameterReference = 30; + public static final int QueryPath = 31; + public static final int QuerySegment = 32; + public static final int RequestHandler = 33; + public static final int RequestType = 34; + public static final int RequestURLBuilderExpression = 35; + public static final int ResponseSendOperation = 36; + public static final int RessourceHandler = 37; + public static final int SerializeFunction = 38; + public static final int SerializedValueParameter = 39; + public static final int ValueToSerializeParameter = 40; public LanguageConceptSwitch() { LanguageConceptIndexBuilder builder = new LanguageConceptIndexBuilder(0x817e4e70961e4a95L, 0x98a115e9f32231f1L); builder.put(0x5354a94149f37316L, CanHandleRequestFunction); + builder.put(0x33b5a19ab079956aL, ContentTypeFunction); builder.put(0x46f064803fbdcb2eL, DefaultParameterConverter); builder.put(0x2d9d5d4572ccaf5cL, DefaultValueFunction); builder.put(0x3d1bb14fe83a1b05L, DeserializeFunction); @@ -87,6 +90,7 @@ public LanguageConceptSwitch() { builder.put(0x878f56dbf94c377L, RequestType); builder.put(0x4027f9073ff5ce93L, RequestURLBuilderExpression); builder.put(0x5f91294323b64fc1L, ResponseSendOperation); + builder.put(0x208cf714a5de8e0dL, RessourceHandler); builder.put(0x3d1bb14fe838a4f9L, SerializeFunction); builder.put(0x3d1bb14fe838c5e4L, SerializedValueParameter); builder.put(0x3d1bb14fe8393f24L, ValueToSerializeParameter); diff --git a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/StructureAspectDescriptor.java b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/StructureAspectDescriptor.java index e0376c58005f..63de42247500 100644 --- a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/StructureAspectDescriptor.java +++ b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/StructureAspectDescriptor.java @@ -20,6 +20,7 @@ public class StructureAspectDescriptor extends BaseStructureAspectDescriptor { /*package*/ final ConceptDescriptor myConceptCanHandleRequestFunction = createDescriptorForCanHandleRequestFunction(); + /*package*/ final ConceptDescriptor myConceptContentTypeFunction = createDescriptorForContentTypeFunction(); /*package*/ final ConceptDescriptor myConceptDefaultParameterConverter = createDescriptorForDefaultParameterConverter(); /*package*/ final ConceptDescriptor myConceptDefaultValueFunction = createDescriptorForDefaultValueFunction(); /*package*/ final ConceptDescriptor myConceptDeserializeFunction = createDescriptorForDeserializeFunction(); @@ -55,6 +56,7 @@ public class StructureAspectDescriptor extends BaseStructureAspectDescriptor { /*package*/ final ConceptDescriptor myConceptRequestType = createDescriptorForRequestType(); /*package*/ final ConceptDescriptor myConceptRequestURLBuilderExpression = createDescriptorForRequestURLBuilderExpression(); /*package*/ final ConceptDescriptor myConceptResponseSendOperation = createDescriptorForResponseSendOperation(); + /*package*/ final ConceptDescriptor myConceptRessourceHandler = createDescriptorForRessourceHandler(); /*package*/ final ConceptDescriptor myConceptSerializeFunction = createDescriptorForSerializeFunction(); /*package*/ final ConceptDescriptor myConceptSerializedValueParameter = createDescriptorForSerializedValueParameter(); /*package*/ final ConceptDescriptor myConceptValueToSerializeParameter = createDescriptorForValueToSerializeParameter(); @@ -76,7 +78,7 @@ public void reportDependencies(jetbrains.mps.smodel.runtime.StructureAspectDescr @Override public Collection getDescriptors() { - return Arrays.asList(myConceptCanHandleRequestFunction, myConceptDefaultParameterConverter, myConceptDefaultValueFunction, myConceptDeserializeFunction, myConceptHandleRequestFunction, myConceptHttpMethod, myConceptHttpMethod_ANY, myConceptHttpMethod_Connect, myConceptHttpMethod_Delete, myConceptHttpMethod_Get, myConceptHttpMethod_Head, myConceptHttpMethod_Options, myConceptHttpMethod_Patch, myConceptHttpMethod_Post, myConceptHttpMethod_Put, myConceptHttpMethod_Trace, myConceptHttpRequestOperation, myConceptHttpRequestParameter, myConceptIDEAPlatformPortProvider, myConceptIParameterConverter, myConceptMPSIntegrationPortProvider, myConceptMPSInternalPortProvider, myConceptNode_getURLOperation, myConceptParameterConverterDeclaration, myConceptParameterConverterReference, myConceptParameterInitializer, myConceptPort, myConceptPortProvider, myConceptQueryParameter, myConceptQueryParameterReference, myConceptQueryPath, myConceptQuerySegment, myConceptRequestHandler, myConceptRequestType, myConceptRequestURLBuilderExpression, myConceptResponseSendOperation, myConceptSerializeFunction, myConceptSerializedValueParameter, myConceptValueToSerializeParameter); + return Arrays.asList(myConceptCanHandleRequestFunction, myConceptContentTypeFunction, myConceptDefaultParameterConverter, myConceptDefaultValueFunction, myConceptDeserializeFunction, myConceptHandleRequestFunction, myConceptHttpMethod, myConceptHttpMethod_ANY, myConceptHttpMethod_Connect, myConceptHttpMethod_Delete, myConceptHttpMethod_Get, myConceptHttpMethod_Head, myConceptHttpMethod_Options, myConceptHttpMethod_Patch, myConceptHttpMethod_Post, myConceptHttpMethod_Put, myConceptHttpMethod_Trace, myConceptHttpRequestOperation, myConceptHttpRequestParameter, myConceptIDEAPlatformPortProvider, myConceptIParameterConverter, myConceptMPSIntegrationPortProvider, myConceptMPSInternalPortProvider, myConceptNode_getURLOperation, myConceptParameterConverterDeclaration, myConceptParameterConverterReference, myConceptParameterInitializer, myConceptPort, myConceptPortProvider, myConceptQueryParameter, myConceptQueryParameterReference, myConceptQueryPath, myConceptQuerySegment, myConceptRequestHandler, myConceptRequestType, myConceptRequestURLBuilderExpression, myConceptResponseSendOperation, myConceptRessourceHandler, myConceptSerializeFunction, myConceptSerializedValueParameter, myConceptValueToSerializeParameter); } @Override @@ -85,6 +87,8 @@ public ConceptDescriptor getDescriptor(SConceptId id) { switch (myIndexSwitch.index(id)) { case LanguageConceptSwitch.CanHandleRequestFunction: return myConceptCanHandleRequestFunction; + case LanguageConceptSwitch.ContentTypeFunction: + return myConceptContentTypeFunction; case LanguageConceptSwitch.DefaultParameterConverter: return myConceptDefaultParameterConverter; case LanguageConceptSwitch.DefaultValueFunction: @@ -155,6 +159,8 @@ public ConceptDescriptor getDescriptor(SConceptId id) { return myConceptRequestURLBuilderExpression; case LanguageConceptSwitch.ResponseSendOperation: return myConceptResponseSendOperation; + case LanguageConceptSwitch.RessourceHandler: + return myConceptRessourceHandler; case LanguageConceptSwitch.SerializeFunction: return myConceptSerializeFunction; case LanguageConceptSwitch.SerializedValueParameter: @@ -185,6 +191,16 @@ private static ConceptDescriptor createDescriptorForCanHandleRequestFunction() { b.alias("canHandle"); return b.create(); } + private static ConceptDescriptor createDescriptorForContentTypeFunction() { + ConceptDescriptorBuilder2 b = new ConceptDescriptorBuilder2("jetbrains.mps.ide.httpsupport", "ContentTypeFunction", 0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x33b5a19ab079956aL); + b.class_(false, false, false); + b.super_("jetbrains.mps.baseLanguage.structure.ConceptFunction", 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x108bbca0f48L); + b.origin("r:3c30b5c5-2f86-4daf-bab8-b406cfefcb4f(jetbrains.mps.ide.httpsupport.structure)/3726061952476747114"); + b.version(2); + b.kind(ConceptKind.INTERFACE, StaticScope.GLOBAL); + b.alias("contentType"); + return b.create(); + } private static ConceptDescriptor createDescriptorForDefaultParameterConverter() { ConceptDescriptorBuilder2 b = new ConceptDescriptorBuilder2("jetbrains.mps.ide.httpsupport", "DefaultParameterConverter", 0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x46f064803fbdcb2eL); b.class_(false, false, false); @@ -518,6 +534,21 @@ private static ConceptDescriptor createDescriptorForResponseSendOperation() { b.alias("send response"); return b.create(); } + private static ConceptDescriptor createDescriptorForRessourceHandler() { + ConceptDescriptorBuilder2 b = new ConceptDescriptorBuilder2("jetbrains.mps.ide.httpsupport", "RessourceHandler", 0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x208cf714a5de8e0dL); + b.class_(false, false, true); + b.parent(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11a3afa8c0dL); + b.parent(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x33d23ee961a0cbf3L); + b.parent(0xc0080a477e374558L, 0xbee99ae18e690549L, 0x2b7651d49ee9d72L); + b.origin("r:3c30b5c5-2f86-4daf-bab8-b406cfefcb4f(jetbrains.mps.ide.httpsupport.structure)/2345521174007418381"); + b.version(2); + b.aggregate("queryPrefix", 0x208cf714a5de8e0eL).target(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x53d29f104fa64ed7L).optional(false).ordered(true).multiple(false).origin("2345521174007418382").done(); + b.aggregate("canHandleFunction", 0x208cf714a5de8e11L).target(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x5354a94149f37316L).optional(true).ordered(true).multiple(false).origin("2345521174007418385").done(); + b.aggregate("contentTypeFunction", 0x33b5a19ab0799c63L).target(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x33b5a19ab079956aL).optional(true).ordered(true).multiple(false).origin("3726061952476748899").done(); + b.aggregate("handleFunction", 0x208cf714a5de8e12L).target(0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x4d5ac72154f64136L).optional(false).ordered(true).multiple(false).origin("2345521174007418386").done(); + b.alias("Ressource Handler"); + return b.create(); + } private static ConceptDescriptor createDescriptorForSerializeFunction() { ConceptDescriptorBuilder2 b = new ConceptDescriptorBuilder2("jetbrains.mps.ide.httpsupport", "SerializeFunction", 0x817e4e70961e4a95L, 0x98a115e9f32231f1L, 0x3d1bb14fe838a4f9L); b.class_(false, false, false); diff --git a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/aspectcps-descriptorclasses.mps b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/aspectcps-descriptorclasses.mps index 162126f1836e..35e38cee083e 100644 --- a/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/aspectcps-descriptorclasses.mps +++ b/plugins/mps-httpsupport/language/source_gen/jetbrains/mps/ide/httpsupport/structure/aspectcps-descriptorclasses.mps @@ -191,422 +191,442 @@ - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - - + + + - - + + - - - + + + - - + + - + - + @@ -614,11518 +634,12328 @@ - - - - + + + + - - - - + + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - + + + + - + - + - - - - - + + + + + - + - + - - - + + + - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - + + + + - + - + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + - - + + - - - - - + + + + + - + - - + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + @@ -1271,6 +1283,20 @@ + + + + + + + + + + + + + + @@ -2444,5 +2470,962 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/mps-httpsupport/source_gen.caches/jetbrains/mps/ide/httpsupport/manager/plugin/dependencies b/plugins/mps-httpsupport/source_gen.caches/jetbrains/mps/ide/httpsupport/manager/plugin/dependencies index 55a1446340dd..aa5040d65b12 100644 --- a/plugins/mps-httpsupport/source_gen.caches/jetbrains/mps/ide/httpsupport/manager/plugin/dependencies +++ b/plugins/mps-httpsupport/source_gen.caches/jetbrains/mps/ide/httpsupport/manager/plugin/dependencies @@ -1,5 +1,9 @@ + + + + diff --git a/plugins/mps-httpsupport/source_gen.caches/jetbrains/mps/ide/httpsupport/manager/plugin/generated b/plugins/mps-httpsupport/source_gen.caches/jetbrains/mps/ide/httpsupport/manager/plugin/generated index a2b325584c41..f3a537a6172b 100644 --- a/plugins/mps-httpsupport/source_gen.caches/jetbrains/mps/ide/httpsupport/manager/plugin/generated +++ b/plugins/mps-httpsupport/source_gen.caches/jetbrains/mps/ide/httpsupport/manager/plugin/generated @@ -1,5 +1,5 @@ - - + + diff --git a/plugins/mps-httpsupport/source_gen/jetbrains/mps/ide/httpsupport/manager/plugin/ContentTypeHelper.java b/plugins/mps-httpsupport/source_gen/jetbrains/mps/ide/httpsupport/manager/plugin/ContentTypeHelper.java new file mode 100644 index 000000000000..0c3d7584c7ef --- /dev/null +++ b/plugins/mps-httpsupport/source_gen/jetbrains/mps/ide/httpsupport/manager/plugin/ContentTypeHelper.java @@ -0,0 +1,167 @@ +package jetbrains.mps.ide.httpsupport.manager.plugin; + +/*Generated by MPS */ + +import jetbrains.mps.annotations.GeneratedClass; + +@GeneratedClass(node = "r:05ff02e5-9836-4ae9-a454-eab43fa58c8f(jetbrains.mps.ide.httpsupport.manager.plugin)/3726061952476913474", model = "r:05ff02e5-9836-4ae9-a454-eab43fa58c8f(jetbrains.mps.ide.httpsupport.manager.plugin)") +public class ContentTypeHelper { + public static String guessContentType(String path) { + int lastDot = path.lastIndexOf('.'); + if (lastDot < 0) { + return "text/plain"; + } + switch (path.substring(lastDot)) { + case ".aac": + return "audio/aac"; + case ".abw": + return "application/x-abiword"; + case ".arc": + return "application/x-freearc"; + case ".avi": + return "video/x-msvideo"; + case ".azw": + return "application/vnd.amazon.ebook"; + case ".bin": + return "application/octet-stream"; + case ".bmp": + return "image/bmp"; + case ".bz": + return "application/x-bzip"; + case ".bz2": + return "application/x-bzip2"; + case ".csh": + return "application/x-csh"; + case ".css": + return "text/css"; + case ".csv": + return "text/csv"; + case ".doc": + return "application/msword"; + case ".docx": + return "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; + case ".eot": + return "application/vnd.ms-fontobject"; + case ".epub": + return "application/epub+zip"; + case ".gz": + return "application/gzip"; + case ".gif": + return "image/gif"; + case ".htm": + return "text/html"; + case ".html": + return "text/html"; + case ".ico": + return "image/vnd.microsoft.icon"; + case ".ics": + return "text/calendar"; + case ".jar": + return "application/java-archive"; + case ".jpeg": + return "image/jpeg"; + case ".jpg": + return "image/jpeg"; + case ".js": + return "text/javascript"; + case ".json": + return "application/json"; + case ".jsonld": + return "application/ld+json"; + case ".mid": + return "audio/midi audio/x-midi"; + case ".midi": + return "audio/midi audio/x-midi"; + case ".mjs": + return "text/javascript"; + case ".mp3": + return "audio/mpeg"; + case ".cda": + return "application/x-cdf"; + case ".mp4": + return "video/mp4"; + case ".mpeg": + return "video/mpeg"; + case ".mpkg": + return "application/vnd.apple.installer+xml"; + case ".odp": + return "application/vnd.oasis.opendocument.presentation"; + case ".ods": + return "application/vnd.oasis.opendocument.spreadsheet"; + case ".odt": + return "application/vnd.oasis.opendocument.text"; + case ".oga": + return "audio/ogg"; + case ".ogv": + return "video/ogg"; + case ".ogx": + return "application/ogg"; + case ".opus": + return "audio/opus"; + case ".otf": + return "font/otf"; + case ".png": + return "image/png"; + case ".pdf": + return "application/pdf"; + case ".php": + return "application/x-httpd-php"; + case ".ppt": + return "application/vnd.ms-powerpoint"; + case ".pptx": + return "application/vnd.openxmlformats-officedocument.presentationml.presentation"; + case ".rar": + return "application/vnd.rar"; + case ".rtf": + return "application/rtf"; + case ".sh": + return "application/x-sh"; + case ".svg": + return "image/svg+xml"; + case ".swf": + return "application/x-shockwave-flash"; + case ".tar": + return "application/x-tar"; + case ".tif": + return "image/tiff"; + case ".tiff": + return "image/tiff"; + case ".ts": + return "video/mp2t"; + case ".ttf": + return "font/ttf"; + case ".txt": + return "text/plain"; + case ".vsd": + return "application/vnd.visio"; + case ".wav": + return "audio/wav"; + case ".weba": + return "audio/webm"; + case ".webm": + return "video/webm"; + case ".webp": + return "image/webp"; + case ".woff": + return "font/woff"; + case ".woff2": + return "font/woff2"; + case ".xhtml": + return "application/xhtml+xml"; + case ".xls": + return "application/vnd.ms-excel"; + case ".xlsx": + return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; + case ".xml": + return "application/xml"; + case ".xul": + return "application/vnd.mozilla.xul+xml"; + case ".zip": + return "application/zip"; + case ".7z": + return "application/x-7z-compressed"; + default: + return "text/plain"; + } + } +} diff --git a/plugins/mps-httpsupport/source_gen/jetbrains/mps/ide/httpsupport/manager/plugin/HttpRequest.java b/plugins/mps-httpsupport/source_gen/jetbrains/mps/ide/httpsupport/manager/plugin/HttpRequest.java index 9fc08b1a8347..916a77415fb4 100644 --- a/plugins/mps-httpsupport/source_gen/jetbrains/mps/ide/httpsupport/manager/plugin/HttpRequest.java +++ b/plugins/mps-httpsupport/source_gen/jetbrains/mps/ide/httpsupport/manager/plugin/HttpRequest.java @@ -56,6 +56,9 @@ public String getReferrerHost() { public String getMethod() { return request.method().name(); } + public Channel getChannel() { + return channel; + } public void sendResponse(HttpResponseStatus status, String contentType, ByteBuf buffer) { FullHttpResponse response = Responses.response(contentType, buffer); diff --git a/plugins/mps-httpsupport/source_gen/jetbrains/mps/ide/httpsupport/manager/plugin/trace.info b/plugins/mps-httpsupport/source_gen/jetbrains/mps/ide/httpsupport/manager/plugin/trace.info index 6caf57b91676..83ff3424384a 100644 --- a/plugins/mps-httpsupport/source_gen/jetbrains/mps/ide/httpsupport/manager/plugin/trace.info +++ b/plugins/mps-httpsupport/source_gen/jetbrains/mps/ide/httpsupport/manager/plugin/trace.info @@ -13,7 +13,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -68,9 +236,9 @@ - - - + + + @@ -207,39 +375,42 @@ - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + - + - - - - + + + + + @@ -247,29 +418,30 @@ - + + - + - + - + - + - + - + @@ -277,10 +449,10 @@ - + - + @@ -310,7 +482,7 @@ - + diff --git a/testbench/testsolutions/httpsupport.test/jetbrains.mps.ide.httpsupport.tests.msd b/testbench/testsolutions/httpsupport.test/jetbrains.mps.ide.httpsupport.tests.msd index 68eab1c28e68..61a16061a4fe 100644 --- a/testbench/testsolutions/httpsupport.test/jetbrains.mps.ide.httpsupport.tests.msd +++ b/testbench/testsolutions/httpsupport.test/jetbrains.mps.ide.httpsupport.tests.msd @@ -6,12 +6,14 @@ - + - + + + 817e4e70-961e-4a95-98a1-15e9f32231f1(jetbrains.mps.ide.httpsupport) 8585453e-6bfb-4d80-98de-b16074f1d86c(jetbrains.mps.lang.test) diff --git a/testbench/testsolutions/httpsupport.test/models/jetbrains/mps/ide/httpsupport/tests/lang@tests.mps b/testbench/testsolutions/httpsupport.test/models/jetbrains/mps/ide/httpsupport/tests/lang@tests.mps index bdab1228947d..a4c584d0b812 100644 --- a/testbench/testsolutions/httpsupport.test/models/jetbrains/mps/ide/httpsupport/tests/lang@tests.mps +++ b/testbench/testsolutions/httpsupport.test/models/jetbrains/mps/ide/httpsupport/tests/lang@tests.mps @@ -54,6 +54,9 @@ + + + @@ -97,6 +100,7 @@ + @@ -105,11 +109,13 @@ + + @@ -1445,5 +1451,866 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testbench/testsolutions/httpsupport.test/models/jetbrains/mps/ide/httpsupport/tests/plugin.mps b/testbench/testsolutions/httpsupport.test/models/jetbrains/mps/ide/httpsupport/tests/plugin.mps index 956db112b85b..68442e503a86 100644 --- a/testbench/testsolutions/httpsupport.test/models/jetbrains/mps/ide/httpsupport/tests/plugin.mps +++ b/testbench/testsolutions/httpsupport.test/models/jetbrains/mps/ide/httpsupport/tests/plugin.mps @@ -66,6 +66,9 @@ + + + @@ -97,6 +100,12 @@ + + + + + + @@ -617,5 +626,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testbench/testsolutions/httpsupport.test/source_gen.caches/jetbrains/mps/ide/httpsupport/tests/plugin/dependencies b/testbench/testsolutions/httpsupport.test/source_gen.caches/jetbrains/mps/ide/httpsupport/tests/plugin/dependencies index 5e50898d91d3..bbf7d0855c56 100644 --- a/testbench/testsolutions/httpsupport.test/source_gen.caches/jetbrains/mps/ide/httpsupport/tests/plugin/dependencies +++ b/testbench/testsolutions/httpsupport.test/source_gen.caches/jetbrains/mps/ide/httpsupport/tests/plugin/dependencies @@ -7,6 +7,8 @@ + + @@ -87,6 +89,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testbench/testsolutions/httpsupport.test/source_gen.caches/jetbrains/mps/ide/httpsupport/tests/plugin/generated b/testbench/testsolutions/httpsupport.test/source_gen.caches/jetbrains/mps/ide/httpsupport/tests/plugin/generated index f3fbaa8dd2d4..f49dffa56f74 100644 --- a/testbench/testsolutions/httpsupport.test/source_gen.caches/jetbrains/mps/ide/httpsupport/tests/plugin/generated +++ b/testbench/testsolutions/httpsupport.test/source_gen.caches/jetbrains/mps/ide/httpsupport/tests/plugin/generated @@ -1,5 +1,5 @@ - - + + diff --git a/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/ExtensionDescriptor.java b/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/ExtensionDescriptor.java index a552fae82d5a..fae0a005b649 100644 --- a/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/ExtensionDescriptor.java +++ b/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/ExtensionDescriptor.java @@ -7,7 +7,7 @@ import java.util.Arrays; public class ExtensionDescriptor extends DefaultExtensionDescriptor { - private Extension[] extensions = new Extension[]{new RH_simple_Extension(), new RH_requiredParams_Extension(), new RH_conditional_Extension(), new RH_exception_Extension(), new RH_turnBack1_Extension(), new RH_turnBack2_Extension(), new RH_conflicting2_Extension(), new RH_conflicting1_Extension(), new RH_POST_only_Extension(), new RH_POSTorGET_Extension(), new RH_AnyMethod_Extension()}; + private Extension[] extensions = new Extension[]{new RH_simple_Extension(), new RH_requiredParams_Extension(), new RH_conditional_Extension(), new RH_exception_Extension(), new RH_turnBack1_Extension(), new RH_turnBack2_Extension(), new RH_conflicting2_Extension(), new RH_conflicting1_Extension(), new RH_POST_only_Extension(), new RH_POSTorGET_Extension(), new RH_AnyMethod_Extension(), new RH_Ressource_Extension(), new RH_RessourceWithContentType_Extension()}; public ExtensionDescriptor() { } @Override diff --git a/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/RH_RessourceWithContentType_Extension.java b/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/RH_RessourceWithContentType_Extension.java new file mode 100644 index 000000000000..7798e9f694cb --- /dev/null +++ b/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/RH_RessourceWithContentType_Extension.java @@ -0,0 +1,31 @@ +package jetbrains.mps.ide.httpsupport.tests.plugin; + +/*Generated by MPS */ + +import jetbrains.mps.smodel.structure.Extension; +import jetbrains.mps.ide.httpsupport.manager.plugin.IHttpRequestHandlerFactory; +import org.jetbrains.annotations.NotNull; +import jetbrains.mps.ide.httpsupport.manager.plugin.IHttpRequestHandler; +import jetbrains.mps.ide.httpsupport.manager.plugin.HttpRequest; + +public class RH_RessourceWithContentType_Extension extends Extension.Default { + public RH_RessourceWithContentType_Extension() { + super("jetbrains.mps.ide.httpsupport.HttpRequestHandlerEP"); + } + + public IHttpRequestHandlerFactory factory = new IHttpRequestHandlerFactory() { + @NotNull + public String getHandlerName() { + return "RH_RessourceWithContentType"; + } + @NotNull + public IHttpRequestHandler create(@NotNull HttpRequest request) { + return new RH_RessourceWithContentType_RequestHandler(request); + } + }; + + + public IHttpRequestHandlerFactory get() { + return factory; + } +} diff --git a/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/RH_RessourceWithContentType_RequestHandler.java b/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/RH_RessourceWithContentType_RequestHandler.java new file mode 100644 index 000000000000..85a39a17eb52 --- /dev/null +++ b/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/RH_RessourceWithContentType_RequestHandler.java @@ -0,0 +1,75 @@ +package jetbrains.mps.ide.httpsupport.tests.plugin; + +/*Generated by MPS */ + +import jetbrains.mps.ide.httpsupport.runtime.base.HttpRequestHandlerBase; +import java.util.List; +import jetbrains.mps.internal.collections.runtime.ListSequence; +import java.util.ArrayList; +import jetbrains.mps.ide.httpsupport.manager.plugin.HttpRequest; +import jetbrains.mps.internal.collections.runtime.IterableUtils; +import java.net.URL; +import io.netty.handler.codec.http.HttpResponseStatus; +import io.netty.buffer.Unpooled; +import java.nio.charset.StandardCharsets; +import java.io.InputStream; +import jetbrains.mps.baseLanguage.closures.runtime._FunctionTypes; + +public class RH_RessourceWithContentType_RequestHandler extends HttpRequestHandlerBase { + + private static final List QUERY_PREFIX = ListSequence.fromListAndArray(new ArrayList(), "some", "contentType"); + + private final boolean myCorrectRequest; + + public RH_RessourceWithContentType_RequestHandler(HttpRequest request) { + super(request); + boolean correctRequest = true; + myCorrectRequest = correctRequest; + } + + + @Override + protected List getQueryPrefix() { + return QUERY_PREFIX; + } + + + @Override + public boolean canHandle() { + if (!(myCorrectRequest) || !(super.canHandle())) { + return false; + } + switch (request.getMethod()) { + case "GET": + break; + default: + return false; + } + + return true; + } + + @Override + public void handle() throws Exception { + List path = ListSequence.fromList(this.request.getSegments()).tailListSequence(2); + if (ListSequence.fromList(this.request.getSegments()).last().indexOf('.') < 0) { + ListSequence.fromList(path).addElement("index.html"); + } + String file = IterableUtils.join(ListSequence.fromList(path), "/"); + ClassLoader cl = ((Object) this).getClass().getClassLoader(); + URL resource = cl.getResource(file); + if (resource == null) { + this.request.sendResponse(HttpResponseStatus.NOT_FOUND, "text/html", Unpooled.copiedBuffer(file + " not found", StandardCharsets.UTF_8)); + } else { + try (InputStream resourceAsStream = resource.openStream()) { + String contentType; + contentType = new _FunctionTypes._return_P1_E0() { + public String invoke(HttpRequest request) { + return "some/content"; + } + }.invoke(this.request); + this.request.sendResponse(HttpResponseStatus.OK, contentType, Unpooled.copiedBuffer(resourceAsStream.readAllBytes())); + } + } + } +} diff --git a/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/RH_Ressource_Extension.java b/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/RH_Ressource_Extension.java new file mode 100644 index 000000000000..aae481ee1ae6 --- /dev/null +++ b/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/RH_Ressource_Extension.java @@ -0,0 +1,31 @@ +package jetbrains.mps.ide.httpsupport.tests.plugin; + +/*Generated by MPS */ + +import jetbrains.mps.smodel.structure.Extension; +import jetbrains.mps.ide.httpsupport.manager.plugin.IHttpRequestHandlerFactory; +import org.jetbrains.annotations.NotNull; +import jetbrains.mps.ide.httpsupport.manager.plugin.IHttpRequestHandler; +import jetbrains.mps.ide.httpsupport.manager.plugin.HttpRequest; + +public class RH_Ressource_Extension extends Extension.Default { + public RH_Ressource_Extension() { + super("jetbrains.mps.ide.httpsupport.HttpRequestHandlerEP"); + } + + public IHttpRequestHandlerFactory factory = new IHttpRequestHandlerFactory() { + @NotNull + public String getHandlerName() { + return "RH_Ressource"; + } + @NotNull + public IHttpRequestHandler create(@NotNull HttpRequest request) { + return new RH_Ressource_RequestHandler(request); + } + }; + + + public IHttpRequestHandlerFactory get() { + return factory; + } +} diff --git a/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/RH_Ressource_RequestHandler.java b/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/RH_Ressource_RequestHandler.java new file mode 100644 index 000000000000..1143664fc33d --- /dev/null +++ b/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/RH_Ressource_RequestHandler.java @@ -0,0 +1,71 @@ +package jetbrains.mps.ide.httpsupport.tests.plugin; + +/*Generated by MPS */ + +import jetbrains.mps.ide.httpsupport.runtime.base.HttpRequestHandlerBase; +import java.util.List; +import jetbrains.mps.internal.collections.runtime.ListSequence; +import java.util.ArrayList; +import jetbrains.mps.ide.httpsupport.manager.plugin.HttpRequest; +import jetbrains.mps.internal.collections.runtime.IterableUtils; +import java.net.URL; +import io.netty.handler.codec.http.HttpResponseStatus; +import io.netty.buffer.Unpooled; +import java.nio.charset.StandardCharsets; +import java.io.InputStream; +import jetbrains.mps.ide.httpsupport.manager.plugin.ContentTypeHelper; + +public class RH_Ressource_RequestHandler extends HttpRequestHandlerBase { + + private static final List QUERY_PREFIX = ListSequence.fromListAndArray(new ArrayList(), "some", "folder"); + + private final boolean myCorrectRequest; + + public RH_Ressource_RequestHandler(HttpRequest request) { + super(request); + boolean correctRequest = true; + myCorrectRequest = correctRequest; + } + + + @Override + protected List getQueryPrefix() { + return QUERY_PREFIX; + } + + + @Override + public boolean canHandle() { + if (!(myCorrectRequest) || !(super.canHandle())) { + return false; + } + switch (request.getMethod()) { + case "GET": + break; + default: + return false; + } + + return true; + } + + @Override + public void handle() throws Exception { + List path = ListSequence.fromList(this.request.getSegments()).tailListSequence(2); + if (ListSequence.fromList(this.request.getSegments()).last().indexOf('.') < 0) { + ListSequence.fromList(path).addElement("index.html"); + } + String file = IterableUtils.join(ListSequence.fromList(path), "/"); + ClassLoader cl = ((Object) this).getClass().getClassLoader(); + URL resource = cl.getResource(file); + if (resource == null) { + this.request.sendResponse(HttpResponseStatus.NOT_FOUND, "text/html", Unpooled.copiedBuffer(file + " not found", StandardCharsets.UTF_8)); + } else { + try (InputStream resourceAsStream = resource.openStream()) { + String contentType; + contentType = ContentTypeHelper.guessContentType(file); + this.request.sendResponse(HttpResponseStatus.OK, contentType, Unpooled.copiedBuffer(resourceAsStream.readAllBytes())); + } + } + } +} diff --git a/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/trace.info b/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/trace.info index 6150b0fa5c7b..99156691f8ad 100644 --- a/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/trace.info +++ b/testbench/testsolutions/httpsupport.test/source_gen/jetbrains/mps/ide/httpsupport/tests/plugin/trace.info @@ -16,11 +16,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -222,6 +307,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testbench/testsolutions/httpsupport.test/static/index.html b/testbench/testsolutions/httpsupport.test/static/index.html new file mode 100644 index 000000000000..df842e8fb0b8 --- /dev/null +++ b/testbench/testsolutions/httpsupport.test/static/index.html @@ -0,0 +1 @@ +

MPS rocks

\ No newline at end of file diff --git a/testbench/testsolutions/httpsupport.test/static/sub/index.html b/testbench/testsolutions/httpsupport.test/static/sub/index.html new file mode 100644 index 000000000000..df842e8fb0b8 --- /dev/null +++ b/testbench/testsolutions/httpsupport.test/static/sub/index.html @@ -0,0 +1 @@ +

MPS rocks

\ No newline at end of file diff --git a/testbench/testsolutions/httpsupport.test/static/sub/test.html b/testbench/testsolutions/httpsupport.test/static/sub/test.html new file mode 100644 index 000000000000..01441b221c5e --- /dev/null +++ b/testbench/testsolutions/httpsupport.test/static/sub/test.html @@ -0,0 +1 @@ +

works

\ No newline at end of file diff --git a/testbench/testsolutions/httpsupport.test/static/test.txt b/testbench/testsolutions/httpsupport.test/static/test.txt new file mode 100644 index 000000000000..8d71e8f5b1eb --- /dev/null +++ b/testbench/testsolutions/httpsupport.test/static/test.txt @@ -0,0 +1 @@ +Dummy.txt \ No newline at end of file diff --git a/testbench/testsolutions/httpsupport.test/test_gen.caches/jetbrains/mps/ide/httpsupport/tests/lang/dependencies b/testbench/testsolutions/httpsupport.test/test_gen.caches/jetbrains/mps/ide/httpsupport/tests/lang/dependencies index 6ebdc9610287..8ef763a269f9 100644 --- a/testbench/testsolutions/httpsupport.test/test_gen.caches/jetbrains/mps/ide/httpsupport/tests/lang/dependencies +++ b/testbench/testsolutions/httpsupport.test/test_gen.caches/jetbrains/mps/ide/httpsupport/tests/lang/dependencies @@ -70,5 +70,32 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testbench/testsolutions/httpsupport.test/test_gen.caches/jetbrains/mps/ide/httpsupport/tests/lang/generated b/testbench/testsolutions/httpsupport.test/test_gen.caches/jetbrains/mps/ide/httpsupport/tests/lang/generated index fa47f5986623..8f31d6e37b8b 100644 --- a/testbench/testsolutions/httpsupport.test/test_gen.caches/jetbrains/mps/ide/httpsupport/tests/lang/generated +++ b/testbench/testsolutions/httpsupport.test/test_gen.caches/jetbrains/mps/ide/httpsupport/tests/lang/generated @@ -1,5 +1,5 @@ - - + + diff --git a/testbench/testsolutions/httpsupport.test/test_gen/jetbrains/mps/ide/httpsupport/tests/lang/TestRessourceHandlerBehavior_Test.java b/testbench/testsolutions/httpsupport.test/test_gen/jetbrains/mps/ide/httpsupport/tests/lang/TestRessourceHandlerBehavior_Test.java new file mode 100644 index 000000000000..86aa5e0aff6b --- /dev/null +++ b/testbench/testsolutions/httpsupport.test/test_gen/jetbrains/mps/ide/httpsupport/tests/lang/TestRessourceHandlerBehavior_Test.java @@ -0,0 +1,165 @@ +package jetbrains.mps.ide.httpsupport.tests.lang; + +/*Generated by MPS */ + +import jetbrains.mps.MPSLaunch; +import jetbrains.mps.lang.test.runtime.BaseTransformationTest; +import org.junit.ClassRule; +import jetbrains.mps.lang.test.runtime.TestParametersCache; +import org.junit.Rule; +import jetbrains.mps.lang.test.runtime.RunWithCommand; +import org.junit.Test; +import org.junit.BeforeClass; +import org.jetbrains.ide.BuiltInServerManager; +import jetbrains.mps.lang.test.runtime.BaseTestBody; +import jetbrains.mps.lang.test.runtime.TransformationTest; +import java.net.URL; +import java.net.HttpURLConnection; +import junit.framework.Assert; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.FileNotFoundException; +import java.io.IOException; +import com.intellij.util.ExceptionUtil; + +@MPSLaunch +public class TestRessourceHandlerBehavior_Test extends BaseTransformationTest { + @ClassRule + public static final TestParametersCache ourParamCache = new TestParametersCache(TestRessourceHandlerBehavior_Test.class, "${mps_home}", "r:9e9ac0ea-b755-4d57-b406-d0cd74445963(jetbrains.mps.ide.httpsupport.tests.lang@tests)", false); + @Rule + public final RunWithCommand myWithCommandRule = new RunWithCommand(this); + + public TestRessourceHandlerBehavior_Test() { + super(ourParamCache); + } + + @Test + public void test_testSubFolder() throws Throwable { + new TestBody(this).test_testSubFolder(); + } + @Test + public void test_testIndex() throws Throwable { + new TestBody(this).test_testIndex(); + } + @Test + public void test_testText() throws Throwable { + new TestBody(this).test_testText(); + } + @Test + public void test_testInvalid() throws Throwable { + new TestBody(this).test_testInvalid(); + } + @Test + public void test_testContentType() throws Throwable { + new TestBody(this).test_testContentType(); + } + @Test + public void test_testFolder() throws Throwable { + new TestBody(this).test_testFolder(); + } + @Test + public void test_testIndexHtml() throws Throwable { + new TestBody(this).test_testIndexHtml(); + } + @Test + public void test_testIndexHtmlInSub() throws Throwable { + new TestBody(this).test_testIndexHtmlInSub(); + } + + @BeforeClass + public static void beforeTests() { + BuiltInServerManager.getInstance().waitForStart(); + } + + /*package*/ static class TestBody extends BaseTestBody { + + /*package*/ TestBody(TransformationTest owner) { + super(owner); + } + + public void test_testSubFolder() throws Exception { + String url = this.buildRequest("/some/folder/sub/test.html"); + this.testRequestResponse(url, 200, "

works

"); + } + public void test_testIndex() throws Exception { + String url = this.buildRequest("/some/folder/index.html"); + this.testRequestResponse(url, "GET", 200, "

MPS rocks

", "text/html"); + } + public void test_testText() throws Exception { + String url = this.buildRequest("/some/folder/test.txt"); + this.testRequestResponse(url, "GET", 200, "Dummy.txt", "text/plain"); + } + public void test_testInvalid() throws Exception { + String url = this.buildRequest("/some/folder/foo.html"); + this.testRequestResponse(url, 404, "foo.html not found"); + } + public void test_testContentType() throws Exception { + String url = this.buildRequest("/some/contentType/index.html"); + this.testRequestResponse(url, "GET", 200, "

MPS rocks

", "some/content"); + } + public void test_testFolder() throws Exception { + String url = this.buildRequest("/some/folder/doesNotExist"); + this.testRequestResponse(url, 404, "doesNotExist/index.html not found"); + } + public void test_testIndexHtml() throws Exception { + String url = this.buildRequest("/some/folder"); + this.testRequestResponse(url, "GET", 200, "

MPS rocks

", "text/html"); + } + public void test_testIndexHtmlInSub() throws Exception { + String url = this.buildRequest("/some/folder/sub/"); + this.testRequestResponse(url, "GET", 200, "

MPS rocks

", "text/html"); + } + + + public void testRequestResponse(String requestUrl, int exectedRetCode, String expectedResponse) { + this.testRequestResponse(requestUrl, "GET", exectedRetCode, expectedResponse); + } + public void testRequestResponse(String requestUrl, String method, int exectedRetCode, String expectedResponse) { + this.testRequestResponse(requestUrl, method, exectedRetCode, expectedResponse, null); + } + public void testRequestResponse(String requestUrl, String method, int exectedRetCode, String expectedResponse, String expectedContentType) { + try { + URL obj = new URL(requestUrl); + HttpURLConnection con = as_jj2dn3_a0a1a0a51q(obj.openConnection(), HttpURLConnection.class); + con.setRequestMethod(method); + con.connect(); + if ((expectedContentType != null && expectedContentType.length() > 0)) { + Assert.assertEquals(expectedContentType, con.getContentType()); + } + BufferedReader in; + if (exectedRetCode == 404) { + try { + Assert.assertEquals(exectedRetCode, con.getResponseCode()); + in = new BufferedReader(new InputStreamReader(con.getInputStream())); + Assert.fail("FileNotFound expected"); + } catch (FileNotFoundException expected) { + in = new BufferedReader(new InputStreamReader(con.getErrorStream())); + } + + } else { + Assert.assertEquals(exectedRetCode, con.getResponseCode()); + in = new BufferedReader(new InputStreamReader(con.getInputStream())); + } + if (expectedResponse != null) { + String inputLine; + StringBuffer response = new StringBuffer(); + while ((inputLine = in.readLine()) != null) { + response.append(inputLine); + } + + Assert.assertEquals(expectedResponse, response.toString()); + } + in.close(); + + } catch (IOException exception) { + Assert.fail("got exception on testing" + requestUrl + ":\n" + ExceptionUtil.getThrowableText(exception)); + } + } + public String buildRequest(String path) { + return "http://localhost:" + BuiltInServerManager.getInstance().getPort() + path; + } + private static T as_jj2dn3_a0a1a0a51q(Object o, Class type) { + return (type.isInstance(o) ? (T) o : null); + } + } +} diff --git a/testbench/testsolutions/httpsupport.test/test_gen/jetbrains/mps/ide/httpsupport/tests/lang/trace.info b/testbench/testsolutions/httpsupport.test/test_gen/jetbrains/mps/ide/httpsupport/tests/lang/trace.info index 186cf65c0b58..1a94abc99a2e 100644 --- a/testbench/testsolutions/httpsupport.test/test_gen/jetbrains/mps/ide/httpsupport/tests/lang/trace.info +++ b/testbench/testsolutions/httpsupport.test/test_gen/jetbrains/mps/ide/httpsupport/tests/lang/trace.info @@ -1,5 +1,6 @@ + @@ -14,104 +15,303 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -229,42 +429,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -312,126 +512,126 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +