From eb496cac282872a14446f57c2ef2ce7929da6296 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Thu, 23 Apr 2020 00:27:06 +0900 Subject: [PATCH 1/2] add document link --- docs/index.md | 17 +++++------- docs/type-checking.md | 1 + resources/META-INF/plugin.xml | 1 + .../pydantic/PydanticConfigPanel.form | 26 +++++++++++++++---- .../pydantic/PydanticConfigPanel.java | 11 +++++++- 5 files changed, 40 insertions(+), 16 deletions(-) diff --git a/docs/index.md b/docs/index.md index a9284276..9a7189e9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,16 +8,6 @@ [A JetBrains PyCharm plugin](https://plugins.jetbrains.com/plugin/12861-pydantic) for [`pydantic`](https://github.com/samuelcolvin/pydantic). -## Help -See [documentation](https://koxudaxi.github.io/pydantic-pycharm-plugin/) for more details. - -## Quick Installation -The plugin is in Jetbrains repository ([Pydantic Plugin Page](https://plugins.jetbrains.com/plugin/12861-pydantic)) - -You can install the stable version on PyCharm's `Marketplace` (Preference -> Plugins -> Marketplace) [Offical Document](https://www.jetbrains.com/help/idea/managing-plugins.html) - -![search plugin](search_plugin.png) - ## Example: ![type check1](typecheck1.png) @@ -34,6 +24,13 @@ You can install the stable version on PyCharm's `Marketplace` (Preference -> Plu * Support same features as `pydantic.BaseModel` * (After PyCharm 2020.1 and this plugin version 0.1.0, PyCharm treats `pydantic.dataclasses.dataclass` as third-party dataclass.) +## Quick Installation +The plugin is in Jetbrains repository ([Pydantic Plugin Page](https://plugins.jetbrains.com/plugin/12861-pydantic)) + +You can install the stable version on PyCharm's `Marketplace` (Preference -> Plugins -> Marketplace) [Offical Document](https://www.jetbrains.com/help/idea/managing-plugins.html) + +![search plugin](search_plugin.png) + ## Contribute We are waiting for your contributions to `pydantic-pycharm-plugin`. diff --git a/docs/type-checking.md b/docs/type-checking.md index 84e896af..3967cdf4 100644 --- a/docs/type-checking.md +++ b/docs/type-checking.md @@ -1,5 +1,6 @@ ### Inspection for type-checking **Experimental** + **In version 0.1.1, This feature is broken. Please use it in [0.1.2](https://github.com/koxudaxi/pydantic-pycharm-plugin/releases/tag/0.1.2) or later.** This plugin provides an inspection for type-checking, which is compatible with pydantic. diff --git a/resources/META-INF/plugin.xml b/resources/META-INF/plugin.xml index ca87d01e..188541c0 100644 --- a/resources/META-INF/plugin.xml +++ b/resources/META-INF/plugin.xml @@ -7,6 +7,7 @@

version 0.1.3

Features

diff --git a/src/com/koxudaxi/pydantic/PydanticConfigPanel.form b/src/com/koxudaxi/pydantic/PydanticConfigPanel.form index b3a76a72..9e744161 100644 --- a/src/com/koxudaxi/pydantic/PydanticConfigPanel.form +++ b/src/com/koxudaxi/pydantic/PydanticConfigPanel.form @@ -1,17 +1,19 @@
- + - + + + - + - + @@ -62,11 +64,25 @@ + + + + + + + + + + + + + + - + diff --git a/src/com/koxudaxi/pydantic/PydanticConfigPanel.java b/src/com/koxudaxi/pydantic/PydanticConfigPanel.java index b5afd514..b5368ae8 100644 --- a/src/com/koxudaxi/pydantic/PydanticConfigPanel.java +++ b/src/com/koxudaxi/pydantic/PydanticConfigPanel.java @@ -1,8 +1,10 @@ package com.koxudaxi.pydantic; +import com.intellij.ide.BrowserUtil; import com.intellij.openapi.project.Project; import javax.swing.*; +import javax.swing.event.HyperlinkEvent; public class PydanticConfigPanel { @@ -12,6 +14,13 @@ public class PydanticConfigPanel { this.initTypedCheckBox.setSelected(pydanticConfigService.getInitTyped()); this.warnUntypedFieldsCheckBox.setSelected(pydanticConfigService.getWarnUntypedFields()); + this.textPane1.setText("

" + + "See documentation for more details.

"); + this.textPane1.addHyperlinkListener(e -> { + if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { + BrowserUtil.browse(e.getURL()); + } + }); } private JPanel configPanel; @@ -19,6 +28,7 @@ public class PydanticConfigPanel { private JTextPane ifEnabledIncludeTheTextPane; private JCheckBox warnUntypedFieldsCheckBox; private JTextPane ifEnabledRaiseATextPane; + private JTextPane textPane1; public Boolean getInitTyped() { return initTypedCheckBox.isSelected(); @@ -31,5 +41,4 @@ public Boolean getWarnUntypedFields() { public JPanel getConfigPanel() { return configPanel; } - } From b6c8500fc104e8fe5f97c76d9ed4185ed9c04930 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Thu, 23 Apr 2020 00:33:08 +0900 Subject: [PATCH 2/2] change documents order --- docs/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/index.md b/docs/index.md index 9a7189e9..47e0c536 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,9 +8,6 @@ [A JetBrains PyCharm plugin](https://plugins.jetbrains.com/plugin/12861-pydantic) for [`pydantic`](https://github.com/samuelcolvin/pydantic). -## Example: -![type check1](typecheck1.png) - ## Features ### Implemented #### pydantic.BaseModel @@ -24,6 +21,9 @@ * Support same features as `pydantic.BaseModel` * (After PyCharm 2020.1 and this plugin version 0.1.0, PyCharm treats `pydantic.dataclasses.dataclass` as third-party dataclass.) +## Example: +![type check1](typecheck1.png) + ## Quick Installation The plugin is in Jetbrains repository ([Pydantic Plugin Page](https://plugins.jetbrains.com/plugin/12861-pydantic))