Skip to content

Commit

Permalink
Add initial contextive plugin classes and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissimon-au committed Mar 9, 2024
1 parent 56e48c0 commit bfd67a6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/intellij/contextive/.idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/intellij/contextive/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/intellij/contextive/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repositories {
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
version.set("2023.3.2")
type.set("IC") // Target IDE Platform
type.set("IU") // Target IDE Platform

plugins.set(listOf(/* Plugin Dependencies */))
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package tech.contextive.contextive

import com.intellij.execution.configurations.GeneralCommandLine
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.platform.lsp.api.LspServerSupportProvider
import com.intellij.platform.lsp.api.ProjectWideLspServerDescriptor

class ContextiveLspServerSupportProvider : LspServerSupportProvider {
override fun fileOpened(project: Project, file: VirtualFile, serverStarter: LspServerSupportProvider.LspServerStarter) {
serverStarter.ensureServerStarted(ContextiveLspServerDescriptor(project))
}
}
private class ContextiveLspServerDescriptor(project: Project) : ProjectWideLspServerDescriptor(project, "Contextive") {
override fun isSupportedFile(file: VirtualFile) = true
override fun createCommandLine(): GeneralCommandLine {
var cmd = GeneralCommandLine("Contextive.LanguageServer")
return cmd
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
<!-- Product and plugin compatibility requirements.
Read more: https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html -->
<depends>com.intellij.modules.platform</depends>
<depends>com.intellij.modules.ultimate</depends>

<!-- Extension points defined by the plugin.
Read more: https://plugins.jetbrains.com/docs/intellij/plugin-extension-points.html -->
<extensions defaultExtensionNs="com.intellij">

<platform.lsp.serverSupportProvider implementation="tech.contextive.contextive.ContextiveLspServerSupportProvider"/>
</extensions>
</idea-plugin>

0 comments on commit bfd67a6

Please sign in to comment.