Skip to content

Instantly share code, notes, and snippets.

Created July 14, 2023 13:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
ex) IntelliJ LSP Plugin for Terraform
package com.example.demo1
import com.intellij.execution.configurations.GeneralCommandLine
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.platform.lsp.api.*
class FooLspServerSupportProvider : LspServerSupportProvider {
override fun fileOpened(
project: Project,
file: VirtualFile,
serverStarter: LspServerSupportProvider.LspServerStarter
) {
if (file.extension == "tf") {
private class FooLspServerDescriptor(project: Project) : ProjectWideLspServerDescriptor(project, "Foo") {
override val lspGoToDefinitionSupport = false
override fun isSupportedFile(file: VirtualFile) = file.extension == "tf"
override fun createCommandLine(): GeneralCommandLine {
val commandLine = GeneralCommandLine()
return commandLine
override fun getLanguageId(file: VirtualFile): String {
return "terraform"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment