Skip to content

Commit

Permalink
change plugin id, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Dec 24, 2023
1 parent f03c804 commit 24061d0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## [Unreleased]

## [0.0.3-eap] - 2023-12-24
- Highlighting works for most D2 syntax.
- Fix element color provider (`logs.style.stroke: "#f4a261"`)

## [0.0.2-eap] - 2022-12-13

### Added
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# d2-intellij

![Build](https://github.com/DVDAndroid/d2-intellij/workflows/Build/badge.svg)
![Build](https://github.com/develar/d2-intellij-plugin/workflows/Build/badge.svg)
[![Version](https://img.shields.io/jetbrains/plugin/v/20630.svg)](https://plugins.jetbrains.com/plugin/20630)
[![Downloads](https://img.shields.io/jetbrains/plugin/d/20630.svg)](https://plugins.jetbrains.com/plugin/20630)

<!-- Plugin description -->
Basic language support for D2 for JetBrains IDEs.
Language support for D2 for JetBrains IDEs.
<!-- Plugin description end -->

## Installation

- Using IDE built-in plugin system:
- Using an IDE built-in plugin system:

<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>Marketplace</kbd> > <kbd>Search for "d2-intellij"</kbd> >
<kbd>Install Plugin</kbd>

- Manually:

Download the [latest release](https://github.com/DVDAndroid/d2-intellij/releases/latest) and install it manually using
Download the [latest release](https://github.com/develar/d2-intellij-plugin/releases/latest) and install it manually using
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install plugin from disk...</kbd>
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pluginGroup=com.dvd.intellij.d2
pluginName=d2-intellij
pluginRepositoryUrl=https://github.com/DVDAndroid/d2-intellij
pluginRepositoryUrl=https://github.com/develar/d2-intellij-plugin

pluginVersion=0.0.3-eap
pluginSinceBuild=223
pluginSinceBuild=232
pluginUntilBuild=241.*

platformType=IC
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dvd.intellij.d2.ide.editor
package org.jetbrains.plugins.d2.editor

import com.dvd.intellij.d2.ide.utils.ColorStyleValidator
import com.intellij.openapi.editor.ElementColorProvider
Expand All @@ -10,10 +10,9 @@ import org.jetbrains.plugins.d2.lang.D2ElementTypes
import org.jetbrains.plugins.d2.lang.D2Language
import java.awt.Color

class D2ColorProvider : ElementColorProvider {
private val Color.hex: String
get() = String.format("#%02x%02x%02x", red, green, blue)
private fun getHex(color: Color): String = String.format("#%02x%02x%02x", color.red, color.green, color.blue)

class D2ColorProvider : ElementColorProvider {
override fun getColorFrom(element: PsiElement): Color? {
if (element.elementType !in listOf(D2ElementTypes.ID, D2ElementTypes.STRING)) {
return null
Expand All @@ -35,7 +34,7 @@ class D2ColorProvider : ElementColorProvider {
val psiManager = PsiManager.getInstance(element.project)
val factory = PsiFileFactoryImpl(psiManager)
val newPsi = factory.createElementFromText(
"\"${color.hex}\"",
"\"${getHex(color)}\"",
D2Language,
D2ElementTypes.PROPERTY_VALUE,
element.context
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin>
<id>com.dvd.intellij.d2</id>
<id>org.jetbrains.plugins.d2</id>
<name>D2</name>
<vendor url="https://github.com/dvdandroid/d2-intellij">dvdandroid</vendor>
<vendor url="https://github.com/develar/d2-intellij-plugin">Vladimir Krivosheev</vendor>
<description>--replaced by plugin--</description>

<depends>com.intellij.modules.platform</depends>
Expand All @@ -24,7 +24,7 @@

<colorSettingsPage implementation="com.dvd.intellij.d2.ide.settings.D2ColorSettingsPage"/>

<colorProvider implementation="com.dvd.intellij.d2.ide.editor.D2ColorProvider"/>
<colorProvider implementation="org.jetbrains.plugins.d2.editor.D2ColorProvider"/>

<fileEditorProvider implementation="com.dvd.intellij.d2.ide.editor.D2FileEditorProvider"/>

Expand Down

0 comments on commit 24061d0

Please sign in to comment.