File tree Expand file tree Collapse file tree 5 files changed +48
-2
lines changed
kotlin/irony/ide/plugin/qsseditor Expand file tree Collapse file tree 5 files changed +48
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ dependencies {
2626// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
2727intellij {
2828 version.set(" 2021.3" )
29- type.set(" PC " ) // Target IDE Platform
29+ type.set(" PY " ) // Target IDE Platform
3030
3131 plugins.set(listOf ())
3232}
Original file line number Diff line number Diff line change @@ -117,7 +117,10 @@ class QSSClient : WebSocketListener() {
117117 }
118118 }
119119
120- Companion .host = host
120+ Companion .host =
121+ host.ifEmpty {
122+ " localhost"
123+ }
121124 Companion .port = port
122125
123126 disconnect()
Original file line number Diff line number Diff line change 1+ package irony.ide.plugin.qsseditor
2+
3+ import com.intellij.codeInsight.completion.*
4+ import com.intellij.openapi.diagnostic.logger
5+ import com.intellij.patterns.PlatformPatterns.psiElement
6+ import com.intellij.util.ProcessingContext
7+
8+ private val Log = logger<QSSCompletion >()
9+
10+ class QSSCompletion : CompletionContributor () {
11+ init {
12+ extend(
13+ CompletionType .BASIC ,
14+ psiElement().withName(" Q" ),
15+ object : CompletionProvider <CompletionParameters >() {
16+ override fun addCompletions (
17+ parameters : CompletionParameters ,
18+ context : ProcessingContext ,
19+ result : CompletionResultSet ,
20+ ) {
21+ }
22+ },
23+ )
24+ }
25+ }
Original file line number Diff line number Diff line change @@ -43,4 +43,19 @@ class QSSConfig :
4343 }
4444 }
4545 }
46+
47+ override fun apply () {
48+ super .apply ()
49+ QSSClient .connect(QSSState .instance::host.get(), QSSState .instance::port.get())
50+ }
51+
52+ override fun reset () {
53+ super .reset()
54+ QSSClient .connect(QSSState .instance::host.get(), QSSState .instance::port.get())
55+ }
56+
57+ override fun enableSearch (option : String? ): Runnable ? {
58+ return super .enableSearch(option)
59+ // TODO: 搜索配置界面定位
60+ }
4661}
Original file line number Diff line number Diff line change @@ -72,6 +72,9 @@ Must Install Proxy Server from first(首先需要安装设计师插件)<br/><br/
7272 instance =" irony.ide.plugin.qsseditor.QSSConfig"
7373 id =" irony.ide.plugin.qsseditor.QSSConfig"
7474 displayName =" QSS Editor" />
75+ <completion .contributor
76+ language =" any"
77+ implementationClass =" irony.ide.plugin.qsseditor.QSSCompletion" />
7578 <editorFactoryDocumentListener
7679 implementation =" irony.ide.plugin.qsseditor.QSSListener" />
7780 </extensions >
You can’t perform that action at this time.
0 commit comments