fix(RustLangDoc): support rust package comment //! fixed #55
This commit is contained in:
@@ -2,8 +2,10 @@ package io.github.linwancen.plugin.show.lang;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import io.github.linwancen.plugin.show.bean.LineInfo;
|
||||
import io.github.linwancen.plugin.show.bean.SettingsInfo;
|
||||
import io.github.linwancen.plugin.show.lang.base.BaseLangDoc;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.rust.lang.RsLanguage;
|
||||
import org.rust.lang.core.psi.RsMethodCall;
|
||||
import org.rust.lang.core.psi.RsPath;
|
||||
@@ -25,4 +27,14 @@ public class RustLangDoc extends BaseLangDoc {
|
||||
public boolean show(@NotNull LineInfo info) {
|
||||
return info.appSettings.showLineEndCommentRustBase;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected <T extends SettingsInfo> String resolveDocPrint(@NotNull T info, @NotNull PsiElement resolve) {
|
||||
String s = super.resolveDocPrint(info, resolve);
|
||||
if (s != null && s.startsWith("!")) {
|
||||
return s.substring(1);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// file tree doc is any where not doc comment
|
||||
//! file tree doc is any where not doc comment
|
||||
|
||||
fn main() {
|
||||
my_fun()
|
||||
|
||||
Reference in New Issue
Block a user