File tree 7 files changed +68
-1
lines changed
plugin/src/main/resources/META-INF
7 files changed +68
-1
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,8 @@ project(":plugin") {
171
171
project(" :intellij-toml" ),
172
172
" IntelliLang" ,
173
173
graziePlugin,
174
- psiViewerPlugin
174
+ psiViewerPlugin,
175
+ " JavaScriptLanguage"
175
176
)
176
177
if (baseIDE == " idea" ) {
177
178
plugins + = listOf (
@@ -194,6 +195,7 @@ project(":plugin") {
194
195
implementation(project(" :intelliLang" ))
195
196
implementation(project(" :duplicates" ))
196
197
implementation(project(" :grazie" ))
198
+ implementation(project(" :js" ))
197
199
}
198
200
199
201
tasks {
@@ -314,6 +316,7 @@ project(":idea") {
314
316
project(" :clion" ) {
315
317
intellij {
316
318
version = clionVersion
319
+ setPlugins(" JavaScriptLanguage" )
317
320
}
318
321
dependencies {
319
322
implementation(project(" :" ))
@@ -407,6 +410,19 @@ project(":grazie") {
407
410
}
408
411
}
409
412
413
+ project(" :js" ) {
414
+ intellij {
415
+ version = ideaVersion
416
+ setPlugins(" JavaScriptLanguage" )
417
+ }
418
+ dependencies {
419
+ implementation(project(" :" ))
420
+ implementation(project(" :common" ))
421
+ testImplementation(project(" :" , " testOutput" ))
422
+ testImplementation(project(" :common" , " testOutput" ))
423
+ }
424
+ }
425
+
410
426
project(" :intellij-toml" ) {
411
427
version = " 0.2.$patchVersion .${prop(" buildNumber" )}$versionSuffix "
412
428
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Use of this source code is governed by the MIT license that can be
3
+ * found in the LICENSE file.
4
+ */
5
+
6
+ package org.rust.js
7
+
8
+ import com.intellij.patterns.PlatformPatterns
9
+ import com.intellij.psi.*
10
+ import com.intellij.util.ProcessingContext
11
+ import org.rust.lang.core.psi.RsElementTypes
12
+
13
+ class MyReferenceContributor : PsiReferenceContributor () {
14
+ override fun registerReferenceProviders (registrar : PsiReferenceRegistrar ) {
15
+ registrar.registerReferenceProvider(
16
+ PlatformPatterns .psiElement(RsElementTypes .IDENTIFIER ),
17
+ MyReferenceProvider ()
18
+ )
19
+ }
20
+ }
21
+
22
+ class MyReferenceProvider : PsiReferenceProvider () {
23
+ override fun getReferencesByElement (element : PsiElement , context : ProcessingContext ): Array <PsiReference > {
24
+ return emptyArray()
25
+ }
26
+ }
Original file line number Diff line number Diff line change
1
+ <idea-plugin >
2
+ <extensions defaultExtensionNs =" com.intellij" >
3
+ <psi .referenceContributor language =" JSON" implementation =" org.rust.js.MyReferenceContributor" />
4
+ </extensions >
5
+ </idea-plugin >
6
+
7
+
8
+
9
+
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Use of this source code is governed by the MIT license that can be
3
+ * found in the LICENSE file.
4
+ */
5
+
6
+ package org.rust.js
7
+
8
+ class MyReferenceContributorTest {
9
+ }
Original file line number Diff line number Diff line change
1
+ <idea-plugin xmlns : xi =" http://www.w3.org/2001/XInclude" allow-bundled-update =" true" >
2
+ <id >org.rust.js</id >
3
+ <xi : include href =" /META-INF/rust-core.xml" xpointer =" xpointer(/idea-plugin/*)" />
4
+ <depends optional =" true" config-file =" js-only.xml" >JavaScript</depends >
5
+ </idea-plugin >
Original file line number Diff line number Diff line change 27
27
<depends optional =" true" config-file =" duplicates-only.xml" >com.intellij.modules.duplicatesDetector</depends >
28
28
<depends optional =" true" config-file =" coverage-only.xml" >com.intellij.modules.coverage</depends >
29
29
<depends optional =" true" config-file =" grazie-only.xml" >tanvd.grazi</depends >
30
+ <depends optional =" true" config-file =" js-only.xml" >JavaScript</depends >
30
31
31
32
<extensions defaultExtensionNs =" com.intellij" >
32
33
<!-- although Rust module type is only created by IDEA, we need it in other IDEs as well
Original file line number Diff line number Diff line change @@ -12,5 +12,6 @@ include(
12
12
" intelliLang" ,
13
13
" duplicates" ,
14
14
" grazie" ,
15
+ " js" ,
15
16
" intellij-toml"
16
17
)
You can’t perform that action at this time.
0 commit comments