Compare commits
4 Commits
position-a
...
d6dd414aba
Author | SHA1 | Date | |
---|---|---|---|
|
d6dd414aba | ||
|
2b6fc2fc91 | ||
|
762b86be85 | ||
|
38166cf6f2 |
2
Clients/Intellij/.idea/misc.xml
generated
2
Clients/Intellij/.idea/misc.xml
generated
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_23" default="true" project-jdk-name="openjdk-23" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="openjdk-23" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@@ -1,28 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id 'java'
|
|
||||||
id 'org.jetbrains.intellij.platform' version '2.2.1'
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
group = 'org.example'
|
|
||||||
version = '1.0-SNAPSHOT'
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
maven { url "https://jitpack.io" }
|
|
||||||
|
|
||||||
intellijPlatform {
|
|
||||||
defaultRepositories()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
testImplementation platform('org.junit:junit-bom:5.10.0')
|
|
||||||
testImplementation 'org.junit.jupiter:junit-jupiter'
|
|
||||||
implementation "com.github.Ballerina-Platform.lsp4intellij:lsp4intellij:master-SNAPSHOT"
|
|
||||||
}
|
|
||||||
|
|
||||||
test {
|
|
||||||
useJUnitPlatform()
|
|
||||||
}
|
|
41
Clients/Intellij/build.gradle.kts
Normal file
41
Clients/Intellij/build.gradle.kts
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
plugins {
|
||||||
|
id("org.jetbrains.intellij") version "1.17.3"
|
||||||
|
kotlin("jvm") version "1.9.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "com.example"
|
||||||
|
version = "1.0.0"
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven { url = uri("https://jitpack.io") }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(kotlin("stdlib"))
|
||||||
|
implementation("com.github.ballerina-platform:lsp4intellij:0.9.0")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "17"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
intellij {
|
||||||
|
version.set("2023.3")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
patchPluginXml {
|
||||||
|
sinceBuild.set("233")
|
||||||
|
untilBuild.set("233.*")
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,14 @@
|
|||||||
|
package kotlin.com.example.lsp;
|
||||||
|
|
||||||
|
import com.intellij.openapi.application.PreloadingActivity;
|
||||||
|
import com.intellij.openapi.progress.ProgressIndicator;
|
||||||
|
import org.wso2.lsp4intellij.IntellijLanguageClient;
|
||||||
|
import org.wso2.lsp4intellij.client.languageserver.serverdefinition.RawCommandServerDefinition;
|
||||||
|
|
||||||
|
public class PreloadActivityTX extends PreloadingActivity {
|
||||||
|
@Override
|
||||||
|
public void preload(ProgressIndicator indicator) {
|
||||||
|
String[] command = new String[]{"java", "-jar", "/JavaTXLanguageServer-1.0-SNAPSHOT-jar-with-dependencies.jar"};
|
||||||
|
IntellijLanguageClient.addServerDefinition(new RawCommandServerDefinition("jav", command));
|
||||||
|
}
|
||||||
|
}
|
@@ -13,7 +13,7 @@ see also jetbrains documentation: https://plugins.jetbrains.com/docs/intellij/pl
|
|||||||
|
|
||||||
<extensions defaultExtensionNs="com.intellij">
|
<extensions defaultExtensionNs="com.intellij">
|
||||||
<!-- register a preloading activity. You need to init IntellijLanguageClient with your config, see readme -->
|
<!-- register a preloading activity. You need to init IntellijLanguageClient with your config, see readme -->
|
||||||
<preloadingActivity implementation="your.plugin.MyPreloadingActivity" id="your.plugin.MyPreloadingActivity"/>
|
<preloadingActivity implementation="kotlin.com.example.lsp.PreloadActivityTX" id="kotlin.com.example.lsp.PreloadActivityTX"/>
|
||||||
|
|
||||||
<!-- register intellijLanguageClient as a Service OR as a plugin component (see readme)... -->
|
<!-- register intellijLanguageClient as a Service OR as a plugin component (see readme)... -->
|
||||||
<applicationService serviceImplementation="org.wso2.lsp4intellij.IntellijLanguageClient"/>
|
<applicationService serviceImplementation="org.wso2.lsp4intellij.IntellijLanguageClient"/>
|
||||||
|
@@ -225,6 +225,17 @@ public class TypeResolver {
|
|||||||
|
|
||||||
ArrayList<LSPVariable> methodsWithParametersLSPVariableList = new ArrayList<>();
|
ArrayList<LSPVariable> methodsWithParametersLSPVariableList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (var constructor : transferObj.getAst().KlassenVektor.getFirst().getConstructors()) {
|
||||||
|
for (var constructorParam : constructor.getParameterList().getFormalparalist()) {
|
||||||
|
var types = getAvailableTypes(transferObj.getResultSets(), constructorParam.getType());
|
||||||
|
methodsWithParametersLSPVariableList.add(new LSPParameter("", types, constructorParam.getOffset().getLine(), constructorParam.getOffset().getCharPositionInLine(), constructorParam.getOffset().getStopIndex(), constructorParam.getType()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var fieldDecl : transferObj.getAst().KlassenVektor.getFirst().getFieldDecl()) {
|
||||||
|
var types = getAvailableTypes(transferObj.getResultSets(), fieldDecl.getReturnType());
|
||||||
|
methodsWithParametersLSPVariableList.add(new LSPParameter("", types, fieldDecl.getOffset().getLine(), fieldDecl.getOffset().getCharPositionInLine(), fieldDecl.getOffset().getStopIndex(), fieldDecl.getReturnType()));
|
||||||
|
}
|
||||||
|
|
||||||
if (!transferObj.getResultSets().isEmpty()) {
|
if (!transferObj.getResultSets().isEmpty()) {
|
||||||
//TODO: Hier noch irgendwie die Klasse rausfinden oder durchgehen.
|
//TODO: Hier noch irgendwie die Klasse rausfinden oder durchgehen.
|
||||||
|
Reference in New Issue
Block a user