Skip to content

Commit

Permalink
Merge pull request #147 from modelix/baseLanguage-editor-usability
Browse files Browse the repository at this point in the history
Base language editor usability
  • Loading branch information
slisson authored May 16, 2024
2 parents f204716 + 03c0a29 commit a705a07
Show file tree
Hide file tree
Showing 24 changed files with 1,278 additions and 171 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<reference id="635805674430276264" name="link" index="1yiJtc" />
<child id="2346135138154959868" name="renderTarget" index="1KhJq6" />
</concept>
<concept id="635805674430385442" name="org.modelix.mps.notation.structure.SubstituteCell" flags="ng" index="1yiLz6" />
<concept id="8310867745953158874" name="org.modelix.mps.notation.structure.ConstantCell" flags="ng" index="3JB3jO">
<property id="8310867745953159745" name="text" index="3JB3xJ" />
</concept>
Expand Down Expand Up @@ -114,6 +115,22 @@
<node concept="2OYlUR" id="CUW2QYMi3M" role="2OY0$2">
<ref role="2OYlZd" to="tpck:h0TrG11" resolve="name" />
</node>
<node concept="1yhmst" id="6GCLx5Dr8h0" role="2OY0$2">
<node concept="2OY0tg" id="6GCLx5Dr8h8" role="1yhmsp">
<node concept="1yiDf7" id="6GCLx5Dr8hu" role="2OY0$2" />
<node concept="3JB3jO" id="6GCLx5Dr8hg" role="2OY0$2">
<property role="3JB3xJ" value="&lt;" />
</node>
<node concept="1yiDf7" id="6GCLx5Dr8hC" role="2OY0$2" />
<node concept="2OWXkZ" id="6GCLx5Dr8hb" role="2OY0$2">
<ref role="2OWXpU" to="tpee:g96eVAe" resolve="typeVariableDeclaration" />
</node>
<node concept="1yiDf7" id="6GCLx5Dr8i2" role="2OY0$2" />
<node concept="3JB3jO" id="6GCLx5Dr8hO" role="2OY0$2">
<property role="3JB3xJ" value="&gt;" />
</node>
</node>
</node>
<node concept="3JB3jO" id="CUW2QYMicm" role="2OY0$2">
<property role="3JB3xJ" value="{" />
</node>
Expand Down Expand Up @@ -293,6 +310,30 @@
</node>
</node>
</node>
<node concept="3JBH_3" id="5tIuOqbX3l8" role="3JBHiB">
<ref role="3JBHV4" to="tpee:4D3iSq_h_ou" resolve="ResourceVariable" />
<node concept="2OY0tg" id="5tIuOqbX3ur" role="3JBHQ1">
<node concept="1yiLz6" id="5tIuOqbX3uu" role="2OY0$2" />
<node concept="2OY0tg" id="5tIuOqbX3H3" role="2OY0$2">
<node concept="1yiDfa" id="5tIuOqbX3H4" role="2OY0$2">
<ref role="1yiDfm" to="tpee:4VkOLwjf83e" resolve="type" />
</node>
<node concept="2OYlUR" id="5tIuOqbX3H5" role="2OY0$2">
<ref role="2OYlZd" to="tpck:h0TrG11" resolve="name" />
</node>
<node concept="1yhmst" id="5tIuOqbX3H6" role="2OY0$2">
<node concept="2OY0tg" id="5tIuOqbX3H7" role="1yhmsp">
<node concept="3JB3jO" id="5tIuOqbX3H8" role="2OY0$2">
<property role="3JB3xJ" value="=" />
</node>
<node concept="1yiDfa" id="5tIuOqbX3H9" role="2OY0$2">
<ref role="1yiDfm" to="tpee:fz3vP1I" resolve="initializer" />
</node>
</node>
</node>
</node>
</node>
</node>
<node concept="3JBH_3" id="26N7cZTNRvx" role="3JBHiB">
<ref role="3JBHV4" to="tpee:fJuHJVf" resolve="BinaryOperation" />
<node concept="2OY0tg" id="26N7cZTNRwP" role="3JBHQ1">
Expand Down Expand Up @@ -1444,6 +1485,43 @@
<ref role="3JBHV4" to="tpee:1hodSy9TH5A" resolve="PlaceholderMember" />
<node concept="3JB3jO" id="m1OUzpj59Z" role="3JBHQ1" />
</node>
<node concept="3JBH_3" id="3wApu6Pq0ju" role="3JBHiB">
<ref role="3JBHV4" to="tpee:fz3vP1H" resolve="Type" />
<node concept="2OY0tg" id="3wApu6Pq0sU" role="3JBHQ1">
<node concept="1yiLz6" id="3wApu6Pq0t2" role="2OY0$2" />
<node concept="3JB3jO" id="3wApu6Pq0sX" role="2OY0$2">
<property role="3JB3xJ" value="Type" />
</node>
</node>
</node>
<node concept="3JBH_3" id="4jBgXPX7INB" role="3JBHiB">
<ref role="3JBHV4" to="tpee:g96euPO" resolve="TypeVariableDeclaration" />
<node concept="2OY0tg" id="4jBgXPX7WjO" role="3JBHQ1">
<node concept="2OYlUR" id="4jBgXPX7WjR" role="2OY0$2">
<ref role="2OYlZd" to="tpck:h0TrG11" resolve="name" />
</node>
<node concept="1yhmst" id="4jBgXPX7WjW" role="2OY0$2">
<node concept="2OY0tg" id="4jBgXPX7Wk2" role="1yhmsp">
<node concept="3JB3jO" id="4jBgXPX7Wk5" role="2OY0$2">
<property role="3JB3xJ" value="extends" />
</node>
<node concept="1yiDfa" id="4jBgXPX7Wka" role="2OY0$2">
<ref role="1yiDfm" to="tpee:hFztrQw" resolve="bound" />
</node>
<node concept="1yhmst" id="4jBgXPX7Wki" role="2OY0$2">
<node concept="2OY0tg" id="4jBgXPX7Wkp" role="1yhmsp">
<node concept="3JB3jO" id="4jBgXPX7Wks" role="2OY0$2">
<property role="3JB3xJ" value="&amp;" />
</node>
<node concept="2OWXkZ" id="4jBgXPX7Wkx" role="2OY0$2">
<ref role="2OWXpU" to="tpee:hFD4UhQ" resolve="auxBounds" />
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</node>
<node concept="3JBFZQ" id="22f9nDgKep2">
<property role="TrG5h" value="jetbrains.mps.lang.smodel" />
Expand Down Expand Up @@ -1722,3 +1800,4 @@
</node>
</node>
</model>

