Giter VIP home page Giter VIP logo

mps-extensions's Introduction

MPS Extensions

JetBrains MPS 2023.2

official JetBrains project

The MPS extensions aim to ease language development within MPS. They are maintained by itemis, JetBrains, and the open source community, and the development is closely aligned with the development of MPS.

Join the discussion on Slack in the #mps-extensions room.

Maven Dependencies

To use MPS Extensions in your project, add one of the following dependencies to your Maven or Gradle build script:

MPS-Extensions

MPS version nexus status
2023.2 artifacts.itemis.cloud
2022.3 artifacts.itemis.cloud
2022.2 artifacts.itemis.cloud
2021.3 artifacts.itemis.cloud
2021.2 artifacts.itemis.cloud
2021.1 artifacts.itemis.cloud

Building

Run the following commands to build the project:

./gradlew # Mac and Linux
gradlew.bat # Windows

This will download the required MPS version, so you need to be online when executing the build for the first time (later on, the downloaded artifacts will be cached).

The default task does not run the tests as part of the build. Execute the following command to run the tests:

./gradlew run_tests # Mac and Linux
gradlew.bat run_tests # Windows

See the building page of the documentation for more details.

Documentation

If you would like more information on the individual extensions, please see our documentation. The documentation's source is located in this repository's docs folder if you would like to contribute to it. To preview the documentation, run the following command:

./gradlew previewDocs # Mac and Linux
gradlew.bat previewDocs # Windows

mps-extensions's People

Contributors

alamqadem avatar alex-y-wd avatar alexanderpann avatar alexeiq avatar apyshkin avatar arimer avatar artem-tikhomirov avatar ashatalin avatar bkolb avatar cdelabou avatar coolya avatar danielratiu avatar dbinkele avatar eugenschindler avatar ftomassetti avatar fvollmer avatar github-actions[bot] avatar heikobecker avatar joostvanpinxten avatar kbirken avatar kemalsoysal avatar klemensschindler avatar krinara86 avatar markusvoelter avatar mvlassiev avatar pavel-nedvedicky avatar ratiud avatar sergej-koscejev avatar slisson avatar wsafonov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mps-extensions's Issues

Diagram Editor: Searching for text in a diagram starts renaming elements

From mbeddr.core created by eugenschindler : mbeddr/mbeddr.core#1964

When starting a search (Ctrl+F) and typing a search term, after typing exactly 3 characters, a node in the diagram with a textual item that matches the search is selected, the first 3 characters in that textual item are selected and focus is put onto that textual element.
The result of this is, that when you continue typing, the textual elements gets renamed (i.e. the first three selected characters are replaced by anything that is typed after the jump to the textual element).

Expected behavior would be that the found nodes are highlighted and that the first search result in the diagram is brought into the (center of the) view area (incremental search behavior), but without selecting (part of) the respective textual element.

Memory Leak in de.slisson.mps.tables

Hi,
we discovered a memory leak in the de.slisson.mps.tables package. The root cause of this leak is located in the de.slisson.mps.tables.runtime.cells.PartialTableExtractor class and its cache implementation:
image

Problem Description

