Skip to content

Commit

Permalink
Merge pull request #41 from londonbrown/master
Browse files Browse the repository at this point in the history
Support 2022.2
  • Loading branch information
jobarr-amzn authored Dec 1, 2022
2 parents 0042c16 + dba3bfd commit d2bb757
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 12 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Github Action Workflow for building a new commit to the primary repo branch and publishing a new release to beta.
# GitHub Action Workflow for building a new commit to the primary repo branch and publishing a new release to beta.
#
# Workflow is triggered on pushes into master.
#
Expand Down Expand Up @@ -37,7 +36,7 @@ jobs:
strategy:
fail-fast: false
matrix:
product: [ "IC-2020.2", "IC-2021.1", "IC-2022.1" ]
product: [ "IC-2020.2", "IC-2021.1", "IC-2022.1", "IC-2022.2" ]
max-parallel: 5
env:
PRODUCT_NAME: ${{ matrix.product }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Github Action Workflow for building a pull request commit and validating that the commit builds for all
# GitHub Action Workflow for building a pull request commit and validating that the commit builds for all
# release versions of the plugin.
#
# Workflow is triggered on pull requests to the repo.
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
product: [ "IC-2020.2", "IC-2021.1", "IC-2022.1" ]
product: [ "IC-2020.2", "IC-2021.1", "IC-2022.1", "IC-2022.2" ]
max-parallel: 5
env:
PRODUCT_NAME: ${{ matrix.product }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-eap.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Github Action Workflow for releasing a new stable version of the plugin.
# GitHub Action Workflow for releasing a new stable version of the plugin.
#
# Workflow is triggered manually w/ proper access.
#
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Github Action Workflow for releasing a new stable version of the plugin.
# GitHub Action Workflow for releasing a new stable version of the plugin.
#
# Workflow is triggered manually w/ proper access.
#
Expand All @@ -18,7 +18,7 @@ jobs:
release:
strategy:
matrix:
product: [ "IC-2020.2", "IC-2021.1", "IC-2022.1" ]
product: [ "IC-2020.2", "IC-2021.1", "IC-2022.1", "IC-2022.2" ]
max-parallel: 1
env:
PRODUCT_NAME: ${{ matrix.product }}
Expand Down
15 changes: 13 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {

plugins {
kotlin("jvm")
id("org.jetbrains.intellij") version "1.5.2"
id("org.jetbrains.intellij") version "1.10.0"
}

repositories {
Expand Down Expand Up @@ -52,10 +52,21 @@ val plugins = listOf(
apiVersion = "1.5"
),
dependencies = listOf("java", "Kotlin")
),
PluginDescriptor(
since = "222",
until = "223.*",
sdkVersion = "IC-2022.2",
platformType = PlatformType.IdeaCommunity,
sourceFolder = "IC-222",
kotlin = KotlinOptions(
apiVersion = "1.6"
),
dependencies = listOf("java", "Kotlin")
)
)

val defaultProductName = "IC-2022.1"
val defaultProductName = "IC-2022.2"
val productName = System.getenv("PRODUCT_NAME") ?: defaultProductName
val maybeGithubRunNumber = System.getenv("GITHUB_RUN_NUMBER")?.toInt()
val descriptor = plugins.first { it.sdkVersion == productName }
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ repositories {
}

dependencies {
api(kotlin("gradle-plugin", version = "1.5.10"))
api(kotlin("gradle-plugin", version = "1.7.10"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.amazon.ion.plugin.intellij.formatting

import com.amazon.ion.plugin.intellij.formatting.blocks.IonBlockOptions
import com.amazon.ion.plugin.intellij.formatting.blocks.RootIonBlock
import com.intellij.formatting.FormattingContext
import com.intellij.formatting.FormattingModel
import com.intellij.formatting.FormattingModelBuilder
import com.intellij.formatting.FormattingModelProvider

/**
* Creates the block model for an Ion file.
*
* The block model will determine how elements are spaced, indented and aligned.
*/
class IonFormattingModelBuilder : FormattingModelBuilder {
override fun createModel(formattingContext: FormattingContext): FormattingModel {
val element = formattingContext.psiElement
val settings = formattingContext.codeStyleSettings

val rootBlock = RootIonBlock(
node = element.node,
options = IonBlockOptions(
spaceBuilder = IonCodeBlockSpacingProvider(settings),
codeStyle = settings
)
)


return FormattingModelProvider.createFormattingModelForPsiFile(
element.containingFile,
rootBlock, settings
)
}
}
Empty file added src/IC-222/resources/.gitkeep
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object IonSearchUtils {

return ionFiles.flatMap {
val ionFile = psiManager.findFile(it) as? IonFile ?: return emptyList()
PsiTreeUtil.getChildrenOfType(ionFile, IonSexpressionOperator::class.java).toList()
PsiTreeUtil.getChildrenOfType(ionFile, IonSexpressionOperator::class.java)?.toList() ?: emptyList()
}
}

Expand Down

0 comments on commit d2bb757

Please sign in to comment.