Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Keep hand-written text files consistent across platforms.
* text=auto eol=lf

# Dependency locks are updated by their package managers.
*.lock -text -eol
pnpm-lock.yaml -text -eol
**/package-lock.json -text -eol

# Generated artifacts should preserve their generators' output.
.github/workflows/release_pypi.yml -text -eol
crates/tombi-ast/src/generated/** -text -eol
crates/tombi-syntax/src/generated/** -text -eol
editors/intellij/gradlew -text -eol
schemas/type-test.schema.json -text -eol
www.schemastore.org/cargo.json -text -eol
150 changes: 75 additions & 75 deletions .github/workflows/ci_intellij_plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: CI IntelliJ Plugin
name: CI IntelliJ Plugin

on:
push:
branches:
Expand All @@ -11,11 +11,11 @@ on:

permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
detect-changes:
runs-on: ubuntu-latest
Expand All @@ -41,9 +41,9 @@ jobs:
needs: detect-changes
if: needs.detect-changes.outputs.relevant == 'true'
runs-on: ubuntu-latest
steps:
- name: Fetch sources

steps:
- name: Fetch sources
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
Expand All @@ -58,32 +58,32 @@ jobs:
working-directory: ./editors/intellij
run: |
./gradlew buildPlugin
- name: Prepare plugin artifact
id: artifact
shell: bash
working-directory: ./editors/intellij
run: |
cd build/distributions
FILENAME=`ls *.zip`
unzip "$FILENAME" -d content
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
- name: Prepare plugin artifact
id: artifact
shell: bash
working-directory: ./editors/intellij
run: |
cd build/distributions
FILENAME=`ls *.zip`
unzip "$FILENAME" -d content

echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./editors/intellij/build/distributions/content/*/*
test-intellij-plugin:
needs: [build-intellij-plugin]
runs-on: ubuntu-latest

test-intellij-plugin:
needs: [build-intellij-plugin]
runs-on: ubuntu-latest

permissions:
contents: read
actions: write
steps:
- name: Fetch sources

steps:
- name: Fetch sources
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
Expand All @@ -108,19 +108,19 @@ jobs:
with:
name: tests-result
path: ${{ github.workspace }}/editors/intellij/build/reports/tests

inspect-intellij-plugin:
needs: detect-changes
if: needs.detect-changes.outputs.relevant == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
pull-requests: write
steps:
- name: Maximize build space

permissions:
contents: write
checks: write
pull-requests: write

steps:
- name: Maximize build space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: false
Expand All @@ -141,13 +141,13 @@ jobs:
with:
args: --project-dir,editors/intellij
cache-default-branch-only: true
verify-intellij-plugin:
needs: [build-intellij-plugin]
runs-on: ubuntu-latest
steps:
- name: Maximize build space

verify-intellij-plugin:
needs: [build-intellij-plugin]
runs-on: ubuntu-latest

steps:
- name: Maximize build space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: false
Expand All @@ -165,27 +165,27 @@ jobs:
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4
with:
cache-read-only: true
- name: Run verifier
continue-on-error: true
working-directory: ./editors/intellij
run: |
./gradlew verifyPlugin
- name: Run verifier
continue-on-error: true
working-directory: ./editors/intellij
run: |
./gradlew verifyPlugin
- name: Upload result
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: pluginVerifier-result
path: ${{ github.workspace }}/editors/intellij/build/reports/pluginVerifier
nightly-intellij-plugin:
if: github.event_name != 'pull_request'
needs: [build-intellij-plugin, test-intellij-plugin, verify-intellij-plugin]
runs-on: ubuntu-latest
environment: IntelliJ
continue-on-error: true
steps:
- name: Fetch sources

nightly-intellij-plugin:
if: github.event_name != 'pull_request'
needs: [build-intellij-plugin, test-intellij-plugin, verify-intellij-plugin]
runs-on: ubuntu-latest
environment: IntelliJ
continue-on-error: true

