diff --git a/build.gradle.kts b/build.gradle.kts index f6bd71f9..b520409b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,9 +29,9 @@ version = pluginVersion plugins { java - id("org.jetbrains.intellij") version "0.4.8" - id("org.jetbrains.grammarkit") version "2019.1" - kotlin("jvm") version "1.3.30" + id("org.jetbrains.intellij") version "0.4.9" + id("org.jetbrains.grammarkit") version "2019.2" + kotlin("jvm") version "1.3.41" } fun fromToolbox(path: String) = file(path).listFiles().orEmpty().filter { it.isDirectory }.maxBy { @@ -60,7 +60,7 @@ allprojects { // pycharmPath?.absolutePath?.let { alternativeIdePath = it } // } // } - version = "2019.1" + version = "2019.2" setMarkdownDependency() } } @@ -93,13 +93,17 @@ sourceSets { } } -repositories { mavenCentral() } +repositories { + mavenCentral() + maven { setUrl("https://jitpack.io") } +} dependencies { compile(kotlin("stdlib-jdk8")) compile(group = "org.eclipse.mylyn.github", name = "org.eclipse.egit.github.core", version = "2.1.5") { exclude(module = "gson") } + compile(group = "com.github.ballerina-platform", name="lsp4intellij", version = "0.92.1") testCompile(kotlin(module = "test-junit")) testCompile(group = "junit", name = "junit", version = "4.12") } @@ -117,8 +121,8 @@ task("isCI") { } // Don't specify type explicitly. Will be incorrectly recognized -val parserRoot = Paths.get("org", "ice1000", "julia", "lang")!! -val lexerRoot = Paths.get("gen", "org", "ice1000", "julia", "lang")!! +val parserRoot = Paths.get("org", "ice1000", "julia", "lang") +val lexerRoot = Paths.get("gen", "org", "ice1000", "julia", "lang") fun path(more: Iterable<*>) = more.joinToString(File.separator) fun bnf(name: String) = Paths.get("grammar", "$name-grammar.bnf").toString() fun flex(name: String) = Paths.get("grammar", "$name-lexer.flex").toString() @@ -199,10 +203,10 @@ tasks.withType { tasks.withType { dependsOn(cleanGenerated) } fun setMarkdownDependency() { - repositories { - maven("https://dl.bintray.com/jetbrains/markdown/") - } - dependencies { - compile("org.jetbrains", "markdown", "0.1.31") - } + repositories { + maven("https://dl.bintray.com/jetbrains/markdown/") + } + dependencies { + compile("org.jetbrains", "markdown", "0.1.31") + } } diff --git a/res/META-INF/plugin.xml b/res/META-INF/plugin.xml index bb06faf4..a7adad3c 100644 --- a/res/META-INF/plugin.xml +++ b/res/META-INF/plugin.xml @@ -33,7 +33,9 @@ + @@ -54,12 +56,28 @@ + + + + + + + @@ -250,4 +268,9 @@ + + + org.wso2.lsp4intellij.IntellijLanguageClient + + diff --git a/res/META-INF/startlanguageserver.jl b/res/META-INF/startlanguageserver.jl new file mode 100644 index 00000000..8a08c519 --- /dev/null +++ b/res/META-INF/startlanguageserver.jl @@ -0,0 +1,7 @@ +using LanguageServer, Sockets, SymbolServer, Pkg + +const depot = Pkg.depots1() +server = LanguageServer.LanguageServerInstance(stdin, stdout, false, string(depot, ""/environments/v1.1"), depot, Dict()) +server.runlinter = true +server.debug_mode = true +run(server) \ No newline at end of file diff --git a/src/org/ice1000/julia/lang/execution/julia-run-config.kt b/src/org/ice1000/julia/lang/execution/julia-run-config.kt index 3fa5b14a..23c9790f 100644 --- a/src/org/ice1000/julia/lang/execution/julia-run-config.kt +++ b/src/org/ice1000/julia/lang/execution/julia-run-config.kt @@ -135,7 +135,7 @@ class JuliaRunConfigurationProducer : RunConfigurationProducer?): Boolean { + configuration: JuliaRunConfiguration, context: ConfigurationContext, ref: Ref): Boolean { val file = context.dataContext.getData(CommonDataKeys.VIRTUAL_FILE) if (file?.fileType != JuliaFileType) return false configuration.targetFile = file.path diff --git a/src/org/ice1000/julia/lang/module/julia-modules.kt b/src/org/ice1000/julia/lang/module/julia-modules.kt index 33457671..1c585eb7 100644 --- a/src/org/ice1000/julia/lang/module/julia-modules.kt +++ b/src/org/ice1000/julia/lang/module/julia-modules.kt @@ -14,6 +14,7 @@ import icons.JuliaIcons import org.ice1000.julia.lang.* import org.ice1000.julia.lang.action.errorNotification import org.ice1000.julia.lang.module.ui.JuliaSetupSdkWizardStepImpl +import javax.swing.JComponent class JuliaModuleBuilder : ModuleBuilder(), ModuleBuilderListener { init { @@ -78,6 +79,8 @@ class JuliaModuleType : ModuleType(JULIA_MODULE_ID) { * @author: zxj5470 * @date: 2018/1/29 */ + +/* class JuliaModuleConfigEditor : ModuleConfigurationEditorProvider { override fun createEditors(state: ModuleConfigurationState): Array { val module = state.rootModel?.module ?: return emptyArray() @@ -95,4 +98,4 @@ class JuliaCompileOutputEditor(state: ModuleConfigurationState) : ModuleElements override fun getDisplayName() = "Paths" override fun getHelpTopic() = editor.helpTopic } - +*/ \ No newline at end of file diff --git a/src/org/ice1000/julia/lang/preload/julia-preload.kt b/src/org/ice1000/julia/lang/preload/julia-preload.kt new file mode 100644 index 00000000..e368c3aa --- /dev/null +++ b/src/org/ice1000/julia/lang/preload/julia-preload.kt @@ -0,0 +1,14 @@ +package org.ice1000.julia.lang.preload + +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 + +class JuliaPreloadingActivity: PreloadingActivity() { + override fun preload(indicator: ProgressIndicator) { + indicator.isIndeterminate = true + IntellijLanguageClient.addServerDefinition( + RawCommandServerDefinition("jl", arrayOf("julia", "/home/quangio/IdeaProjects/julia-plugin-test/lsp.jl"))) + } +} \ No newline at end of file