It seems like the WeakHashMap doesn't automatically remove unreachable keys and keeps adding more instead. I'm working with a maximum heap size of 8 GB and i can reach it by refreshing editors that use structures of the de.slisson.mps.tables language (e.g. ChildsHorizontal, ChildsVertical, Table, PartialTable, ...). The following picture shows a dumped heap of 4,2 GB that was created by refreshing such editors and then closing all editor tabs:
image
[Source: https://www.eclipse.org/mat/, Leak Suspects Report]

90% of my heap was used by the PartialTableExtractor and it was not possible to clean this up without restarting MPS. I've tried:

  • Closing all editors and running the GC
  • Invalidate caches and running the GC

Temporary Solution

After this discovery i used the java reflection api to clear the WeakHashMap programmatically and the GC was able to clear my heap to its initial state.

Sample Project

I've prepared a sample project to demonstrate this issue:
performance.tableeditor.zip

This sample project contains intentions to:

  • create a root node with multiple tables with abritrary column and row count (createTableList intention)
  • refresh the editor multiple times based on an integer property (refreshEditorMultipleTimes intention)
  • clear all entries of the memory leak (PartialTableExtractor.ourOriginalChilds, clearCache intention)

The project contains a README.txt that explains some important aspects if needed.
MPS Version: 2017.2.3 (Build-172.1493)
mbeddr.platform Version: 2017_2.1.0.19582.9618fb3

Compilation error in port definition

From mbeddr.core created by joswarmer : mbeddr/mbeddr.core#1478

In the diagram editor specification you van specify the label of a port. If the expression entered is not of type string the langauge built will give a compilation error:

The constructor Port(<<expression type>>) is undefined,

There shoukld be a check on the type of the label expression to ensure it always conforms to string.

Refactoring (extract method) raises exception inside shape definitions

From mbeddr.core created by joswarmer : mbeddr/mbeddr.core#1477

Inside a shape definition I tired to extract a method.
When selecting either "Refactor" or "Choose Container" the folowing exception is raised.

[8791550]  ERROR - llij.ide.plugins.PluginManager - You can read model only inside read actions
jetbrains.mps.smodel.IllegalModelAccessError: You can read model only inside read actions
        at jetbrains.mps.smodel.WorkbenchModelAccess.checkReadAccess(WorkbenchModelAccess.java:483)
        at jetbrains.mps.smodel.ModelAccessBase.checkReadAccess(ModelAccessBase.java:38)
        at jetbrains.mps.extapi.module.SModuleBase.assertCanRead(SModuleBase.java:245)
        at jetbrains.mps.project.AbstractModule.getScope(AbstractModule.java:672)
        at jetbrains.mps.project.dependency.VisibilityUtil.isVisible(VisibilityUtil.java:32)
        at jetbrains.mps.ide.java.platform.refactorings.BaseChooseNodeDialog.initVisibleModels(BaseChooseNodeDialog.java:
        at jetbrains.mps.ide.java.platform.refactorings.BaseChooseNodeDialog.<init>(BaseChooseNodeDialog.java:53)
        at jetbrains.mps.ide.java.platform.refactorings.ExtractMethodDialog$9.<init>(ExtractMethodDialog.java:309)
        at jetbrains.mps.ide.java.platform.refactorings.ExtractMethodDialog.chooseStaticContainer(ExtractMethodDialog.jav
        at jetbrains.mps.ide.java.platform.refactorings.ExtractMethodDialog.doRefactoringAction(ExtractMethodDialog.java:
        at jetbrains.mps.ide.platform.refactoring.RefactoringDialog$RefactorAction.actionPerformed(RefactoringDialog.java
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
        at java.awt.Component.processMouseEvent(Component.java:6535)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
        at java.awt.Component.processEvent(Component.java:6300)
        at java.awt.Container.processEvent(Container.java:2236)
        at java.awt.Component.dispatchEventImpl(Component.java:4891)
        at java.awt.Container.dispatchEventImpl(Container.java:2294)
        at java.awt.Component.dispatchEvent(Component.java:4713)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
        at java.awt.Container.dispatchEventImpl(Container.java:2280)
        at java.awt.Window.dispatchEventImpl(Window.java:2750)
        at java.awt.Component.dispatchEvent(Component.java:4713)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
        at java.awt.EventQueue.access$500(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:709)
        at java.awt.EventQueue$3.run(EventQueue.java:703)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.awt.EventQueue$4.run(EventQueue.java:731)
        at java.awt.EventQueue$4.run(EventQueue.java:729)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
        at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:866)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
        at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184)
        at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229)
        at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227)
        at java.awt.Dialog.show(Dialog.java:1084)
        at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:792)
        at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:465)
        at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1638)
        at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1587)
        at jetbrains.mps.ide.java.actions.ExtractMethod_Action.doExecute(ExtractMethod_Action.java:110)
        at jetbrains.mps.workbench.action.BaseAction$2.run(BaseAction.java:145)
        at jetbrains.mps.workbench.action.BaseAction.actionPerformed(BaseAction.java:155)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:182)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:311)
        at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:958)
        at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:124)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:28
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:109)
        at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:513)
        at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:45)
        at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:533)
        at java.awt.Component.processMouseEvent(Component.java:6535)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
        at java.awt.Component.processEvent(Component.java:6300)
        at java.awt.Container.processEvent(Container.java:2236)
        at java.awt.Component.dispatchEventImpl(Component.java:4891)
        at java.awt.Container.dispatchEventImpl(Container.java:2294)
        at java.awt.Component.dispatchEvent(Component.java:4713)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
        at java.awt.Container.dispatchEventImpl(Container.java:2280)
        at java.awt.Window.dispatchEventImpl(Window.java:2750)
        at java.awt.Component.dispatchEvent(Component.java:4713)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
        at java.awt.EventQueue.access$500(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:709)
        at java.awt.EventQueue$3.run(EventQueue.java:703)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.awt.EventQueue$4.run(EventQueue.java:731)
        at java.awt.EventQueue$4.run(EventQueue.java:729)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
        at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:866)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
