Lombok Sense
Language support for Project Lombok configuration files (lombok.config) in Visual Studio Code.
See CHANGELOG.md for release notes.
Features
- Effective Configuration Engine:
- Traverses directory hierarchy up to
config.stopBubbling = true.
- Command:
Lombok: Show Effective Configuration — opens a real-time Markdown report with resolved values, provenance trace, and status (Local, Inherited, Overridden).
- Command:
Lombok: Create Root lombok.config — quickly generates a standard root config file with recommended team defaults.
- Document Outline & Breadcrumbs:
- Full
DocumentSymbolProvider grouping properties by category (Accessors, Builder, Configuration, Logging...).
- Instant navigation via the Outline view and
Ctrl+Shift+O.
- Go-To-Definition (
F12):
- Press
F12 on lombok.copyableAnnotations to jump directly to the @interface Java file in the workspace.
- Press
F12 on an overridden key to jump directly to its declaration in the parent ../lombok.config.
- Inlay Hints:
- Inline indicators for property types (
boolean, list, enum).
- Source origin badges on copyable annotations (
[Workspace], [Qualifier]).
- Rich Hover Documentation with Java Code Previews:
- Official documentation, property types, defaults, and allowed values.
- Syntax-highlighted Before/After Java code snippets showing the exact methods generated by Lombok.
- Smart Autocompletion:
- Keys: Full coverage of Lombok configuration properties (Lombok 1.18.36+) and
.flagUsage targets (@Locked, @Jacksonized, etc.).
- Values: Contextual completion for booleans, strategy enums (
callSuper, flagUsage), loggers, and nullability providers (jspecify).
- Live Annotation Resolution: Indexes workspace
@interface declarations and annotation imports used in Java source, alongside built-in framework suggestions (Spring, Jackson, Jakarta, JPA, Micronaut, Quarkus, Swagger, JSpecify). Imported FQCNs are inferred from Java imports; dependency artifacts are not scanned directly.
- Directives: Suggests clearable list properties when typing
clear.
- Diagnostics & Linting:
- Unknown keys detection with Levenshtein-based typo suggestions.
- Duplicate scalar key detection warning when an assignment is overridden later in the file.
- Strict lowercase key casing validation.
- Value validation against expected types and permitted enum choices.
- Operator misuse check (
+= and -= restricted to list properties).
- Deprecated properties warnings with modern replacements.
- Best-practice ordering hint for
config.stopBubbling = true.
- Quick Fixes (Code Actions):
- One-click typo correction (
Did you mean...?).
- Remove duplicate overridden assignments.
- Convert uppercase/camelCase keys to lowercase.
- Replace invalid operators and remove invalid
clear directives.
- Move
config.stopBubbling to the top of the file.
- Document Formatting: Normalizes operator whitespace (
=, +=, -=), standardizes directives, and cleans comments.
Configuration
| Setting |
Type |
Default |
Description |
lombokSense.lint.unknownKeys |
string |
"warning" |
Severity for unknown configuration keys (warning, error, ignore). |
lombokSense.lint.deprecatedKeys |
string |
"warning" |
Severity for deprecated configuration keys. |
lombokSense.lint.invalidValues |
string |
"error" |
Severity for invalid or unallowed property values. |
lombokSense.lint.invalidOperators |
string |
"error" |
Severity when using += or -= on scalar properties. |
lombokSense.annotations.indexing.enabled |
boolean |
true |
Enables workspace Java annotation indexing for completions. |
lombokSense.annotations.indexing.maxFiles |
integer |
500 |
Maximum number of Java files scanned for workspace annotations. |
lombokSense.annotations.indexing.exclude |
string[] |
[] |
Additional workspace-relative glob patterns to exclude, such as **/generated/**. |
lombokSense.format.spaceAroundOperator |
boolean |
true |
Enforces a single space around operators (=, +=, -=). |
Supported Properties
Lombok Sense maintains a typed schema of the Lombok configuration specification:
- Accessors (
chain, fluent, prefix, capitalization, makeFinal)
- Builders (
className, singular.auto, singular.useGuava)
- Field Defaults (
defaultPrivate, defaultFinal)
- Class generation (
equalsAndHashCode.callSuper, toString.callSuper, includeFieldNames)
- Logging (
fieldName, fieldIsStatic, custom.declaration)
- Copyable annotations (
copyableAnnotations, accessors.prefix)
- Directives (
config.stopBubbling, clear <property>)
- Governance flags across all Lombok annotations (
lombok.<feature>.flagUsage)
Machine-readable schema
schemas/lombok-config.schema.json is generated from the same property definitions used by completion and diagnostics. It describes Lombok properties as a JSON object for external tooling and includes types, allowed values, defaults, and deprecation metadata. Since lombok.config is a line-based format rather than JSON, this schema does not directly validate lombok.config files. Run npm run generate-schema after changing the property definitions.
Development
# Install dependencies
npm install
# Run unit tests
npm run build-test
npm test
# Check types
npm run typecheck
# Build production bundle
npm run build-prod
License
MIT © Houssam OUATMANI
| |