From cda090bcb51b839ff3e903866a86f6b157f6bb91 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Thu, 23 Apr 2020 01:03:20 +0900 Subject: [PATCH] add document link (#107) * add document link * change documents order --- docs/index.md | 23 +++++++--------- docs/type-checking.md | 1 + resources/META-INF/plugin.xml | 1 + .../pydantic/PydanticConfigPanel.form | 26 +++++++++++++++---- .../pydantic/PydanticConfigPanel.java | 11 +++++++- 5 files changed, 43 insertions(+), 19 deletions(-) diff --git a/docs/index.md b/docs/index.md index a9284276..47e0c536 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,19 +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) - ## Features ### Implemented #### pydantic.BaseModel @@ -34,6 +21,16 @@ 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.) +## Example: +![type check1](typecheck1.png) + +## 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; } - }