steps:
- name: Fetch sources
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
Expand All @@ -198,22 +198,22 @@ jobs:
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4
with:
cache-read-only: true
- name: Publish plugin to Nightly channel
env:
PUBLISH_TOKEN: ${{ secrets.INTELLIJ_PUBLISH_TOKEN }}
CERTIFICATE_CHAIN: ${{ secrets.INTELLIJ_CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.INTELLIJ_PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.INTELLIJ_PRIVATE_KEY_PASSWORD }}
working-directory: ./editors/intellij
run: |
sed -i -E \
"s/(pluginVersion = [^[:space:]]+)/\\1-nightly.$(git rev-parse --short HEAD)/g" \
gradle.properties
NIGHTLY_VERSION=$(grep -oP '^pluginVersion = \K\S+' gradle.properties)
./gradlew publishPlugin -Pchannel=Nightly -PpluginVersion=${NIGHTLY_VERSION}
- name: Publish plugin to Nightly channel
env:
PUBLISH_TOKEN: ${{ secrets.INTELLIJ_PUBLISH_TOKEN }}
CERTIFICATE_CHAIN: ${{ secrets.INTELLIJ_CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.INTELLIJ_PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.INTELLIJ_PRIVATE_KEY_PASSWORD }}
working-directory: ./editors/intellij
run: |
sed -i -E \
"s/(pluginVersion = [^[:space:]]+)/\\1-nightly.$(git rev-parse --short HEAD)/g" \
gradle.properties

NIGHTLY_VERSION=$(grep -oP '^pluginVersion = \K\S+' gradle.properties)

./gradlew publishPlugin -Pchannel=Nightly -PpluginVersion=${NIGHTLY_VERSION}

check-intellij-plugin-success:
needs:
- detect-changes
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/release_jetbrains_marketplace.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: Release IntelliJ plugin
name: Release IntelliJ plugin

on:
workflow_dispatch:

permissions:
contents: read
jobs:
publish-intellij-plugin:
runs-on: ubuntu-latest
environment: IntelliJ
steps:
- name: Fetch sources

jobs:
publish-intellij-plugin:
runs-on: ubuntu-latest
environment: IntelliJ

steps:
- name: Fetch sources
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
Expand All @@ -25,13 +25,13 @@ jobs:
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4
with:
cache-read-only: true
- name: Publish plugin to Marketplace
env:
PUBLISH_TOKEN: ${{ secrets.INTELLIJ_PUBLISH_TOKEN }}
CERTIFICATE_CHAIN: ${{ secrets.INTELLIJ_CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.INTELLIJ_PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.INTELLIJ_PRIVATE_KEY_PASSWORD }}
working-directory: ./editors/intellij
run: |
chmod +x ./gradlew
./gradlew publishPlugin
- name: Publish plugin to Marketplace
env:
PUBLISH_TOKEN: ${{ secrets.INTELLIJ_PUBLISH_TOKEN }}
CERTIFICATE_CHAIN: ${{ secrets.INTELLIJ_CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.INTELLIJ_PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.INTELLIJ_PRIVATE_KEY_PASSWORD }}
working-directory: ./editors/intellij
run: |
chmod +x ./gradlew
./gradlew publishPlugin
26 changes: 13 additions & 13 deletions editors/intellij/src/main/kotlin/tombi/Icons.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package tombi
import com.intellij.openapi.util.IconLoader
private inline fun <reified H> H.loadIcon(path: String) =
IconLoader.getIcon(path, H::class.java)
@Suppress("ObjectPropertyName")
internal object Icons {
val _16 by lazy { loadIcon("icons/16.svg") }
}
package tombi

import com.intellij.openapi.util.IconLoader


private inline fun <reified H> H.loadIcon(path: String) =
IconLoader.getIcon(path, H::class.java)


@Suppress("ObjectPropertyName")
internal object Icons {
val _16 by lazy { loadIcon("icons/16.svg") }
}
26 changes: 13 additions & 13 deletions editors/intellij/src/main/resources/icons/16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading