Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c1c9bad
Release 7.8.1 - Timing wird dynamisch bestimmt (#27), update nth stre…
adriancostin-sd Nov 4, 2025
2285737
Backporting typecheck3 to 7.8.x (#40)
justusrm Jan 9, 2026
6fb10d0
Backporting 6 CoCos (#43)
MKZaito Jan 12, 2026
b470d31
add CoCos to Checker (#44)
MKZaito Jan 15, 2026
e84c971
CoCos to default and version bump (#46)
MKZaito Jan 18, 2026
255df7b
Eps added to global scope (#47)
DovydasSkauranskas Jan 22, 2026
12e3e37
CoCo: Erkennung doppelt verwendeter Part-Namen (Backport) (#49)
MKZaito Feb 5, 2026
c590793
7.8.8: Fix for LanguageServer Listing Errors Multiple Times (Backport…
MKZaito Feb 10, 2026
d6ccd2c
7.8.9: Fix for CoCos Assuming Direction In Connection (Backport) (#54)
MKZaito Feb 10, 2026
23e9b26
#119 Added RequirementSubject2Variable symbol adapter (#56)
justusrm Feb 11, 2026
c7767a1
7.8.11: Added Requirements to CC-Language (#57)
justusrm Feb 11, 2026
60e528e
7.8.12: Possibility to configure which CoCos are run
mathias-pfeiffer Feb 11, 2026
f78d922
7.8.13: Added Quickfix for Duplicate Names in Subparts (#59)
MKZaito Feb 13, 2026
dfe9665
MCStructuralTypes wird im Grammar importiert (#62)
DovydasSkauranskas Feb 17, 2026
eb6e6e0
7.8.14: Allow Relativ ModelPaths and take current Workspace as Defaul…
MKZaito Feb 17, 2026
a993b49
7.8.15 Adapting CC-Requirement Adapter to work without sysml-ast refe…
justusrm Feb 24, 2026
1c3f2fc
7.8.16: old type check removed, new type check disabled
mathias-pfeiffer Feb 24, 2026
30b322a
7.8.17: COmplete refinements from Specialization too
mathias-pfeiffer Feb 24, 2026
128a010
7.8.18: Port-CoCos dont behave properly and try to access AST instead…
mathias-pfeiffer Feb 24, 2026
8cefc64
7.8.19: TypeVisitor für ConditionAndExpression2q
mathias-pfeiffer Mar 2, 2026
54e2767
7.8.20: Fixed Resolving for Relative ModelPaths (#27, upate mclsg_ver…
mathias-pfeiffer Mar 6, 2026
209cd00
7.8.21: TypeVisitor für ConditionalOrExpression2 (#70)
mathias-pfeiffer Mar 6, 2026
f601773
7.8.22: CoCo for AcceptAction in Event-Transitions
mathias-pfeiffer Mar 6, 2026
e617df1
In/accept dataport (#71)
JanaNefedova Mar 6, 2026
74c921f
Grammatik angepasst, damit 'metadata def delayed' erlaubt wird (#72)
JanaNefedova Mar 7, 2026
ed060ec
7.8.25: Implemented MildComponentSymbol.isHistoryBased()
mathias-pfeiffer Mar 8, 2026
0e5ed61
7.8.26: TypesCompleter für MCTuples (#73)
DovydasSkauranskas Mar 12, 2026
0a01502
#201 tsyn Flag von dem Part Def ablesen (#74)
DovydasSkauranskas Mar 16, 2026
7706f92
Version erhoeht
DovydasSkauranskas Mar 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ subprojects {
group = 'de.monticore.lang.sysml_v2'

// Needs to be after java plugin
sourceCompatibility = "11"
sourceCompatibility = JavaVersion.VERSION_11

project.buildDir = "target"

Expand All @@ -19,8 +19,12 @@ subprojects {
}

// Java JDK Warning
if (JavaVersion.current() > sourceCompatibility) {
logger.warn("\u001B[33m Warning: You are currently using JDK Version " + JavaVersion.current() + ". " + "Higher JDK versions may cause compatibility problems. JDK 11 is recommended. \u001B[0m")
if (JavaVersion.current() > sourceCompatibility
&& JavaVersion.current() != JavaVersion.VERSION_17)
{
logger.warn("\u001B[33m Warning: You are currently using JDK Version " +
JavaVersion.current() + ". " + "Higher JDK versions may cause " +
"compatibility problems. JDK 11 or 17 is recommended. \u001B[0m")
}

// Use the same testing framework for all modules
Expand Down
5 changes: 5 additions & 0 deletions cc/src/main/grammars/de/monticore/lang/ComponentConnector.mc4
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,9 @@ component grammar ComponentConnector
transitions: Transition*
;

/**
* Requirements: Wir berücksichtigen primär die Namen der Requirements
*/
interface symbol Requirement = Name;

}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ sysmlGitlab = https://git.rwth-aachen.de/api/v4/projects/37093/packages/m

# Dependencies
mc_version = 7.8.0
mclsg_version = 7.8.0
mclsg_version = 7.8.3
se_commons_version = 7.8.0
assertj_version = 3.21.0
junit_version = 5.8.2

# Version of published artifacts
version = 7.8.0
version = 7.8.27
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import de.mclsg.lsp.document_management.DocumentManager;
import de.mclsg.lsp.modelpath.multiproject.ProjectLayoutBuilder;
import de.monticore.lang.sysmlv2._lsp.language_access.SysMLv2ScopeManager;
import org.eclipse.lsp4j.InitializedParams;
import org.eclipse.lsp4j.MessageParams;
import org.eclipse.lsp4j.MessageType;
import org.slf4j.Logger;
Expand All @@ -17,6 +18,21 @@ public class SysMLv2LanguageServer extends SysMLv2LanguageServerTOP {

private static final Logger logger = LoggerFactory.getLogger(SysMLv2LanguageServer.class);

@Override
public void initialized(InitializedParams params) {
if (options != null) {
// Re-resolve layout with correct workspace path
ProjectLayout newLayout = new ProjectLayoutBuilder()
.projectpath(options.getWorkspacePath())
.symbolPath(options.getSymbolPaths())
.resources(options.getModelPaths())
.build();

resetContent(newLayout);
}
super.initialized(params);
}

/** Convenience: Wir modifizieren aktuell eigentlich nur den ModelPath */
public SysMLv2LanguageServer(ProjectLayout layout) {
this(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public SysMLv2CodeActionProvider(DocumentManager documentManager,
AstPrettyPrinter<ASTSysMLModel> astSysMLModelAstPrettyPrinter) {
super(documentManager, astSysMLModelAstPrettyPrinter);
coCoCodeActionProviders.add(new UpperCaseBlockName(documentManager));
coCoCodeActionProviders.add(new UniqueSubPartName(documentManager));
coCoCodeActionProviders.add(new MissingRefinement(documentManager));
coCoCodeActionProviders.add(new MissingRefiner(documentManager));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.sysmlv2._lsp.features.code_action;

import de.mclsg.lsp.document_management.DocumentInformation;
import de.mclsg.lsp.document_management.DocumentManager;
import de.monticore.ast.ASTNode;
import de.monticore.lang.sysmlparts._ast.ASTPartUsage;
import de.monticore.lang.sysmlparts._symboltable.PartUsageSymbol;
import de.monticore.lang.sysmlv2._symboltable.ISysMLv2Scope;
import de.monticore.symboltable.modifiers.AccessModifier;
import org.eclipse.lsp4j.*;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;

/**
* CodeAction for UniqueSubPartNamesInParentCoCo with ErrorCode 0x10AA7. Suggest
* a new name by appending "A".
*/
public class UniqueSubPartName extends CoCoCodeActionProvider {

public UniqueSubPartName(DocumentManager documentManager) {
super(documentManager, "0x10AA7");
}

@Override
public List<CodeAction> createFixesFor(TextDocumentItem document,
Diagnostic diagnostic) {
List<CodeAction> res = new ArrayList<>();
Optional<DocumentInformation> di = documentManager.getDocumentInformation(
document);

if (di.isEmpty()) {
return res;
}

ASTNode ast = di.get().ast;

Range diagnosticRange = diagnostic.getRange();
int diagnosticLine = diagnosticRange.getStart().getLine();
int diagnosticColumn = diagnosticRange.getStart().getCharacter();

traverse((ISysMLv2Scope) ast.getEnclosingScope(), symbol -> {
if (symbol == null || symbol.getAstNode() == null) {
return;
}

ASTPartUsage node = symbol.getAstNode();

if (!isContainedInPosition(node, diagnosticLine, diagnosticColumn)) {
return; // Skip if this node doesn't contain the diagnostic position
}

if (triggeredCoCo(node) && node.isPresentName()) {
String currentName = node.getName();
String newName = suggestedName(currentName);

CodeAction ca = new CodeAction(
String.format("Change name to '%s'", newName));
ca.setKind(CodeActionKind.QuickFix);

TextEdit textEdit = new TextEdit();
Position pStart = calculateStartPosition(document, node, currentName);
Position pEnd = new Position(pStart.getLine(),
pStart.getCharacter() + currentName.length());

textEdit.setRange(new Range(pStart, pEnd));
textEdit.setNewText(newName);

ca.setEdit(new WorkspaceEdit(Collections.singletonMap(document.getUri(),
Collections.singletonList(textEdit))));
res.add(ca);
}
});

return res;
}

// Simply appends "A", can be changed in the future
private String suggestedName(String oldName){
return oldName + "A";
}

private static void traverse(ISysMLv2Scope scope,
Consumer<PartUsageSymbol> f) {
if (scope != null) {
scope.getPartUsageSymbols().entries().forEach(
entry -> f.accept(entry.getValue()));
scope.getSubScopes().forEach(s -> traverse(s, f));
}
}

// Returns true if this node has triggered 0x10AA7
private boolean triggeredCoCo(ASTPartUsage node) {
var scope = node.getEnclosingScope();
String partName = node.getName();

var allMatches = scope.resolvePartUsageLocallyMany(false, partName,
AccessModifier.ALL_INCLUSION, p -> true);

return allMatches.size() > 1;
}

/**
* Finds the exact start position of the part name.
*
* Skips the 'part' keyword and any following whitespaces
* to avoid editing keywords and other syntax elements.
*/
protected Position calculateStartPosition(TextDocumentItem document,
ASTPartUsage partUsage,
String currentName) {
int lineIdx = partUsage.get_SourcePositionStart().getLine() - 1;
int nameIdx = partUsage.get_SourcePositionStart().getColumn() - 1;

String[] lines = document.getText().split("\\r?\\n");
if (lineIdx < lines.length) {
String line = lines[lineIdx];

int startIdx = Math.max(0, nameIdx);

int partIdx = line.indexOf("part", startIdx);
if (partIdx != -1) {
startIdx = partIdx + 4; // Skip "part"

// Skip any whitespace after "part"
while (startIdx < line.length() && Character.isWhitespace(line.charAt(startIdx))) {
startIdx++;
}
}

nameIdx = line.indexOf(currentName, startIdx);

}
return new Position(lineIdx, nameIdx);
}

/**
* Verifies that the diagnostic is pointing at the exact node as the same line
* is not enough.
* Example: "part a : type; part b : type;"
*/
private static boolean isContainedInPosition(ASTPartUsage node,
int diagnosticLine,
int diagnosticColumn) {

int startLine = node.get_SourcePositionStart().getLine() - 1;
int endLine = node.get_SourcePositionEnd().getLine() - 1;

boolean containsPosition = false;
if (diagnosticLine >= startLine && diagnosticLine <= endLine) {
if (diagnosticLine == startLine) {
containsPosition = diagnosticColumn >=
node.get_SourcePositionStart().getColumn() - 1;
}
else if (diagnosticLine == endLine) {
containsPosition = diagnosticColumn <=
node.get_SourcePositionEnd().getColumn() - 1;
}
else {
containsPosition = true;
}
}
return containsPosition;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import de.mclsg.lsp.document_management.DocumentManager;
import de.monticore.lang.sysmlv2._ast.ASTSysMLModel;
import de.monticore.lang.sysmlv2._lsp.SysMLv2DocumentInformationFilter;
import de.se_rwth.commons.logging.Log;

public class SysMLv2LspCoCoRunner extends SysMLv2LspCoCoRunnerTOP {
public SysMLv2LspCoCoRunner(DocumentManager documentManager) {
Expand All @@ -15,13 +17,37 @@ public boolean needsSymbols() {

@Override
public void runAllCoCos(ASTSysMLModel ast){
tool.runDefaultCoCos(ast);
if(System.getenv("SYSML_DEFAULT_COCOS") == null) {
tool.runDefaultCoCos(ast);
}
// Runs additional (verification-specific) CoCos when variable is set.
// Defaults to not running them.
if(System.getenv("SYSML_ADDITIONAL_COCOS") != null) {
tool.runAdditionalCoCos(ast);
}
}

@Override
public void runCoCosForAllDocuments(){
documentManager.getAllDocumentInformation(new SysMLv2DocumentInformationFilter()).forEach(di -> {
Log.enableFailQuick(false);

if(di.ast != null){
Log.getFindings().clear();
try {
runAllCoCos((ASTSysMLModel) di.ast);
} finally {
di.findings.clear();
di.findings.addAll(Log.getFindings());
/*
* did-change message from Client triggers runAllCoCos. Each Error
* from those CoCos is logged in Findings and then added to
* DocumentInformation. These are then displayed to the User.
*/
}
}
});
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package de.monticore.lang;
component grammar SysMLExpressions
extends de.monticore.literals.MCCommonLiterals, // SignedLiteral
de.monticore.types.MCBasicTypes, // MCType
de.monticore.types.MCStructuralTypes,
de.monticore.expressions.CommonExpressions, // FieldAccessExpression
de.monticore.ocl.OCLExpressions, // ExistsExpression
de.monticore.ocl.SetExpressions, // UnionExpression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ component grammar SysMLImportsAndPackages extends SysMLBasis {
* Metadata is additional data that can be used to annotate
* the elements of a model.
*/
SysMLMetaDataDefinition implements SysMLElement =
symbol scope SysMLMetaDataDefinition implements SysMLType, SysMLElement =
Modifier UserDefinedKeyword* "metadata" "def"
SysMLIdentifier? Name SysMLCardinality? Specialization*
("{"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ component grammar SysMLParts extends SysMLBasis {
* Defaults to "delayed".
*/
SysMLCausality implements SysMLElement =
"timing" (["instant"] | ["delayed"]) ";" ;
"timing" timing:Name ";" ;

/*
* ##################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package de.monticore.lang.componentconnector;

import de.monticore.symbols.basicsymbols._symboltable.TypeSymbol;
import de.monticore.symbols.compsymbols._symboltable.Timing;

public class StreamTimingUtil {
public static String mapTimingToStreamType(Timing timing) {
switch (timing) {
case TIMED:
return "EventStream";
case TIMED_SYNC:
return "SyncStream";
case UNTIMED:
return "UntimedStream";
default:
throw new IllegalArgumentException("Unexpected value: " + timing);
}
}
}
Loading
Loading