Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦境迷离
Scala Macro Tools
提交
2326d4b8
S
Scala Macro Tools
项目概览
梦境迷离
/
Scala Macro Tools
上一次同步 1 年多
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Scala Macro Tools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
2326d4b8
编写于
7月 10, 2021
作者:
梦境迷离
提交者:
GitHub
7月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small optimization (#58)
上级
d265f5bd
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
21 addition
and
26 deletion
+21
-26
build.sbt
build.sbt
+1
-1
intellij-plugin/build.sbt
intellij-plugin/build.sbt
+9
-9
intellij-plugin/src/main/scala/io/github/dreamylost/plugin/ScalaMacroProcessorProvider.scala
...ithub/dreamylost/plugin/ScalaMacroProcessorProvider.scala
+2
-2
intellij-plugin/src/main/scala/io/github/dreamylost/plugin/processor/clazz/LogProcessor.scala
...thub/dreamylost/plugin/processor/clazz/LogProcessor.scala
+9
-14
未找到文件。
build.sbt
浏览文件 @
2326d4b8
...
@@ -2,13 +2,13 @@ import sbt.Def
...
@@ -2,13 +2,13 @@ import sbt.Def
import
sbtrelease.ReleaseStateTransformations._
import
sbtrelease.ReleaseStateTransformations._
name
:=
"scala-macro-tools"
name
:=
"scala-macro-tools"
organization
:=
"io.github.jxnu-liguobin"
lazy
val
scala212
=
"2.12.14"
lazy
val
scala212
=
"2.12.14"
lazy
val
scala211
=
"2.11.12"
lazy
val
scala211
=
"2.11.12"
lazy
val
scala213
=
"2.13.6"
lazy
val
scala213
=
"2.13.6"
scalaVersion
:=
scala213
scalaVersion
:=
scala213
organization
:=
"io.github.jxnu-liguobin"
lazy
val
supportedScalaVersions
=
List
(
scala213
,
scala212
,
scala211
)
lazy
val
supportedScalaVersions
=
List
(
scala213
,
scala212
,
scala211
)
...
...
intellij-plugin/build.sbt
浏览文件 @
2326d4b8
import
org.jetbrains.sbtidea.Keys._
name
:=
"scala-macro-tools-intellij-plugin"
name
:=
"scala-macro-tools-intellij-plugin"
organization
:=
"io.github.jxnu-liguobin"
lazy
val
scala213
=
"2.13.6"
lazy
val
scala213
=
"2.13.6"
scalaVersion
:=
scala213
scalaVersion
:=
scala213
organization
:=
"io.github.jxnu-liguobin"
import
org.jetbrains.sbtidea.Keys._
lazy
val
`
intellij
-
plugin
`
=
(
project
in
file
(
"."
))
lazy
val
`
intellij
-
plugin
`
=
(
project
in
file
(
"."
))
.
enablePlugins
(
SbtIdeaPlugin
)
.
enablePlugins
(
SbtIdeaPlugin
)
.
settings
(
.
settings
(
version
:=
(
version
in
ThisBuild
).
value
,
version
:=
(
ThisBuild
/
version
).
value
,
scalaVersion
:=
scala213
,
scalaVersion
:=
scala213
,
ThisBuild
/
intellijPluginName
:=
"Scala-Macro-Tools"
,
ThisBuild
/
intellijPluginName
:=
"Scala-Macro-Tools"
,
ThisBuild
/
intellijBuild
:=
"211.7628.21"
,
// @see https://confluence.jetbrains.com/display/IDEADEV/IDEA+2021.1+latest+builds
ThisBuild
/
intellijBuild
:=
"211.7628.21"
,
// @see https://confluence.jetbrains.com/display/IDEADEV/IDEA+2021.1+latest+builds
ThisBuild
/
intellijPlatform
:=
IntelliJPlatform
.
IdeaCommunity
,
ThisBuild
/
intellijPlatform
:=
IntelliJPlatform
.
IdeaCommunity
,
Global
/
intellijAttachSources
:=
true
,
Global
/
intellijAttachSources
:=
true
,
Compile
/
javacOptions
++=
"--release"
::
"11"
::
Nil
,
Compile
/
javacOptions
++=
"--release"
::
"11"
::
Nil
,
// Global / scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-Xfatal-warnings"),
// Global / scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-Xfatal-warnings"),
intellijPlugins
++=
Seq
(
"com.intellij.java"
,
"com.intellij.java-i18n"
,
"org.intellij.scala"
).
map
(
_
.
toPlugin
),
intellijPlugins
++=
Seq
(
"com.intellij.java"
,
"com.intellij.java-i18n"
,
"org.intellij.scala"
).
map
(
_
.
toPlugin
),
libraryDependencies
++=
Seq
.
empty
,
libraryDependencies
++=
Seq
.
empty
,
unmanagedResourceDirectories
in
Compile
+=
baseDirectory
.
value
/
"src"
/
"main"
/
"resources"
,
Compile
/
unmanagedResourceDirectories
+=
baseDirectory
.
value
/
"src"
/
"main"
/
"resources"
,
unmanagedResourceDirectories
in
Test
+=
baseDirectory
.
value
/
"src"
/
"test"
/
"resources"
,
Test
/
unmanagedResourceDirectories
+=
baseDirectory
.
value
/
"src"
/
"test"
/
"resources"
,
patchPluginXml
:=
pluginXmlOptions
{
xml
=>
patchPluginXml
:=
pluginXmlOptions
{
xml
=>
xml
.
version
=
(
version
in
ThisBuild
).
value
xml
.
version
=
(
ThisBuild
/
version
).
value
xml
.
pluginDescription
=
IO
.
read
(
baseDirectory
.
value
/
"src"
/
"main"
/
"resources"
/
"patch"
/
"description.html"
)
xml
.
pluginDescription
=
IO
.
read
(
baseDirectory
.
value
/
"src"
/
"main"
/
"resources"
/
"patch"
/
"description.html"
)
xml
.
changeNotes
=
IO
.
read
(
baseDirectory
.
value
/
"src"
/
"main"
/
"resources"
/
"patch"
/
"change.html"
)
xml
.
changeNotes
=
IO
.
read
(
baseDirectory
.
value
/
"src"
/
"main"
/
"resources"
/
"patch"
/
"change.html"
)
},
},
...
...
intellij-plugin/src/main/scala/io/github/dreamylost/plugin/ScalaMacroProcessorProvider.scala
浏览文件 @
2326d4b8
intellij-plugin/src/main/scala/io/github/dreamylost/plugin/processor/clazz/LogProcessor.scala
浏览文件 @
2326d4b8
package
io.github.dreamylost.plugin.processor.clazz
package
io.github.dreamylost.plugin.processor.clazz
import
io.github.dreamylost.plugin.ScalaMacroNames
import
io.github.dreamylost.plugin.ScalaMacroNames
import
io.github.dreamylost.plugin.processor.
{
AbsProcessor
,
ProcessType
}
import
io.github.dreamylost.plugin.processor.ProcessType.ProcessType
import
io.github.dreamylost.plugin.processor.ProcessType.ProcessType
import
io.github.dreamylost.plugin.processor.
{
AbsProcessor
,
ProcessType
}
import
org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.
{
ScClass
,
ScObject
,
ScTypeDefinition
}
import
org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.
{
ScClass
,
ScObject
,
ScTypeDefinition
}
/**
/**
...
@@ -21,19 +21,14 @@ class LogProcessor extends AbsProcessor {
...
@@ -21,19 +21,14 @@ class LogProcessor extends AbsProcessor {
typ
match
{
typ
match
{
case
ProcessType
.
Field
=>
case
ProcessType
.
Field
=>
source
match
{
source
match
{
case
clazz
@
(
_:
ScClass
|
_
:
ScObject
)
=>
case
clazz
@(
_:
ScClass
|
_
:
ScObject
)
=>
clazz
.
annotations
(
ScalaMacroNames
.
LOG
).
lastOption
match
{
clazz
.
annotations
(
ScalaMacroNames
.
LOG
).
lastOption
.
fold
[
Seq
[
String
]](
Nil
)
{
an
=>
{
case
Some
(
an
)
=>
// annotation expr string
an
.
annotationExpr
.
getText
match
{
an
.
annotationExpr
.
getText
match
{
case
expr
if
expr
.
contains
(
"Slf4j"
)
=>
case
expr
if
expr
.
contains
(
"Slf4j"
)
=>
Seq
(
logExpr
(
"org.slf4j.Logger"
))
Seq
(
logExpr
(
"org.slf4j.Logger"
))
case
expr
if
expr
.
contains
(
"Log4j2"
)
=>
Seq
(
logExpr
(
"org.apache.logging.log4j.Logger"
))
case
expr
if
expr
.
contains
(
"Log4j2"
)
=>
case
_
=>
Seq
(
logExpr
())
Seq
(
logExpr
(
"org.apache.logging.log4j.Logger"
))
}
case
_
=>
Seq
(
logExpr
())
}
}
case
None
=>
Nil
}
}
case
_
=>
Nil
case
_
=>
Nil
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录