From 11eae9fa4d285c14146701abc5c35ac4b27ee3a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9E=97=E4=B8=87=E7=A8=8B?= <1498425439@qq.com>
Date: Tue, 20 Feb 2024 21:35:19 +0800
Subject: [PATCH] docs(CsLineEnd): About Rider C# getReference().resolve()
---
README.md | 4 ++--
build.gradle | 5 +----
src/main/resources/META-INF/plugin.xml | 4 ++--
.../linwancen/plugin/show/lang/CsLineEnd.java | 9 ++++++++-
.../github/linwancen/plugin/show/demo/Golang.go | 17 +++++++++++++----
5 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/README.md b/README.md
index 755e48b..cab1d6d 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ Thanks to JetBrains Licenses for Open Source.
## Notes 说明
-Show doc comment at the Project view Tree, line End, json, other
+Show doc comment in the Project view Tree, line End, json, other
在文件树、行末、JSON 等地方显示注释.
@@ -57,7 +57,7 @@ Show doc comment at the Project view Tree, line End, json, other
中文说明
- 在结构树显示 文件注释 或 项目说明 (README.md pom.xml 等,可设置)
-
- 在行末尾显示 引用对象的文档注释,欢迎反馈您想要支持的语言,目前 C# 有技术问题待官方解决
+
- 在行末尾显示 引用对象的文档注释,欢迎反馈您想要支持的语言,欢迎 C# 大神研究 CsLineEnd.java
- 目前支持 Java Kotlin JS/TS PHP Python Go Rust C SQL
- 输入 doc / docc 等生成 /** */
- json 字段注释从 xxx.json.tsv 读取
diff --git a/build.gradle b/build.gradle
index a79bef7..d234cee 100644
--- a/build.gradle
+++ b/build.gradle
@@ -33,9 +33,6 @@ intellij {
'Pythonid:201.6668.121',
'org.rust.lang:0.3.131.3366-201',
'org.toml.lang:0.2.131.3366-201',
- 'com.jetbrains.php:201.6668.153',
- // 'com.jetbrains.rust:232.9921.46',
- // 'Pythonid:212.5284.44',
]
if ('IC' == ideTypeStr || 'IU' == ideTypeStr) {
plugins.add('java')
@@ -47,7 +44,7 @@ intellij {
plugins.add('JavaScript')
plugins.add('com.intellij.database')
plugins.add('org.jetbrains.plugins.go:201.6668.60.126')
- // plugins.add('org.jetbrains.plugins.go:212.5284.31')
+ plugins.add('com.jetbrains.php:201.6668.153')
}
}
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
index a191739..d90ca5c 100644
--- a/src/main/resources/META-INF/plugin.xml
+++ b/src/main/resources/META-INF/plugin.xml
@@ -5,7 +5,7 @@
中文说明
- 在结构树显示 文件注释 或 项目说明 (README.md pom.xml 等,可设置)
-
- 在行末尾显示 引用对象的文档注释,欢迎反馈您想要支持的语言,目前 C# 有技术问题待官方解决
+
- 在行末尾显示 引用对象的文档注释,欢迎反馈您想要支持的语言,欢迎 C# 大神研究 CsLineEnd.java
- 目前支持 Java Kotlin JS/TS PHP Python Go Rust C SQL
- 输入 doc / docc 等生成 /** */
- json 字段注释从 xxx.json.tsv 读取
diff --git a/src/main/rider/io/github/linwancen/plugin/show/lang/CsLineEnd.java b/src/main/rider/io/github/linwancen/plugin/show/lang/CsLineEnd.java
index e887069..b5bbbf4 100644
--- a/src/main/rider/io/github/linwancen/plugin/show/lang/CsLineEnd.java
+++ b/src/main/rider/io/github/linwancen/plugin/show/lang/CsLineEnd.java
@@ -11,7 +11,14 @@ import java.util.List;
/**
* Doesn't work because I don't know how to get Reference for CSharp PsiElement
- *
https://intellij-support.jetbrains.com/hc/en-us/requests/4228491
+ *
https://intellij-support.jetbrains.com/hc/en-us/community/posts/16807048482450-How-to-get-CSharp-References-comment
+ *
Rider uses the ReSharper SDK (i.e., not the IntelliJ SDK) to parse C# syntax.
+ *
Therefore, expect to write C#/.NET to support your feature.
+ *
I think the inspections sample project could be helpful to get started with how things are working.
+ *
Since I expect you also want to use some of your existing infrastructure, you must send data between C# and Kotlin code.
+ *
For that, I recommend looking into the protocol sample project (check the README).
+ *
https://github.com/JetBrains/resharper-rider-plugin/tree/master/samples/CodeInspections
+ *
https://github.com/JetBrains/resharper-rider-plugin/tree/master/samples/RdProtocol
*/
public class CsLineEnd extends BaseLangDoc {
diff --git a/src/test/java/io/github/linwancen/plugin/show/demo/Golang.go b/src/test/java/io/github/linwancen/plugin/show/demo/Golang.go
index 9ddfda2..188fa56 100644
--- a/src/test/java/io/github/linwancen/plugin/show/demo/Golang.go
+++ b/src/test/java/io/github/linwancen/plugin/show/demo/Golang.go
@@ -3,10 +3,12 @@
// go package
package main
+import "fmt"
+
// doc
func main() {
- line(val)
- line(val1)
+ log(val)
+ log(val1)
line(value)
t := &Class{}
@@ -24,6 +26,13 @@ func main() {
line(multiLine(block(t)))
}
+/**
+ * log
+ */
+func log(s string) {
+ fmt.Print(s)
+}
+
// const
const val = ""
@@ -35,14 +44,14 @@ const (
// var
var value *Class
-// First Class
+// Class First
type Class struct {
// a
a *Class2
b *Class2 // b
}
-// Class2
+// Class2 2
type Class2 struct{}
// line