Skip to content

Commit

Permalink
fix: fix java langauge error issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Jul 20, 2023
1 parent 2d2aa9b commit 9d2d4d5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
Expand Up @@ -8,7 +8,6 @@ import com.intellij.psi.PsiJavaFile
import com.intellij.testFramework.LightPlatformTestCase
import org.junit.Ignore

@Ignore
class JavaClassContextTest : LightPlatformTestCase() {
private val fileFactory: PsiFileFactory get() = PsiFileFactory.getInstance(project)

Expand Down
9 changes: 9 additions & 0 deletions idea/src/test/resources/META-INF/plugin.xml
@@ -0,0 +1,9 @@
<idea-plugin package="cc.unitmesh" xmlns:xi="http://www.w3.org/2001/XInclude">
<id>org.rust.lang</id>
<xi:include href="/META-INF/autodev-core.xml" xpointer="xpointer(/idea-plugin/*)"/>

<!--suppress PluginXmlValidity -->
<content>
<module name="cc.unitmesh.idea"/>
</content>
</idea-plugin>
Expand Up @@ -16,6 +16,9 @@ class PythonContextTest : LightPlatformTestCase() {
self.name = name
self.age = age
def myfunc(self):
print("Hello my name is " + self.name)
p1 = Person("John", 36)
print(p1.name)
Expand All @@ -24,6 +27,7 @@ print(p1.age) """
fun testShould_convert_class_to_string() {
val psiFile = fileFactory.createFileFromText(PythonLanguage.INSTANCE, classCode)
val psiElement = (psiFile as PyFile).topLevelClasses[0]
psiElement.methods.forEach { println(it.name) }
val classContext: ClassContext = ClassContextProvider(false).from(psiElement)

assertEquals(classContext.toQuery(), """class name: _
Expand Down
9 changes: 9 additions & 0 deletions pycharm/src/test/resources/META-INF/plugin.xml
@@ -0,0 +1,9 @@
<idea-plugin package="cc.unitmesh" xmlns:xi="http://www.w3.org/2001/XInclude">
<id>org.rust.lang</id>
<xi:include href="/META-INF/autodev-core.xml" xpointer="xpointer(/idea-plugin/*)"/>

<!--suppress PluginXmlValidity -->
<content>
<module name="cc.unitmesh.pycharm"/>
</content>
</idea-plugin>

0 comments on commit 9d2d4d5

Please sign in to comment.