Skip to content

Commit 7a4cb7c

Browse files
Copilotdevkanro
andauthored
Avoid bundled-plugin collisions with distinct Protocol Buffers language IDs (#297)
* WIP: migrate protobuf language registrations and preserve file type names Co-authored-by: devkanro <9367842+devkanro@users.noreply.github.com> * Document safe language ID upgrades and test settings preservation Co-authored-by: devkanro <9367842+devkanro@users.noreply.github.com> * Use supported code style option in migration regression tests Co-authored-by: devkanro <9367842+devkanro@users.noreply.github.com> * chore: bump plugin patch version to 2.6.1 Co-authored-by: devkanro <9367842+devkanro@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: devkanro <9367842+devkanro@users.noreply.github.com>
1 parent ef74fad commit 7a4cb7c

17 files changed

Lines changed: 326 additions & 47 deletions

‎.github/docmap.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
updated: 2026-03-09
2+
updated: 2026-09-11
33
---
44

55
# Documentation Map
@@ -8,14 +8,14 @@ updated: 2026-03-09
88

99
| File | Purpose | Related Code |
1010
|---|---|---|
11-
| README.md | Project overview, features, install, Copilot workflow | — |
11+
| README.md | Project overview, features, install, language ID migration, Copilot workflow | lang/ProtobufLanguage.kt, lang/ProtoTextLanguage.kt, lang/*FileType.kt |
1212
| CHANGELOG.md | Version history, release notes | All changes |
1313
| docs/README.md | Documentation index / navigation page | — |
1414
| docs/overview.md | What the plugin does, key concepts | — |
1515
| docs/architecture.md | High-level layer diagram, subsystem overview | All `src/main/kotlin/` |
1616
| docs/getting-started.md | Build, run, test guide | build.gradle.kts, gradle.properties, .github/workflows/ |
1717
| docs/contributing.md | Code style, adding features/modules, Copilot workflow | lang/, META-INF/ |
18-
| docs/extension-points.md | Custom extension point API docs | lang/root/, lang/psi/feature/, compile/ |
18+
| docs/extension-points.md | Language bindings and custom extension point API docs | lang/ProtobufLanguage.kt, lang/ProtoTextLanguage.kt, META-INF/, lang/root/, lang/psi/feature/, compile/ |
1919
| docs/design/psi-and-mixin.md | Why mixin pattern for PSI elements | lang/psi/, lang/psi/proto/mixin/, lang/psi/feature/ |
2020
| docs/design/symbol-resolution.md | Why two-phase resolve, scope hierarchy | lang/psi/proto/ProtobufSymbolResolver, lang/psi/proto/ProtobufScope, lang/root/ |
2121
| docs/design/stub-indexing.md | Why stubs, index design tradeoffs | lang/psi/stub/, lang/psi/stub/type/, lang/psi/stub/index/ |

‎CHANGELOG.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
## Unreleased
66

7+
### Changed
8+
9+
- Rename language IDs from `protobuf` to `protocol_buffers` and from `prototext` to
10+
`protocol_buffers_text` to avoid collisions with bundled languages ([#296](https://github.com/devkanro/intellij-protobuf-plugin/pull/296)).
11+
Update core, Java, Sisyphus, and HTTP Client language bindings without registering legacy aliases.
12+
- Preserve file type names, extensions, display names, settings storage, stub/index IDs, and color
13+
scheme keys. Language-ID-based settings and external integrations may require
14+
[manual migration](README.md#upgrading-from-the-old-language-ids); existing settings are not overwritten.
15+
Full coexistence with bundled Protocol Buffer and gRPC plugins remains unverified.
16+
717
## 1.7.50 - 2023-12-25
818

919
- Remove support for buf

‎README.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,29 @@ This plugin turns your JetBrains IDE into a protobuf-aware development environme
3232
2. Search for **"Protobuf"** by kanro
3333
3. Install and restart
3434

35+
### Upgrading from the old language IDs
36+
37+
The language IDs are now `protocol_buffers` (previously `protobuf`) and
38+
`protocol_buffers_text` (previously `prototext`). File type names, extensions, display names,
39+
plugin settings, and color scheme keys are unchanged. No aliases for the old language IDs are registered.
40+
41+
Language-specific code style settings and custom integrations that reference the old IDs may need
42+
manual migration. Back up your IDE and project settings first. For code style schemes, copy only
43+
the `codeStyleSettings` entry for the old language to the new language ID **if the destination is
44+
absent**; keep the original entry and never overwrite existing settings for the new ID.
45+
The separate `ProtobufCodeStyleSettings` entry does not need renaming.
46+
Update custom language injection targets, `@Language` annotations, and language injection comments
47+
that reference the old IDs only when they are intended for this plugin, not the bundled plugin.
48+
Live Template context IDs are separate from language IDs and are not renamed; review custom template
49+
applicability rather than replacing their context IDs. Third-party plugins must update their language
50+
bindings or lookups to the new IDs.
51+
52+
Migration is not automatic: the old IDs can also identify JetBrains' bundled languages, so their
53+
settings cannot safely be attributed to this plugin. Legacy code style entries are retained by the
54+
platform, but are not automatically applied to the new languages. Ordinary file associations retain their
55+
existing file type names. This change does **not** establish full coexistence with the bundled
56+
Protocol Buffer and gRPC plugins; the compatibility warning above still applies.
57+
3558
## 🔍 Feature Highlights
3659

3760
### Schema Intelligence

‎build.gradle.kts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ dependencies {
4141
implementation("com.bybutter.sisyphus:sisyphus-jackson-protobuf:2.1.22")
4242
implementation("io.grpc:grpc-netty:1.65.0")
4343

44+
testImplementation(libs.junit)
45+
4446
// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
4547
intellijPlatform {
4648
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion")) {

‎docs/extension-points.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
The plugin defines custom extension points that allow third-party plugins to extend its functionality. All extension points are dynamic (support runtime loading/unloading).
44

5+
## Language Bindings
6+
7+
Use the following IDs for IntelliJ language extension registrations and language lookups:
8+
9+
| Language | Language ID | File type name (unchanged) |
10+
|----------|-------------|----------------------------|
11+
| Protocol Buffers | `protocol_buffers` | `protobuf` |
12+
| Protocol Buffers text format | `protocol_buffers_text` | `prototext` |
13+
14+
The old language IDs `protobuf` and `prototext` are not aliases. Bindings using them may resolve
15+
to JetBrains' bundled languages instead of this plugin. Code using `ProtobufLanguage` or
16+
`ProtoTextLanguage` directly follows the new IDs without changing the class names.
17+
The plugin ID and custom extension point namespace remain `io.kanro.idea.plugin.protobuf`;
18+
stub external IDs and index keys also remain unchanged.
19+
See the [upgrade guidance](../README.md#upgrading-from-the-old-language-ids) for persisted settings.
20+
521
## rootProvider
622

723
**Interface**: `io.kanro.idea.plugin.protobuf.lang.root.ProtobufRootProvider`

‎gradle.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pluginName=IntelliJ Protobuf Language Plugin
44
pluginRepositoryUrl=https://github.com/devkanro/intellij-protobuf-plugin
55

66
# SemVer format -> https://semver.org
7-
pluginVersion=2.6.0
7+
pluginVersion=2.6.1
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
pluginSinceBuild=262

‎src/main/kotlin/io/kanro/idea/plugin/protobuf/lang/ProtoTextFileType.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ProtoTextFileType : LanguageFileType(ProtoTextLanguage) {
1616
}
1717

1818
override fun getName(): String {
19-
return ProtoTextLanguage.id
19+
return "prototext"
2020
}
2121

2222
override fun getDescription(): String {

‎src/main/kotlin/io/kanro/idea/plugin/protobuf/lang/ProtoTextLanguage.kt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ package io.kanro.idea.plugin.protobuf.lang
22

33
import com.intellij.lang.Language
44

5-
object ProtoTextLanguage : Language("prototext")
5+
object ProtoTextLanguage : Language("protocol_buffers_text") {
6+
override fun getDisplayName(): String = "prototext"
7+
}

‎src/main/kotlin/io/kanro/idea/plugin/protobuf/lang/ProtobufFileType.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ProtobufFileType : LanguageFileType(ProtobufLanguage) {
1616
}
1717

1818
override fun getName(): String {
19-
return ProtobufLanguage.id
19+
return "protobuf"
2020
}
2121

2222
override fun getDescription(): String {

‎src/main/kotlin/io/kanro/idea/plugin/protobuf/lang/ProtobufLanguage.kt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ package io.kanro.idea.plugin.protobuf.lang
22

33
import com.intellij.lang.Language
44

5-
object ProtobufLanguage : Language("protobuf")
5+
object ProtobufLanguage : Language("protocol_buffers") {
6+
override fun getDisplayName(): String = "protobuf"
7+
}

0 commit comments

Comments
 (0)