[8791588]  ERROR - llij.ide.plugins.PluginManager - JetBrains MPS 3.3.5  Build #MPS-143.1301
[8791588]  ERROR - llij.ide.plugins.PluginManager - JDK: 1.8.0_66
[8791588]  ERROR - llij.ide.plugins.PluginManager - VM: Java HotSpot(TM) 64-Bit Server VM
[8791588]  ERROR - llij.ide.plugins.PluginManager - Vendor: Oracle Corporation
[8791588]  ERROR - llij.ide.plugins.PluginManager - OS: Windows 10
[8791588]  ERROR - llij.ide.plugins.PluginManager - Last Action: EditorNextWord

Add Contribution Guide

Add a guide on how to get your code into the MPS extensions and what are the requirements in terms of quality and usage. etc.

mps-tables don't accept a style for an entire row.

When trying to set a style to a horizontal r<> node it causes a compilation error.

The code I used is:

<no base style> {                                                                                                 
  apply-if : SampleStyle condition: (editorContext, node)->boolean { 
         true; 
 }
}         

The compilation error is:

com/SampleConcept_EditorBuilder_a.java : Syntax error on token ",", Expression expected after this token

The generated code is:

new SampleStyleClass(getEditorContext(), getNode()).apply(style, );

Diagram Editor: Upon auto-layout, edges get surprising shapes and labels are not correctly repositioned to their respective edges

From mbeddr.core created by eugenschindler : mbeddr/mbeddr.core#1960

When using the auto-layout diagram button (image):

  • edges get surprising forms (with all types of unnecessary loops)
  • the labels that belong to these edges do not get positioned along the edge but at seemingly random places (often overlapping other contents), which renders the resulting diagram unreadable.

Pressing the relayout connected edges button (image) several times improves some of the label positions, but after pressing it many times, a fixpoint is reached that does not yield the correct result (all the initial "strangely shaped" edges still have the same shape and some labels still don't have the correct position).

Expected behavior would be that all edges have consistent, "clean" (without weird loops) shapes and the labels are positioned along the edges.

Missing information in graphical projection of a composite block

From mbeddr.core created by krishnanm86 : mbeddr/mbeddr.core#1877

Starting Point
The user creates an incomplete connection in the textual view. This is a point of inconsistency visible to the user in textual projection.

User Action
The user now switches to graphical view.

Result
This user now doesn't see any inconsistency! Though this information is still there, also in the visualization.

Expected Result
Multiple folds:
Graphical projection should be as much as of a lossless projection of the textual/other projections. Units/conversions are pending and need separate issues to address and are beyond the scope of this issue.

image

Diagram Editor: print editor button does not produce a result when a diagram is present

From mbeddr.core created by eugenschindler : mbeddr/mbeddr.core#1965

When pressing the print editor button (image) in the toolbar while a diagram editor is present in the current model, no screenshot is created (although the copy/paste buffer contains a path to the file that should have been created).

Expected behavior: screenshot functionality works with diagram editors (ideal scenario, because this is consistent with screenshot-functionality of other editors), or there is an alternative good way of making images of models with a diagram editor in them.

Add README

Should contain:

  • link to the build
  • info about how to get it from nexus

Diagram Editor: Add a "starting box" concept to layout specification in a diagram

From mbeddr.core created by eugenschindler : mbeddr/mbeddr.core#1963

Current layout options allow only for specifying tree or layered (with a direction - down, up, left, right). Please add a way to specify a specific node (e.g. by concept or by specific properties) that can serve as a starting point for the layout (i.e. will be used as the most top, left, right, or bottom - depending on the direction chosen in the layout).

An example of a use case for this is a statemachine diagra, where auto-layout should always start with initial states and the positions of other states are automatically layouted based on these initial states.

Connection in graphical should draw crossings properly

From mbeddr.core created by kbirken : mbeddr/mbeddr.core#1474

If two connections in the graphical editor cross each other, it is not possible to distinguish which goes where. Little "bridges" should be drawn instead of plain crossings. Or dots should be draw if the crossing is actually a merging of connections. See attached example from current implementation (which contains both types of crossings).

bildschirmfoto 2016-08-16 um 17 00 31

Support multiple versions of MPS concurrently

Currently the build doesn't easily support publishing version for different MPS versions at the same time.

The logic always appends the the branch name to the version which we should avoid. We should have a set of branches that are allowed to build releases without further work.

Diagram Editor: view of a nested querylist editor is not updated when selecting a reference from completion menu

From mbeddr.core created by eugenschindler : mbeddr/mbeddr.core#1959

When a querylist editor is nested in a diagram editor (e.g. in a diagram.box editor), upon selecting an item (e.g. a reference to some other node) from the completion menu, the name of the reference in the diagram editor is not updated visually. The update only happens when you change focus (e.g. de-focus from the cell in which you just changed the value).

Expected behavior would be that the update happens instantaneously and the superfluous focus change is not needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.