106 changes: 106 additions & 0 deletions ...s.notation/generator/templates/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@
<concept id="1137021947720" name="jetbrains.mps.baseLanguage.structure.ConceptFunction" flags="in" index="2VMwT0">
<child id="1137022507850" name="body" index="2VODD2" />
</concept>
<concept id="1070475926800" name="jetbrains.mps.baseLanguage.structure.StringLiteral" flags="nn" index="Xl_RD">
<property id="1070475926801" name="value" index="Xl_RC" />
</concept>
<concept id="1081236700937" name="jetbrains.mps.baseLanguage.structure.StaticMethodCall" flags="nn" index="2YIFZM">
<reference id="1144433194310" name="classConcept" index="1Pybhc" />
</concept>
<concept id="1070534058343" name="jetbrains.mps.baseLanguage.structure.NullLiteral" flags="nn" index="10Nm6u" />
<concept id="1225271408483" name="jetbrains.mps.baseLanguage.structure.IsNotEmptyOperation" flags="nn" index="17RvpY" />
<concept id="1068580123152" name="jetbrains.mps.baseLanguage.structure.EqualsExpression" flags="nn" index="3clFbC" />
<concept id="1068580123155" name="jetbrains.mps.baseLanguage.structure.ExpressionStatement" flags="nn" index="3clFbF">
<child id="1068580123156" name="expression" index="3clFbG" />
</concept>
Expand All @@ -69,6 +73,18 @@
<reference id="1068499141037" name="baseMethodDeclaration" index="37wK5l" />
<child id="1068499141038" name="actualArgument" index="37wK5m" />
</concept>
<concept id="1081773326031" name="jetbrains.mps.baseLanguage.structure.BinaryOperation" flags="nn" index="3uHJSO">
<child id="1081773367579" name="rightExpression" index="3uHU7w" />
<child id="1081773367580" name="leftExpression" index="3uHU7B" />
</concept>
<concept id="1163668896201" name="jetbrains.mps.baseLanguage.structure.TernaryOperatorExpression" flags="nn" index="3K4zz7">
<child id="1163668914799" name="condition" index="3K4Cdx" />
<child id="1163668922816" name="ifTrue" index="3K4E3e" />
<child id="1163668934364" name="ifFalse" index="3K4GZi" />
</concept>
<concept id="6329021646629104954" name="jetbrains.mps.baseLanguage.structure.SingleLineComment" flags="nn" index="3SKdUt">
<child id="8356039341262087992" name="line" index="1aUNEU" />
</concept>
</language>
<language id="8f2def56-7502-4f14-994f-472d404e528c" name="org.modelix.mps.baseLanguage2kotlin">
<concept id="2346135138155708006" name="org.modelix.mps.baseLanguage2kotlin.structure.ConvertToKotlin" flags="ng" index="1KmxGs">
Expand Down Expand Up @@ -301,6 +317,14 @@
<property id="1169194664001" name="name" index="TrG5h" />
</concept>
</language>
<language id="c7fb639f-be78-4307-89b0-b5959c3fa8c8" name="jetbrains.mps.lang.text">
<concept id="155656958578482948" name="jetbrains.mps.lang.text.structure.Word" flags="nn" index="3oM_SD">
<property id="155656958578482949" name="value" index="3oM_SC" />
</concept>
<concept id="2535923850359271782" name="jetbrains.mps.lang.text.structure.Line" flags="nn" index="1PaTwC">
<child id="2535923850359271783" name="elements" index="1PaTwD" />
</concept>
</language>
<language id="83888646-71ce-4f1c-9c53-c54016f6ad4f" name="jetbrains.mps.baseLanguage.collections">
<concept id="1172650591544" name="jetbrains.mps.baseLanguage.collections.structure.SkipOperation" flags="nn" index="7r0gD">
<child id="1172658456740" name="elementsToSkip" index="7T0AP" />
Expand Down Expand Up @@ -374,6 +398,87 @@
</node>
</node>
</node>
<node concept="3aamgX" id="3CJpHJsa$LZ" role="3acgRq">
<ref role="30HIoZ" to="f8gn:ziPuhEAsOy" resolve="SubstituteCell" />
<node concept="gft3U" id="3CJpHJsa$M0" role="1lVwrX">
<node concept="1NbEFs" id="3CJpHJsa$M1" role="gfFT$">
<ref role="AarEw" to="dbfy:~NotationRootCellTemplateBuilder.completionText(kotlin/String)" resolve="completionText" />
<node concept="1XD0eI" id="3CJpHJsaFK3" role="TWiod">
<node concept="1XD08G" id="3CJpHJsaFK2" role="1XD0ZN">
<node concept="Df6$J" id="3CJpHJsaFK8" role="Df6Hu">
<node concept="21VMdE" id="3CJpHJsaFK7" role="Df7GE">
<property role="21VMdD" value="text" />
<node concept="17Uvod" id="3CJpHJsaFKb" role="lGtFl">
<property role="2qtEX9" value="content" />
<property role="P4ACc" value="6b3888c1-9802-44d8-8baf-f8e6c33ed689/1243006380188575965/1243006380188575966" />
<node concept="3zFVjK" id="3CJpHJsaFKc" role="3zH0cK">
<node concept="3clFbS" id="3CJpHJsaFKd" role="2VODD2">
<node concept="3SKdUt" id="3CJpHJsaPA6" role="3cqZAp">
<node concept="1PaTwC" id="3CJpHJsaPA7" role="1aUNEU">
<node concept="3oM_SD" id="3CJpHJsaPTH" role="1PaTwD">
<property role="3oM_SC" value="empty" />
</node>
<node concept="3oM_SD" id="3CJpHJsaPTO" role="1PaTwD">
<property role="3oM_SC" value="string" />
</node>
<node concept="3oM_SD" id="3CJpHJsaPTY" role="1PaTwD">
<property role="3oM_SC" value="hides" />
</node>
<node concept="3oM_SD" id="3CJpHJsaPU8" role="1PaTwD">
<property role="3oM_SC" value="the" />
</node>
<node concept="3oM_SD" id="3CJpHJsaPUh" role="1PaTwD">
<property role="3oM_SC" value="entry." />
</node>
<node concept="3oM_SD" id="3CJpHJsaQes" role="1PaTwD">
<property role="3oM_SC" value="null" />
</node>
<node concept="3oM_SD" id="3CJpHJsaQfg" role="1PaTwD">
<property role="3oM_SC" value="would" />
</node>
<node concept="3oM_SD" id="3CJpHJsaQgy" role="1PaTwD">
<property role="3oM_SC" value="have" />
</node>
<node concept="3oM_SD" id="3CJpHJsaQgK" role="1PaTwD">
<property role="3oM_SC" value="no" />
</node>
<node concept="3oM_SD" id="3CJpHJsaQgX" role="1PaTwD">
<property role="3oM_SC" value="effect." />
</node>
</node>
</node>
<node concept="3clFbF" id="3CJpHJsaJVK" role="3cqZAp">
<node concept="3K4zz7" id="3CJpHJsaO8f" role="3clFbG">
<node concept="Xl_RD" id="3CJpHJsaOrx" role="3K4E3e">
<property role="Xl_RC" value="" />
</node>
<node concept="3clFbC" id="3CJpHJsaLJ3" role="3K4Cdx">
<node concept="10Nm6u" id="3CJpHJsaMY9" role="3uHU7w" />
<node concept="2OqwBi" id="3CJpHJsaGu$" role="3uHU7B">
<node concept="30H73N" id="3CJpHJsaG0p" role="2Oq$k0" />
<node concept="3TrcHB" id="3CJpHJsaID4" role="2OqNvi">
<ref role="3TsBF5" to="f8gn:ziPuhEAsOB" resolve="text" />
</node>
</node>
</node>
<node concept="2OqwBi" id="3CJpHJsaOIz" role="3K4GZi">
<node concept="30H73N" id="3CJpHJsaOI$" role="2Oq$k0" />
<node concept="3TrcHB" id="3CJpHJsaOI_" role="2OqNvi">
<ref role="3TsBF5" to="f8gn:ziPuhEAsOB" resolve="text" />
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</node>
<node concept="3aamgX" id="26N7cZTNAnB" role="3acgRq">
<ref role="30HIoZ" to="f8gn:ziPuhE_VbT" resolve="OptionalCell" />
<node concept="gft3U" id="26N7cZTNAnC" role="1lVwrX">
Expand Down Expand Up @@ -1567,3 +1672,4 @@
</node>
</node>
</model>

Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ class ModelixSSRClient(private val httpClient: HttpClient, private val url: Stri
return changesOnly.takeIf { it.isNotEmpty() }
}

fun sendBoundsUpdate() {
val update = computeBoundsUpdate() ?: return
MessageFromClient(editorId = editorId, boundUpdates = update).send()
}

private fun MessageFromClient.withBounds(): MessageFromClient {
require(boundUpdates == null) { "Already contains bound update data" }
return copy(boundUpdates = computeBoundsUpdate())
Expand All @@ -170,6 +175,7 @@ class ModelixSSRClient(private val httpClient: HttpClient, private val url: Stri
}

fun applyUpdate(update: DomTreeUpdate) {
if (update.elements.isEmpty()) return
LOG.trace { "($editorId) Updating DOM" }
// this map allows updating nodes in a different order to resolve references during syncChildren
pendingUpdates.putAll(
Expand All @@ -190,6 +196,8 @@ class ModelixSSRClient(private val httpClient: HttpClient, private val url: Stri
}
}
possiblyDetachedElements.clear()

sendBoundsUpdate()
}

private fun updateNode(data: INodeUpdateData): Node {
Expand Down
Loading

0 comments on commit a705a07

Please sign in to comment.