Deprecation
You can find deprecated code through Main menu → Migration → Deprecated Code. Many found instances in the MPS codebase are deprecated for many years. They could get unsupported or removed in any new MPS version, so make sure to find a replacement for such code early.
SRepository¶
SRepositories store modules and needs to be referenced directly when you don't want to use the deprecated concepts. The automatically used global repository that was used in earlier MPS versions is deprecated and might be unsupported in the future.
- Don't use commands from the access language without a repository (see: access language ⧉).
- Don't use node/myNode. Use node-ptr ⧉(myNode).resolve(repository) instead.
- Don't use model/myModel. Use model-ptr ⧉(myModel).resolve(repository) instead.
- Don't use module/myModule or language-module. Use module-reference/myModule ⧉ instead.
Other deprecation¶
This section lists some other common deprecated code.
- Don't use linkNode/concept:link/. Use link:concept:link/ ⧉ instead.
- Don't use conceptNode/concept/. Use concept/concept/ ⧉ instead.
- Don't use node.delete. Use node.detach ⧉ instead.
- Don't use node.containingRole. Use node.getContainmentLink ⧉ instead.
- Don't use the interface IDon'tSubstituteByDefault ⧉. Create an empty default substitute menu for the concept instead.
- Don't use print,
System.out
orSystem.err
for logging. Use log for low-level logging or message ⧉ for high-level logging instead. - Use the explicit presentation of a node when used in a string. For example:
"my node: " + node.getPresentation()
instead of"my node: " + node
. - Don't use counter variables in LoopMacro. Use
LOOP index
in the code instead. - Don't use IOperationContext ⧉. You can find more info in the attached comment on the interface.