You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+99Lines changed: 99 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,97 @@ To use the Context Mapper IntelliJ plugin you need the following tools (besides
14
14
*[Oracle Java](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) or [OpenJDK](https://openjdk.java.net/) (JRE 11 or newer)
15
15
*[Node.js](https://nodejs.org/en/download) (v22)
16
16
* Maybe you want to install a [PlantUML extension](https://plugins.jetbrains.com/plugin/7017-plantuml-integration) for the generated PlantUML diagrams.
17
+
*[Graphviz](https://graphviz.org/) if you want to render generated PlantUML diagrams in IntelliJ.
17
18
* LSP4IJ IntelliJ plugin (will be installed automatically when installing our plugin)
18
19
19
20
<!-- Plugin description end -->
20
21
22
+
## Getting Started
23
+
This plugin provides Context Mapper DSL support in IntelliJ. It recognizes `.cml` files, starts the bundled Context Mapper language server through LSP4IJ, provides semantic highlighting, and can ask the language server to generate PlantUML `.puml` diagrams.
24
+
25
+
### 1. Install the IntelliJ plugins
26
+
Install the Context Mapper plugin ZIP in IntelliJ:
27
+
28
+
1. Open **Settings > Plugins**.
29
+
2. Click the gear icon and choose **Install Plugin from Disk...**.
30
+
3. Select the built plugin ZIP from `build/distributions/context-mapper-intellij-plugin.zip`.
31
+
4. Restart IntelliJ when prompted.
32
+
33
+
The Context Mapper plugin depends on LSP4IJ. IntelliJ should install LSP4IJ automatically with this plugin. If syntax highlighting or generation does not work, check that both plugins are enabled under **Settings > Plugins**.
34
+
35
+
### 2. Install local tools
36
+
The Context Mapper language server is a Node.js process. Make sure `node` is installed and visible to IntelliJ:
37
+
38
+
```bash
39
+
node --version
40
+
which node
41
+
```
42
+
43
+
On macOS with Homebrew, Node is commonly installed under `/opt/homebrew/bin/node`. If IntelliJ was launched from Finder and cannot find Node, restart IntelliJ after installing Node or set the `CONTEXT_MAPPER_NODE` environment variable to the full Node executable path before launching IntelliJ.
44
+
45
+
To preview generated PlantUML diagrams inside IntelliJ, install the PlantUML Integration plugin and Graphviz:
46
+
47
+
```bash
48
+
brew install graphviz
49
+
which dot
50
+
dot -V
51
+
```
52
+
53
+
Then configure the PlantUML plugin's Graphviz/Dot executable path to the result of `which dot`, for example `/opt/homebrew/bin/dot`. A common broken default is `/opt/local/bin/dot`, which is a MacPorts path and may not exist on Homebrew-based systems.
54
+
55
+
### 3. Create a simple CML file
56
+
Create a file such as `architecture/context-maps/example.cml`:
57
+
58
+
```cml
59
+
ContextMap ExampleMap {
60
+
contains OrderingContext
61
+
contains BillingContext
62
+
63
+
OrderingContext [SK]<->[SK] BillingContext
64
+
}
65
+
66
+
BoundedContext OrderingContext {
67
+
type = APPLICATION
68
+
domainVisionStatement = "Handles customer order placement."
69
+
}
70
+
71
+
BoundedContext BillingContext {
72
+
type = APPLICATION
73
+
domainVisionStatement = "Handles invoicing and payment workflows."
74
+
}
75
+
```
76
+
77
+
Syntax highlighting should appear after the file opens. If the file icon appears but keywords are not colored, the file type is registered but the language server may not be running.
You can also search for the action with **Cmd+Shift+A** and run **Generate PlantUML Diagrams**.
86
+
87
+
The generated file is written to:
88
+
89
+
```text
90
+
<project-root>/src-gen/<source-file-name>.puml
91
+
```
92
+
93
+
For example:
94
+
95
+
```text
96
+
src-gen/example.puml
97
+
```
98
+
99
+
Open that `.puml` file to preview it with the PlantUML plugin.
100
+
101
+
### Troubleshooting
102
+
If `.cml` files have the Context Mapper icon but no syntax highlighting, verify that LSP4IJ is enabled and that IntelliJ can start Node. Search the IntelliJ log for `cml-language-server`, `contextmapper`, `LSP4IJ`, or `node`.
103
+
104
+
If generation reports that no PlantUML diagrams were created, make sure the `.cml` file contains a `ContextMap`. Standalone `BoundedContext` declarations are valid CML, but the current generator creates a component diagram from the first `ContextMap` in the file.
105
+
106
+
If the PlantUML preview shows `Cannot find Graphviz`, the generated `.puml` file is usually fine. Configure the PlantUML plugin's Dot executable to the path returned by `which dot`.
107
+
21
108
## Build and/or Run Extension Locally
22
109
This project uses [Gradle](https://gradle.org/) to build the IntelliJ plugin.
23
110
@@ -41,6 +128,18 @@ After cloning this repository, you can build the project with the following comm
41
128
./gradlew clean buildPlugin
42
129
```
43
130
131
+
Before installing a built plugin ZIP into a newer IntelliJ IDEA version, verify plugin compatibility:
132
+
133
+
```bash
134
+
./gradlew verifyPlugin
135
+
```
136
+
137
+
The verifier target defaults to IntelliJ IDEA Ultimate 2026.1.3. Override it when needed:
0 commit comments