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
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+
## Project Overview
6
+
7
+
IntelliJ plugin providing language support for systemd unit files (.service, .mount, .timer, .socket, .path, .automount, .swap, .slice, .device, .target, .nspawn). Written in Kotlin and Java, using Grammar-Kit for parsing.
8
+
9
+
## Build Commands
10
+
11
+
```bash
12
+
./gradlew buildPlugin # Build plugin distribution zip
13
+
./gradlew test# Run all tests
14
+
./gradlew test --tests "net.sjrx.intellij.plugins.systemdunitfiles.lexer.UnitFileLexerTest"# Single test class
15
+
./gradlew runIde # Launch dev IDE with plugin loaded
16
+
./gradlew checkstyleMain # Run checkstyle (excludes generated code)
17
+
./gradlew generateLexerTask # Regenerate lexer from .flex grammar
18
+
./gradlew generateParserTask # Regenerate parser from .bnf grammar
19
+
./gradlew generateDataFromManPages # Parse systemd XML man pages → JSON semantic data
20
+
```
21
+
22
+
The metadata generation pipeline uses Docker: `docker compose --project-directory ./systemd-build up --build`
23
+
24
+
## Architecture
25
+
26
+
**Grammar & Parsing:** The lexer is defined in `src/main/resources/.../lexer/SystemdUnitFile.flex` (JFlex) and the parser grammar in `src/main/resources/.../grammar/SystemdUnitFile.bnf`. Generated code goes to `src/main/gen/`.
27
+
28
+
**Semantic Data Pipeline:** Docker builds systemd from source, extracts man pages (XML) and gperf files. A custom Groovy task in `buildSrc/` (`GenerateDataFromManPages.groovy`) transforms XML via XSLT into JSON data and HTML documentation stored under `src/main/resources/.../semanticdata/`.
29
+
30
+
**Plugin Feature Modules** (all under `src/main/kotlin/net/sjrx/intellij/plugins/systemdunitfiles/`):
31
+
-`semanticdata/` — Core data models, validators, option value parsers, documentation repository. This is the foundational layer other features depend on.
32
+
-`completion/` — Auto-completion contributors for keys, values, and sections
-`filetypes/` — File type definitions for each supported extension
37
+
-`lexer/` — Lexical analysis adapter
38
+
39
+
**Java source** (`src/main/java/`) contains syntax highlighting (`coloring/`), parser definition (`parser/`), and generated PSI elements (`psi/`).
40
+
41
+
## Testing
42
+
43
+
Tests use JUnit 4 with IntelliJ Platform Test Framework. Test sources are in `src/test/kotlin/` with fixtures in `src/test/resources/`. Tests mirror the main source structure.
44
+
45
+
## Conventions
46
+
47
+
- Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/) format
48
+
- Java 21 for compilation, targets IntelliJ 2024.2 (platform version 242)
49
+
- Plugin version range: 242.0–270.0
50
+
- Generated code in `src/main/gen/` — do not edit manually; regenerate with grammar-kit tasks
description ="Merge podman quadlet documentation JSON into the generated sectionToKeywordMapFromDoc.json"
225
+
group ="generation"
226
+
227
+
val semanticDataDir = file("${sourceSets["main"].output.resourcesDir?.getAbsolutePath()}/net/sjrx/intellij/plugins/systemdunitfiles/semanticdata")
228
+
val podmanJsonFile = file("./src/main/resources/net/sjrx/intellij/plugins/systemdunitfiles/semanticdata/podman/podman-sectionToKeywordMapFromDoc.json")
229
+
val targetJsonFile = file("${semanticDataDir}/sectionToKeywordMapFromDoc.json")
Copy file name to clipboardExpand all lines: src/main/kotlin/net/sjrx/intellij/plugins/systemdunitfiles/annotators/InvalidSectionHeaderNameAnnotator.kt
Copy file name to clipboardExpand all lines: src/main/kotlin/net/sjrx/intellij/plugins/systemdunitfiles/completion/UnitFileSectionCompletionContributor.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ class UnitFileSectionCompletionContributor() : CompletionContributor() {
0 commit comments