mirror of
https://github.com/chylex/IntelliJ-Rainbow-Brackets.git
synced 2024-11-25 23:42:44 +01:00
Compare commits
4 Commits
c9b3a33797
...
01c37cde63
Author | SHA1 | Date | |
---|---|---|---|
01c37cde63 | |||
8e3c6892f5 | |||
55d2cab839 | |||
83314b4675 |
57
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
57
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: bug?
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Your issue may already be reported!
|
||||||
|
Please search on the [issues](https://github.com/izhangzhihao/intellij-rainbow-brackets/issues) and the [document](https://github.com/izhangzhihao/intellij-rainbow-brackets/blob/2020.3/README.md) before creating one.
|
||||||
|
|
||||||
|
## Please check
|
||||||
|
|
||||||
|
- [ ] I already support this project.
|
||||||
|
- [ ] If you are submitting a feature request, please do consider donating us on [Open Collective](https://opencollective.com/intellij-rainbow-brackets) Or by AliPay/WeChatPay.
|
||||||
|
- [ ] This issue/feature request is not reported before.
|
||||||
|
|
||||||
|
## Your programming languages
|
||||||
|
|
||||||
|
## Expected Behavior
|
||||||
|
* If you're describing a bug, tell us what should happen
|
||||||
|
* If you're suggesting a change/improvement, tell us how it should work
|
||||||
|
|
||||||
|
## Current Behavior
|
||||||
|
* If describing a bug, tell us what happens instead of the expected behavior
|
||||||
|
* If suggesting a change/improvement, explain the difference from current behavior
|
||||||
|
|
||||||
|
## Possible Solution
|
||||||
|
Not obligatory, but suggest a fix/reason for the bug, or ideas how to implement the addition or change.
|
||||||
|
Or what have you tried to resolve this issue.
|
||||||
|
|
||||||
|
## Code snippet for reproduce (for bugs)
|
||||||
|
Please provide code snippet for reproduce bugs.
|
||||||
|
|
||||||
|
## Your Environment
|
||||||
|
|
||||||
|
* Plugin version:
|
||||||
|
* IDE & Operating System version, comment your env as below(go to "About IntelliJ IDEA" -> click the "copy" icon):
|
||||||
|
* NOTE: If you are going to report a bug but WITHOUT your env information, your issue might be closed directly.
|
||||||
|
|
||||||
|
```
|
||||||
|
IntelliJ IDEA 2021.2 (Ultimate Edition)
|
||||||
|
Build #IU-212.4746.92, built on July 27, 2021
|
||||||
|
Licensed to IntelliJ Rainbow Brackets / Zhang Zhihao
|
||||||
|
Subscription is active until February 3, 2022.
|
||||||
|
For non-commercial open source development only.
|
||||||
|
Runtime version: 11.0.11+9-b1504.13 x86_64
|
||||||
|
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
|
||||||
|
macOS 11.4
|
||||||
|
GC: G1 Young Generation, G1 Old Generation
|
||||||
|
Memory: 4096M
|
||||||
|
Cores: 16
|
||||||
|
Registry: ide.tooltip.initialDelay=900, ide.balloon.shadow.size=0, scala.erase.compiler.process.jdk.once=false
|
||||||
|
Non-Bundled Plugins: com.intellij.properties.bundle.editor (212.4746.57), com.markskelton.one-dark-theme (5.3.0), lermitage.intellij.extra.icons (1.59.0.203), org.nik.presentation-assistant (1.0.9), kotest-plugin-intellij (1.1.36-IC-2021.1), Pythonid (212.4746.96), org.intellij.scala (2021.2.15), izhangzhihao.rainbow.brackets (6.19), com.intellij.bigdatatools (212.4037.55)
|
||||||
|
Kotlin: 212-1.5.10-release-IJ4746.92
|
||||||
|
```
|
24
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
24
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: feature request
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Please [support us](https://github.com/izhangzhihao/intellij-rainbow-brackets#support-us) before creating a feature request, thanks for your support 😁**
|
||||||
|
|
||||||
|
## Please check
|
||||||
|
|
||||||
|
- [ ] I already support this project.
|
||||||
|
- [ ] If you are submitting a feature request, please do consider donating us on [Open Collective](https://opencollective.com/intellij-rainbow-brackets) Or by AliPay/WeChatPay.
|
||||||
|
- [ ] This issue/feature request is not reported before.
|
||||||
|
|
||||||
|
## Your programming languages
|
||||||
|
|
||||||
|
## Expected Behavior
|
||||||
|
* tell us how it will works
|
||||||
|
|
||||||
|
## Current Behavior
|
||||||
|
* explain the difference from current behavior
|
13
.github/opencollective.yml
vendored
Normal file
13
.github/opencollective.yml
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
collective: intellij-rainbow-brackets
|
||||||
|
tiers:
|
||||||
|
- tiers: "*"
|
||||||
|
labels: ["backer"]
|
||||||
|
message: "Hey <author> , thanks for supporting us on Open Collective :heart::heart::heart: We'll give a special attention to this issue!"
|
||||||
|
invitation: |
|
||||||
|
Hey <author> :wave:,
|
||||||
|
|
||||||
|
Thank you for opening an issue/feature request. We will get back to you as soon as we can.
|
||||||
|
Also, check out our <link> and consider backing us - every little helps!
|
||||||
|
|
||||||
|
PS.: We offer `priority` support for all backers. Don't forget to
|
||||||
|
add `priority` label when you start backing us :smile:
|
75
.github/workflows/build.yml
vendored
Normal file
75
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
name: Build
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '2020.3'
|
||||||
|
pull_request:
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# Setup Java 11 environment for the next steps
|
||||||
|
- name: Setup Java
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
|
java-version: 11
|
||||||
|
|
||||||
|
# Check out current repository
|
||||||
|
- name: Fetch Sources
|
||||||
|
uses: actions/checkout@v2.3.4
|
||||||
|
|
||||||
|
# Cache Gradle dependencies
|
||||||
|
- name: Setup Gradle Dependencies Cache
|
||||||
|
uses: actions/cache@v2.1.6
|
||||||
|
with:
|
||||||
|
path: ~/.gradle/caches
|
||||||
|
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}
|
||||||
|
|
||||||
|
# Cache Gradle Wrapper
|
||||||
|
- name: Setup Gradle Wrapper Cache
|
||||||
|
uses: actions/cache@v2.1.6
|
||||||
|
with:
|
||||||
|
path: ~/.gradle/wrapper
|
||||||
|
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
|
||||||
|
|
||||||
|
# Run detekt, ktlint and tests
|
||||||
|
- name: Run Linters and Test
|
||||||
|
run: ./gradlew check
|
||||||
|
|
||||||
|
# Run verifyPlugin Gradle task
|
||||||
|
- name: Verify Plugin
|
||||||
|
run: ./gradlew verifyPlugin
|
||||||
|
|
||||||
|
# Set environment variables
|
||||||
|
- name: Export Properties
|
||||||
|
id: properties
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
PROPERTIES="$(./gradlew properties --console=plain -q)"
|
||||||
|
IDE_VERSIONS="$(echo "$PROPERTIES" | grep "^pluginVerifierIdeVersions:" | base64)"
|
||||||
|
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
|
||||||
|
NAME="intellij-rainbow-brackets"
|
||||||
|
ARTIFACT="${NAME}-${VERSION}.zip"
|
||||||
|
|
||||||
|
echo "::set-output name=ideVersions::$IDE_VERSIONS"
|
||||||
|
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
|
||||||
|
echo "::set-output name=artifact::$ARTIFACT"
|
||||||
|
|
||||||
|
# Cache Plugin Verifier IDEs
|
||||||
|
- name: Setup Plugin Verifier IDEs Cache
|
||||||
|
uses: actions/cache@v2.1.6
|
||||||
|
with:
|
||||||
|
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
|
||||||
|
key: ${{ runner.os }}-plugin-verifier-${{ steps.properties.outputs.ideVersions }}
|
||||||
|
|
||||||
|
# Run IntelliJ Plugin Verifier action using GitHub Action
|
||||||
|
- name: Verify Plugin
|
||||||
|
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v2.2.3
|
||||||
|
with:
|
||||||
|
name: UnZipMe
|
||||||
|
path: ./build/distributions/${{ steps.properties.outputs.artifact }}
|
27
.github/workflows/label-and-close-issue.yml
vendored
Normal file
27
.github/workflows/label-and-close-issue.yml
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
name: "Label and close wontfix issues"
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [opened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Label:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: Naturalclar/issue-action@v2.0.2
|
||||||
|
with:
|
||||||
|
title-or-body: "both"
|
||||||
|
parameters: '[ {"keywords": ["RainbowHighlightVisitor.kt:35", "RainbowHighlightVisitor.kt:68", "RainbowHighlightVisitor.analyze"], "labels": ["invalid"]} ]'
|
||||||
|
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
Close:
|
||||||
|
needs: [Label]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v3.0.14
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
days-before-stale: 0
|
||||||
|
days-before-close: 0
|
||||||
|
stale-issue-message: "This auto generated issue has been automatically marked as wontfix because nothing it's wrong here. If you think there are something really wrong, please reply this issue. Thanks for your cooperation."
|
||||||
|
stale-issue-label: "wontfix"
|
||||||
|
only-labels: "invalid"
|
46
.github/workflows/release.yml
vendored
Normal file
46
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
# GitHub Actions Workflow created for handling the release process based on the draft release prepared
|
||||||
|
# with the Build workflow. Running the publishPlugin task requires the PUBLISH_TOKEN secret provided.
|
||||||
|
|
||||||
|
name: Release
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [prereleased, released]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# Prepare and publish the plugin to the Marketplace repository
|
||||||
|
release:
|
||||||
|
name: Publish Plugin
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# Setup Java 11 environment for the next steps
|
||||||
|
- name: Setup Java
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: "adopt"
|
||||||
|
java-version: 11
|
||||||
|
|
||||||
|
# Check out current repository
|
||||||
|
- name: Fetch Sources
|
||||||
|
uses: actions/checkout@v2.3.4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.release.tag_name }}
|
||||||
|
|
||||||
|
# Cache Gradle dependencies
|
||||||
|
- name: Setup Gradle Dependencies Cache
|
||||||
|
uses: actions/cache@v2.1.6
|
||||||
|
with:
|
||||||
|
path: ~/.gradle/caches
|
||||||
|
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}
|
||||||
|
|
||||||
|
# Cache Gradle Wrapper
|
||||||
|
- name: Setup Gradle Wrapper Cache
|
||||||
|
uses: actions/cache@v2.1.6
|
||||||
|
with:
|
||||||
|
path: ~/.gradle/wrapper
|
||||||
|
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
|
||||||
|
|
||||||
|
# Publish the plugin to the Marketplace
|
||||||
|
- name: Publish Plugin
|
||||||
|
env:
|
||||||
|
token: ${{ secrets.PUBLISH_TOKEN }}
|
||||||
|
run: ./gradlew publishPlugin
|
19
.github/workflows/stale.yml
vendored
Normal file
19
.github/workflows/stale.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
name: 'Stale handler'
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stale:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@main
|
||||||
|
id: stale
|
||||||
|
with:
|
||||||
|
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days'
|
||||||
|
days-before-stale: 30
|
||||||
|
days-before-close: 5
|
||||||
|
only-labels: 'PR welcome'
|
||||||
|
- name: Print outputs
|
||||||
|
run: echo ${{ join(steps.stale.outputs.*, ',') }}
|
15
.gitignore
vendored
15
.gitignore
vendored
@ -1,7 +1,10 @@
|
|||||||
/.idea/*
|
/.idea/*
|
||||||
!/.idea/icon*.png
|
!/.idea/icon.png
|
||||||
!/.idea/runConfigurations
|
!/.idea/icon_dark.png
|
||||||
|
!/.idea/vcs.xml
|
||||||
/.gradle/
|
.sandbox/
|
||||||
/build/
|
.gradle/
|
||||||
/libs/
|
build/
|
||||||
|
*.iml
|
||||||
|
.DS_Store
|
||||||
|
out
|
5
.gitpod.Dockerfile
vendored
Normal file
5
.gitpod.Dockerfile
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM gitpod/workspace-full
|
||||||
|
|
||||||
|
USER gitpod
|
||||||
|
|
||||||
|
RUN brew install kotlin
|
4
.gitpod.yml
Normal file
4
.gitpod.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
image:
|
||||||
|
file: .gitpod.Dockerfile
|
||||||
|
tasks:
|
||||||
|
- init: gradle compileKotlin
|
1
.java-version
Normal file
1
.java-version
Normal file
@ -0,0 +1 @@
|
|||||||
|
11
|
15
.mergify.yml
Normal file
15
.mergify.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
pull_request_rules:
|
||||||
|
- name: Automatic merge on approval
|
||||||
|
conditions:
|
||||||
|
- "#approved-reviews-by>=1"
|
||||||
|
- status-success=Test
|
||||||
|
actions:
|
||||||
|
merge:
|
||||||
|
method: merge
|
||||||
|
- name: automatically merge dependabot's PRs
|
||||||
|
conditions:
|
||||||
|
- author~=^dependabot(|-preview)\[bot\]$
|
||||||
|
- status-success=Test
|
||||||
|
actions:
|
||||||
|
merge:
|
||||||
|
method: merge
|
144
build.gradle.kts
144
build.gradle.kts
@ -1,110 +1,74 @@
|
|||||||
@file:Suppress("SpellCheckingInspection")
|
|
||||||
|
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "1.8.0"
|
id("org.jetbrains.intellij") version "1.9.0"
|
||||||
id("org.jetbrains.intellij") version "1.15.0"
|
id("org.jetbrains.kotlin.jvm") version "1.7.20"
|
||||||
}
|
id("idea")
|
||||||
|
|
||||||
group = "com.chylex.intellij.rainbowbrackets"
|
|
||||||
version = "6.26-chylex-2"
|
|
||||||
|
|
||||||
val ideVersion = "2023.2.2"
|
|
||||||
|
|
||||||
idea {
|
|
||||||
module {
|
|
||||||
excludeDirs.add(file("gradle"))
|
|
||||||
excludeDirs.add(file("libs"))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenLocal()
|
||||||
maven(url = "https://www.jetbrains.com/intellij-repository/releases")
|
mavenCentral()
|
||||||
maven(url = "https://www.jetbrains.com/intellij-repository/snapshots")
|
maven(url = "https://maven-central.storage-download.googleapis.com/repos/central/data/")
|
||||||
|
maven(url = "https://www.jetbrains.com/intellij-repository/releases")
|
||||||
|
maven(url = "https://www.jetbrains.com/intellij-repository/snapshots")
|
||||||
}
|
}
|
||||||
|
|
||||||
val clion: Configuration by configurations.creating
|
group = "com.github.izhangzhihao"
|
||||||
val rider: Configuration by configurations.creating
|
version = "6.26-chylex-1"
|
||||||
|
|
||||||
dependencies {
|
|
||||||
clion("com.jetbrains.intellij.clion:clion:$ideVersion")
|
|
||||||
rider("com.jetbrains.intellij.rider:riderRD:$ideVersion")
|
|
||||||
|
|
||||||
compileOnly(fileTree("libs"))
|
|
||||||
|
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
|
|
||||||
testImplementation("io.kotest:kotest-assertions-core:5.5.5")
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
jvmToolchain(17)
|
|
||||||
}
|
|
||||||
|
|
||||||
intellij {
|
intellij {
|
||||||
type.set("IU")
|
type.set("IU")
|
||||||
version.set(ideVersion)
|
version.set("2022.2.3")
|
||||||
updateSinceUntilBuild.set(false)
|
updateSinceUntilBuild.set(false)
|
||||||
|
|
||||||
plugins.set(
|
plugins.set(
|
||||||
listOf(
|
listOf(
|
||||||
// Built-in
|
// Built-in
|
||||||
"Groovy",
|
"Groovy",
|
||||||
"JavaScript",
|
"JavaScript",
|
||||||
"com.intellij.css",
|
"com.intellij.css",
|
||||||
"com.intellij.database",
|
"com.intellij.database",
|
||||||
"com.intellij.java",
|
"com.intellij.java",
|
||||||
"org.intellij.plugins.markdown",
|
"org.intellij.plugins.markdown",
|
||||||
"org.jetbrains.kotlin",
|
"org.jetbrains.kotlin",
|
||||||
"org.jetbrains.plugins.yaml",
|
"org.jetbrains.plugins.yaml",
|
||||||
// Downloaded
|
// Downloaded
|
||||||
"Dart:232.8660.129", // https://plugins.jetbrains.com/plugin/6351-dart/versions/stable
|
"Dart:222.4345.14", // https://plugins.jetbrains.com/plugin/6351-dart/versions/stable
|
||||||
"Pythonid:232.9921.47", // https://plugins.jetbrains.com/plugin/631-python/versions
|
"Pythonid:222.4345.14", // https://plugins.jetbrains.com/plugin/631-python/versions
|
||||||
"com.jetbrains.php:232.9921.55", // https://plugins.jetbrains.com/plugin/6610-php/versions
|
"com.jetbrains.php:222.4345.15", // https://plugins.jetbrains.com/plugin/6610-php/versions
|
||||||
"com.jetbrains.sh:232.8660.88", // https://plugins.jetbrains.com/plugin/13122-shell-script/versions
|
"com.jetbrains.sh:222.4345.5", // https://plugins.jetbrains.com/plugin/13122-shell-script/versions
|
||||||
"org.intellij.scala:2023.2.23", // https://plugins.jetbrains.com/plugin/1347-scala/versions
|
"org.intellij.scala:2022.2.17", // https://plugins.jetbrains.com/plugin/1347-scala/versions
|
||||||
"org.jetbrains.plugins.go-template:232.9921.89", // https://plugins.jetbrains.com/plugin/10581-go-template/versions
|
"org.jetbrains.plugins.go-template:222.4345.14", // https://plugins.jetbrains.com/plugin/10581-go-template/versions
|
||||||
"org.jetbrains.plugins.ruby:232.9921.47", // https://plugins.jetbrains.com/plugin/1293-ruby/versions
|
"org.jetbrains.plugins.ruby:222.4345.14", // https://plugins.jetbrains.com/plugin/1293-ruby/versions
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.runIde {
|
||||||
|
systemProperties["idea.auto.reload.plugins"] = false
|
||||||
|
jvmArgs = listOf(
|
||||||
|
"-Xms512m",
|
||||||
|
"-Xmx2048m",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.patchPluginXml {
|
tasks.patchPluginXml {
|
||||||
sinceBuild.set("232")
|
sinceBuild.set("222")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.test {
|
dependencies {
|
||||||
useJUnitPlatform()
|
compileOnly(fileTree("libs"))
|
||||||
|
testImplementation("io.kotest:kotest-assertions-core:5.5.2")
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
toolchain {
|
||||||
|
languageVersion.set(JavaLanguageVersion.of(17))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<KotlinCompile> {
|
tasks.withType<KotlinCompile> {
|
||||||
kotlinOptions.freeCompilerArgs = listOf(
|
kotlinOptions.jvmTarget = "17"
|
||||||
"-Xjvm-default=all"
|
kotlinOptions.freeCompilerArgs = listOf("-Xjsr305=strict")
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun createDownloadIdeTask(name: String, dependency: Configuration, configuration: CopySpec.() -> Unit): Sync {
|
|
||||||
return tasks.create<Sync>(name) {
|
|
||||||
group = "ides"
|
|
||||||
outputs.upToDateWhen { false }
|
|
||||||
|
|
||||||
from(dependency.map(::zipTree), configuration)
|
|
||||||
into(file("libs/${dependency.name}"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val downloadIdeClion = createDownloadIdeTask("downloadIdeClion", clion) {
|
|
||||||
include("plugins/cidr-base-plugin/**")
|
|
||||||
}
|
|
||||||
|
|
||||||
val downloadIdeRider = createDownloadIdeTask("downloadIdeRider", rider) {
|
|
||||||
include("lib/app.jar")
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.create<Sync>("downloadExtraIdes") {
|
|
||||||
group = "ides"
|
|
||||||
|
|
||||||
dependsOn(downloadIdeClion)
|
|
||||||
dependsOn(downloadIdeRider)
|
|
||||||
}
|
}
|
||||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,7 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||||
networkTimeout=10000
|
|
||||||
validateDistributionUrl=true
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
31
gradlew
vendored
31
gradlew
vendored
@ -55,7 +55,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@ -80,11 +80,13 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# This is normally unused
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
# shellcheck disable=SC2034
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@ -131,29 +133,22 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD=java
|
JAVACMD=java
|
||||||
if ! command -v java >/dev/null 2>&1
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
then
|
|
||||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
|
||||||
# shellcheck disable=SC3045
|
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
|
||||||
# shellcheck disable=SC3045
|
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@ -198,10 +193,6 @@ if "$cygwin" || "$msys" ; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command;
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
@ -214,12 +205,6 @@ set -- \
|
|||||||
org.gradle.wrapper.GradleWrapperMain \
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
|
||||||
if ! command -v xargs >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
die "xargs is not available"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use "xargs" to parse quoted args.
|
# Use "xargs" to parse quoted args.
|
||||||
#
|
#
|
||||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
15
gradlew.bat
vendored
15
gradlew.bat
vendored
@ -14,7 +14,7 @@
|
|||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%" == "" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@ -25,8 +25,7 @@
|
|||||||
if "%OS%"=="Windows_NT" setlocal
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
@rem This is normally unused
|
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
@ -41,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
|||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if "%ERRORLEVEL%" == "0" goto execute
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
@ -76,15 +75,13 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
:fail
|
:fail
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
rem the _cmd.exe /c_ return code!
|
rem the _cmd.exe /c_ return code!
|
||||||
set EXIT_CODE=%ERRORLEVEL%
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
exit /b 1
|
||||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
||||||
exit /b %EXIT_CODE%
|
|
||||||
|
|
||||||
:mainEnd
|
:mainEnd
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
BIN
libs/clion.jar
Normal file
BIN
libs/clion.jar
Normal file
Binary file not shown.
BIN
libs/rider.jar
Normal file
BIN
libs/rider.jar
Normal file
Binary file not shown.
@ -1,8 +1,8 @@
|
|||||||
rootProject.name = "RainbowBrackets"
|
rootProject.name = "RainbowBrackets"
|
||||||
|
|
||||||
pluginManagement {
|
pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")
|
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,17 +3,12 @@ package com.github.izhangzhihao.rainbow.brackets
|
|||||||
import com.github.izhangzhihao.rainbow.brackets.provider.BracePairProvider
|
import com.github.izhangzhihao.rainbow.brackets.provider.BracePairProvider
|
||||||
import com.github.izhangzhihao.rainbow.brackets.util.memoize
|
import com.github.izhangzhihao.rainbow.brackets.util.memoize
|
||||||
import com.intellij.codeInsight.highlighting.BraceMatchingUtil
|
import com.intellij.codeInsight.highlighting.BraceMatchingUtil
|
||||||
import com.intellij.lang.BracePair
|
import com.intellij.lang.*
|
||||||
import com.intellij.lang.CompositeLanguage
|
|
||||||
import com.intellij.lang.Language
|
|
||||||
import com.intellij.lang.LanguageBraceMatching
|
|
||||||
import com.intellij.lang.LanguageExtension
|
|
||||||
import com.intellij.lang.PairedBraceMatcher
|
|
||||||
import com.intellij.psi.tree.IElementType
|
import com.intellij.psi.tree.IElementType
|
||||||
|
|
||||||
object BracePairs {
|
object BracePairs {
|
||||||
|
|
||||||
private val providers = LanguageExtension<BracePairProvider>("com.chylex.intellij.rainbowbrackets.bracePairProvider")
|
private val providers = LanguageExtension<BracePairProvider>("izhangzhihao.rainbow.brackets.bracePairProvider")
|
||||||
|
|
||||||
private val bracePairs =
|
private val bracePairs =
|
||||||
Language.getRegisteredLanguages()
|
Language.getRegisteredLanguages()
|
||||||
|
@ -1,13 +1,21 @@
|
|||||||
package com.github.izhangzhihao.rainbow.brackets.provider
|
package com.github.izhangzhihao.rainbow.brackets.provider
|
||||||
|
|
||||||
import com.intellij.lang.BracePair
|
import com.intellij.lang.BracePair
|
||||||
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.kotoparser.lexer.CSharpTokenType
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.lexer.CSharpTokenType
|
||||||
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.lexer.CSharpTokenType.GT
|
||||||
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.lexer.CSharpTokenType.LBRACE
|
||||||
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.lexer.CSharpTokenType.LBRACKET
|
||||||
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.lexer.CSharpTokenType.LPARENTH
|
||||||
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.lexer.CSharpTokenType.LT
|
||||||
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.lexer.CSharpTokenType.RBRACE
|
||||||
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.lexer.CSharpTokenType.RBRACKET
|
||||||
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.lexer.CSharpTokenType.RPARENTH
|
||||||
|
|
||||||
class CSharpBracePairProvider : BracePairProvider {
|
class CSharpBracePairProvider : BracePairProvider {
|
||||||
override fun pairs(): List<BracePair> = listOf(
|
override fun pairs(): List<BracePair> = listOf(
|
||||||
BracePair(CSharpTokenType.LPARENTH, CSharpTokenType.RPARENTH, false),
|
//BracePair(LPARENTH, RPARENTH, false),
|
||||||
BracePair(CSharpTokenType.LBRACE, CSharpTokenType.RBRACE, false),
|
BracePair(LBRACE, RBRACE, false),
|
||||||
BracePair(CSharpTokenType.LBRACKET, CSharpTokenType.RBRACKET, false),
|
BracePair(LBRACKET, RBRACKET, false),
|
||||||
BracePair(CSharpTokenType.LT, CSharpTokenType.GT, false),
|
BracePair(LT, GT, false),
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -1,8 +1,8 @@
|
|||||||
package com.github.izhangzhihao.rainbow.brackets.provider
|
package com.github.izhangzhihao.rainbow.brackets.provider
|
||||||
|
|
||||||
import com.intellij.lang.BracePair
|
import com.intellij.lang.BracePair
|
||||||
import com.jetbrains.cidr.lang.parser.OCLexerTokenTypes
|
import com.jetbrains.cidr.lang.parser.OCTokenTypes
|
||||||
|
|
||||||
class OCBracePairProvider : BracePairProvider {
|
class OCBracePairProvider : BracePairProvider {
|
||||||
override fun pairs(): List<BracePair> = listOf(BracePair(OCLexerTokenTypes.LT, OCLexerTokenTypes.GT, false))
|
override fun pairs(): List<BracePair> = listOf(BracePair(OCTokenTypes.LT, OCTokenTypes.GT, false))
|
||||||
}
|
}
|
@ -0,0 +1,246 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Patrick Scheibe
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
package com.github.izhangzhihao.rainbow.brackets.util
|
||||||
|
|
||||||
|
import com.github.izhangzhihao.rainbow.brackets.settings.RainbowSettings
|
||||||
|
import com.github.izhangzhihao.rainbow.brackets.util.ErrorContext.Companion.fromThrowable
|
||||||
|
import com.intellij.AbstractBundle
|
||||||
|
import com.intellij.diagnostic.*
|
||||||
|
import com.intellij.ide.DataManager
|
||||||
|
import com.intellij.ide.plugins.PluginManagerCore
|
||||||
|
import com.intellij.ide.plugins.PluginUtil
|
||||||
|
import com.intellij.idea.IdeaLogger
|
||||||
|
import com.intellij.notification.NotificationGroupManager
|
||||||
|
import com.intellij.notification.NotificationListener
|
||||||
|
import com.intellij.notification.NotificationType
|
||||||
|
import com.intellij.openapi.actionSystem.CommonDataKeys
|
||||||
|
import com.intellij.openapi.application.ApplicationNamesInfo
|
||||||
|
import com.intellij.openapi.application.ex.ApplicationInfoEx
|
||||||
|
import com.intellij.openapi.application.impl.ApplicationInfoImpl
|
||||||
|
import com.intellij.openapi.diagnostic.ErrorReportSubmitter
|
||||||
|
import com.intellij.openapi.diagnostic.IdeaLoggingEvent
|
||||||
|
import com.intellij.openapi.diagnostic.SubmittedReportInfo
|
||||||
|
import com.intellij.openapi.diagnostic.SubmittedReportInfo.SubmissionStatus
|
||||||
|
import com.intellij.openapi.progress.EmptyProgressIndicator
|
||||||
|
import com.intellij.openapi.progress.ProgressIndicator
|
||||||
|
import com.intellij.openapi.progress.ProgressManager
|
||||||
|
import com.intellij.openapi.progress.Task
|
||||||
|
import com.intellij.openapi.project.Project
|
||||||
|
import com.intellij.openapi.util.SystemInfo
|
||||||
|
import com.intellij.util.Consumer
|
||||||
|
import org.eclipse.egit.github.core.Issue
|
||||||
|
import org.eclipse.egit.github.core.Label
|
||||||
|
import org.eclipse.egit.github.core.RepositoryId
|
||||||
|
import org.eclipse.egit.github.core.client.GitHubClient
|
||||||
|
import org.eclipse.egit.github.core.service.IssueService
|
||||||
|
import org.jetbrains.annotations.NonNls
|
||||||
|
import org.jetbrains.annotations.NotNull
|
||||||
|
import org.jetbrains.annotations.Nullable
|
||||||
|
import org.jetbrains.annotations.PropertyKey
|
||||||
|
import java.awt.Component
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
private object AnonymousFeedback {
|
||||||
|
private const val gitRepoUser = "izhangzhihao"
|
||||||
|
|
||||||
|
//private const val gitRepoUser = "intellij-rainbow-brackets"
|
||||||
|
private const val gitRepo = "intellij-rainbow-brackets"
|
||||||
|
|
||||||
|
//private const val gitRepo = "bug"
|
||||||
|
private const val issueLabel = "Auto generated"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Makes a connection to GitHub. Checks if there is an issue that is a duplicate and based on this, creates either a
|
||||||
|
* new issue or comments on the duplicate (if the user provided additional information).
|
||||||
|
*
|
||||||
|
* @param environmentDetails Information collected by [getKeyValuePairs]
|
||||||
|
* @return The report info that is then used in [GitHubErrorReporter] to show the user a balloon with the link
|
||||||
|
* of the created issue.
|
||||||
|
*/
|
||||||
|
internal fun sendFeedback(environmentDetails: MutableMap<String, String>): SubmittedReportInfo {
|
||||||
|
try {
|
||||||
|
val gitAccessToken = something
|
||||||
|
val client = GitHubClient()
|
||||||
|
client.setOAuth2Token(gitAccessToken)
|
||||||
|
val repoID = RepositoryId(gitRepoUser, gitRepo)
|
||||||
|
val issueService = IssueService(client)
|
||||||
|
var newGibHubIssue = createNewGibHubIssue(environmentDetails)
|
||||||
|
val duplicate = findFirstDuplicate(newGibHubIssue.title, issueService, repoID)
|
||||||
|
var isNewIssue = true
|
||||||
|
if (duplicate != null) {
|
||||||
|
issueService.createComment(repoID, duplicate.number, newGibHubIssue.body)
|
||||||
|
newGibHubIssue = duplicate
|
||||||
|
isNewIssue = false
|
||||||
|
} else newGibHubIssue = issueService.createIssue(repoID, newGibHubIssue)
|
||||||
|
return SubmittedReportInfo(newGibHubIssue.htmlUrl, ErrorReportBundle.message(
|
||||||
|
if (isNewIssue) "git.issue.text" else "git.issue.duplicate.text", newGibHubIssue.htmlUrl, newGibHubIssue.number.toLong()),
|
||||||
|
if (isNewIssue) SubmissionStatus.NEW_ISSUE else SubmissionStatus.DUPLICATE)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
return SubmittedReportInfo(null,
|
||||||
|
ErrorReportBundle.message("report.error.connection.failure"),
|
||||||
|
SubmissionStatus.FAILED)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun findFirstDuplicate(title: String, service: IssueService, repo: RepositoryId): Issue? {
|
||||||
|
val openIssue = hashMapOf(IssueService.FILTER_STATE to IssueService.STATE_OPEN)
|
||||||
|
val closedIssue = hashMapOf(IssueService.FILTER_STATE to IssueService.STATE_CLOSED)
|
||||||
|
return service.pageIssues(repo, openIssue).flatten().firstOrNull { it.title == title }
|
||||||
|
?: service.pageIssues(repo, closedIssue).flatten().firstOrNull { it.title == title }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun createNewGibHubIssue(details: MutableMap<String, String>) = Issue().apply {
|
||||||
|
val errorMessage = details.remove("error.message")?.takeIf(String::isNotBlank) ?: "Unspecified error"
|
||||||
|
title = ErrorReportBundle.message("git.issue.title", errorMessage)
|
||||||
|
body = generateGitHubIssueBody(details)
|
||||||
|
labels = listOf(Label().apply { name = issueLabel })
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun generateGitHubIssueBody(details: MutableMap<String, String>): String {
|
||||||
|
val errorDescription = details.remove("error.description").orEmpty()
|
||||||
|
val stackTrace = details.remove("error.stacktrace")?.takeIf(String::isNotBlank) ?: "invalid stacktrace"
|
||||||
|
val result = StringBuilder()
|
||||||
|
if (errorDescription.isNotEmpty()) {
|
||||||
|
result.append(errorDescription)
|
||||||
|
result.append("\n\n----------------------\n\n")
|
||||||
|
}
|
||||||
|
for ((key, value) in details) {
|
||||||
|
result.append("- ")
|
||||||
|
result.append(key)
|
||||||
|
result.append(": ")
|
||||||
|
result.append(value)
|
||||||
|
result.append("\n")
|
||||||
|
}
|
||||||
|
result.append("- StackTrace:\n")
|
||||||
|
result.append(stackTrace)
|
||||||
|
return result.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//String(Base64.getEncoder().encode("".toByteArray()))
|
||||||
|
private const val st = "YjgwZGRiY2U2YTNlYTAzM2UyZGU" + "yNDcyNWEyZjE3MGQ2YThmMjc0MQ=="
|
||||||
|
|
||||||
|
private val something: String by lazy { String(Base64.getDecoder().decode(st)) }
|
||||||
|
|
||||||
|
class GitHubErrorReporter : ErrorReportSubmitter() {
|
||||||
|
override fun getReportActionText() = ErrorReportBundle.message("report.error.to.plugin.vendor")
|
||||||
|
|
||||||
|
override fun submit(events: Array<out IdeaLoggingEvent>?, info: @Nullable String?, parent: @NotNull Component, consumer: @NotNull Consumer<in SubmittedReportInfo>): Boolean {
|
||||||
|
return doSubmit(events!![0], parent, consumer, fromThrowable(events[0].throwable), info)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun doSubmit(
|
||||||
|
event: IdeaLoggingEvent,
|
||||||
|
parent: Component,
|
||||||
|
callback: Consumer<in SubmittedReportInfo>,
|
||||||
|
errorContext: ErrorContext,
|
||||||
|
description: String?): Boolean {
|
||||||
|
val dataContext = DataManager.getInstance().getDataContext(parent)
|
||||||
|
description?.let { errorContext.description = description }
|
||||||
|
errorContext.message = event.message
|
||||||
|
event.throwable?.let { throwable ->
|
||||||
|
PluginUtil.getInstance().findPluginId(throwable)?.let { pluginId ->
|
||||||
|
PluginManagerCore.getPlugin(pluginId)?.let { ideaPluginDescriptor ->
|
||||||
|
if (!ideaPluginDescriptor.isBundled) {
|
||||||
|
errorContext.pluginName = ideaPluginDescriptor.name
|
||||||
|
errorContext.pluginVersion = ideaPluginDescriptor.version
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
(event.data as? LogMessage)?.let { errorContext.attachments = it.includedAttachments }
|
||||||
|
val project = CommonDataKeys.PROJECT.getData(dataContext)
|
||||||
|
val reportValues = getKeyValuePairs(
|
||||||
|
errorContext,
|
||||||
|
ApplicationInfoImpl.getShadowInstance() as ApplicationInfoImpl,
|
||||||
|
ApplicationNamesInfo.getInstance())
|
||||||
|
val notifyingCallback = CallbackWithNotification(callback, project)
|
||||||
|
val task = AnonymousFeedbackTask(project, ErrorReportBundle.message(
|
||||||
|
"report.error.progress.dialog.text"), true, reportValues, notifyingCallback)
|
||||||
|
if (project == null) task.run(EmptyProgressIndicator()) else ProgressManager.getInstance().run(task)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class CallbackWithNotification(
|
||||||
|
private val consumer: Consumer<in SubmittedReportInfo>,
|
||||||
|
private val project: Project?) : Consumer<SubmittedReportInfo> {
|
||||||
|
override fun consume(reportInfo: SubmittedReportInfo) {
|
||||||
|
consumer.consume(reportInfo)
|
||||||
|
val GROUP = NotificationGroupManager.getInstance().getNotificationGroup("Error Report")
|
||||||
|
if (reportInfo.status == SubmissionStatus.FAILED) GROUP.createNotification(DiagnosticBundle.message("error.report.title"),
|
||||||
|
reportInfo.linkText, NotificationType.ERROR).setImportant(false).notify(project)
|
||||||
|
else GROUP.createNotification(DiagnosticBundle.message("error.report.title"), reportInfo.linkText,
|
||||||
|
NotificationType.INFORMATION).setListener(NotificationListener.URL_OPENING_LISTENER).setImportant(false).notify(project)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Messages and strings used by the error reporter
|
||||||
|
*/
|
||||||
|
private object ErrorReportBundle {
|
||||||
|
@NonNls
|
||||||
|
private const val BUNDLE = "error-reporting.report-bundle"
|
||||||
|
private val bundle: ResourceBundle by lazy { ResourceBundle.getBundle(BUNDLE) }
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
internal fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
|
||||||
|
AbstractBundle.message(bundle, key, *params)
|
||||||
|
}
|
||||||
|
|
||||||
|
private class AnonymousFeedbackTask(
|
||||||
|
project: Project?, title: String, canBeCancelled: Boolean,
|
||||||
|
private val params: MutableMap<String, String>,
|
||||||
|
private val callback: Consumer<SubmittedReportInfo>) : Task.Backgroundable(project, title, canBeCancelled, DEAF) {
|
||||||
|
override fun run(indicator: ProgressIndicator) {
|
||||||
|
callback.consume(AnonymousFeedback.sendFeedback(params))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Collects information about the running IDEA and the error
|
||||||
|
*/
|
||||||
|
private fun getKeyValuePairs(
|
||||||
|
errorContext: ErrorContext,
|
||||||
|
appInfo: ApplicationInfoEx,
|
||||||
|
namesInfo: ApplicationNamesInfo): MutableMap<String, String> {
|
||||||
|
|
||||||
|
val params = mutableMapOf(
|
||||||
|
"error.description" to errorContext.description,
|
||||||
|
"Plugin Name" to errorContext.pluginName,
|
||||||
|
"Plugin Version" to RainbowSettings.instance.version,
|
||||||
|
"OS Name" to SystemInfo.OS_NAME,
|
||||||
|
"OS Version" to SystemInfo.OS_VERSION,
|
||||||
|
"Java Version" to SystemInfo.JAVA_VERSION,
|
||||||
|
"App Name" to namesInfo.productName,
|
||||||
|
"App Full Name" to namesInfo.fullProductName,
|
||||||
|
"Is Snapshot" to java.lang.Boolean.toString(appInfo.build.isSnapshot),
|
||||||
|
"App Build" to appInfo.build.asString(),
|
||||||
|
"error.message" to errorContext.errorClass,
|
||||||
|
"error.stacktrace" to "\n```\n" + errorContext.stackTrace + "\n```\n")
|
||||||
|
for (attachment in errorContext.attachments) {
|
||||||
|
params["attachment.${attachment.name}"] = attachment.path
|
||||||
|
params["attachment.${attachment.name}.value"] = "\n```\n" + attachment.displayText + "\n```\n"
|
||||||
|
}
|
||||||
|
return params
|
||||||
|
}
|
@ -7,7 +7,10 @@ import com.intellij.psi.PsiElement
|
|||||||
import com.intellij.psi.PsiFile
|
import com.intellij.psi.PsiFile
|
||||||
import com.intellij.psi.impl.source.tree.LeafPsiElement
|
import com.intellij.psi.impl.source.tree.LeafPsiElement
|
||||||
import com.intellij.psi.tree.IElementType
|
import com.intellij.psi.tree.IElementType
|
||||||
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.kotoparser.lexer.CSharpTokenType
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.lexer.CSharpTokenType.GT
|
||||||
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.lexer.CSharpTokenType.LPARENTH
|
||||||
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.lexer.CSharpTokenType.LT
|
||||||
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.lexer.CSharpTokenType.RPARENTH
|
||||||
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.psi.CSharpDummyNode
|
import com.jetbrains.rider.ideaInterop.fileTypes.csharp.psi.CSharpDummyNode
|
||||||
|
|
||||||
|
|
||||||
@ -47,8 +50,8 @@ class CSharpRainbowVisitor : RainbowHighlightVisitor() {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val map = mapOf(
|
val map = mapOf(
|
||||||
CSharpTokenType.LPARENTH to BracePair(CSharpTokenType.LPARENTH, CSharpTokenType.RPARENTH, true),
|
LPARENTH to BracePair(LPARENTH, RPARENTH, true),
|
||||||
CSharpTokenType.RPARENTH to BracePair(CSharpTokenType.LPARENTH, CSharpTokenType.RPARENTH, true),
|
RPARENTH to BracePair(LPARENTH, RPARENTH, true),
|
||||||
//LT to BracePair(LT, GT, true),
|
//LT to BracePair(LT, GT, true),
|
||||||
//GT to BracePair(LT, GT, true),
|
//GT to BracePair(LT, GT, true),
|
||||||
)
|
)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<extensions defaultExtensionNs="com.intellij">
|
<extensions defaultExtensionNs="com.intellij">
|
||||||
<highlightVisitor implementation="com.github.izhangzhihao.rainbow.brackets.visitor.ReactJSXRainbowVisitor"/>
|
<highlightVisitor implementation="com.github.izhangzhihao.rainbow.brackets.visitor.ReactJSXRainbowVisitor"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
<extensions defaultExtensionNs="com.chylex.intellij.rainbowbrackets">
|
<extensions defaultExtensionNs="izhangzhihao.rainbow.brackets">
|
||||||
<bracePairProvider language="JavaScript"
|
<bracePairProvider language="JavaScript"
|
||||||
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.TSBracePairProvider"/>
|
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.TSBracePairProvider"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<extensions defaultExtensionNs="com.chylex.intellij.rainbowbrackets">
|
<extensions defaultExtensionNs="izhangzhihao.rainbow.brackets">
|
||||||
<bracePairProvider language="C#"
|
<bracePairProvider language="C#"
|
||||||
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.CSharpBracePairProvider"/>
|
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.CSharpBracePairProvider"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<extensions defaultExtensionNs="com.chylex.intellij.rainbowbrackets">
|
<extensions defaultExtensionNs="izhangzhihao.rainbow.brackets">
|
||||||
<bracePairProvider language="Dart"
|
<bracePairProvider language="Dart"
|
||||||
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.DartBracePairProvider"/>
|
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.DartBracePairProvider"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<extensions defaultExtensionNs="com.chylex.intellij.rainbowbrackets">
|
<extensions defaultExtensionNs="izhangzhihao.rainbow.brackets">
|
||||||
<bracePairProvider language="GoTemplate"
|
<bracePairProvider language="GoTemplate"
|
||||||
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.GoTemplateProvider"/>
|
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.GoTemplateProvider"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<extensions defaultExtensionNs="com.chylex.intellij.rainbowbrackets">
|
<extensions defaultExtensionNs="izhangzhihao.rainbow.brackets">
|
||||||
<bracePairProvider language="Groovy"
|
<bracePairProvider language="Groovy"
|
||||||
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.GroovyBracePairProvider"/>
|
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.GroovyBracePairProvider"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<extensions defaultExtensionNs="com.chylex.intellij.rainbowbrackets">
|
<extensions defaultExtensionNs="izhangzhihao.rainbow.brackets">
|
||||||
<bracePairProvider language="kotlin"
|
<bracePairProvider language="kotlin"
|
||||||
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.KotlinBracePairProvider"/>
|
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.KotlinBracePairProvider"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<extensions defaultExtensionNs="com.chylex.intellij.rainbowbrackets">
|
<extensions defaultExtensionNs="izhangzhihao.rainbow.brackets">
|
||||||
<bracePairProvider language="ObjectiveC"
|
<bracePairProvider language="ObjectiveC"
|
||||||
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.OCBracePairProvider"/>
|
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.OCBracePairProvider"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<extensions defaultExtensionNs="com.chylex.intellij.rainbowbrackets">
|
<extensions defaultExtensionNs="izhangzhihao.rainbow.brackets">
|
||||||
<bracePairProvider language="PHP"
|
<bracePairProvider language="PHP"
|
||||||
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.PHPBracePairProvider"/>
|
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.PHPBracePairProvider"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<idea-plugin require-restart="true">
|
<idea-plugin require-restart="true">
|
||||||
<id>com.chylex.intellij.rainbowbrackets</id>
|
<id>izhangzhihao.rainbow.brackets</id>
|
||||||
<name>Rainbow Brackets</name>
|
<name>Rainbow Brackets</name>
|
||||||
<vendor email="izhangzhihao@hotmail.com" url="https://github.com/izhangzhihao">izhangzhihao</vendor>
|
<vendor email="izhangzhihao@hotmail.com" url="https://github.com/izhangzhihao">izhangzhihao</vendor>
|
||||||
|
|
||||||
@ -50,12 +50,6 @@
|
|||||||
]]></description>
|
]]></description>
|
||||||
|
|
||||||
<change-notes><![CDATA[
|
<change-notes><![CDATA[
|
||||||
<p>6.26-chylex-2</p>
|
|
||||||
<ul>
|
|
||||||
<li>Fixed Rider support.</li>
|
|
||||||
</ul>
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
<p>6.26-chylex-1</p>
|
<p>6.26-chylex-1</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Removed post-update notification.</li>
|
<li>Removed post-update notification.</li>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<extensions defaultExtensionNs="com.chylex.intellij.rainbowbrackets">
|
<extensions defaultExtensionNs="izhangzhihao.rainbow.brackets">
|
||||||
<bracePairProvider language="Shell Script"
|
<bracePairProvider language="Shell Script"
|
||||||
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.SHBracePairProvider"/>
|
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.SHBracePairProvider"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<extensions defaultExtensionNs="com.chylex.intellij.rainbowbrackets">
|
<extensions defaultExtensionNs="izhangzhihao.rainbow.brackets">
|
||||||
<bracePairProvider language="SQL"
|
<bracePairProvider language="SQL"
|
||||||
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.SqlBracePairProvider"/>
|
implementationClass="com.github.izhangzhihao.rainbow.brackets.provider.SqlBracePairProvider"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
30
src/main/resources/error-reporting/report-bundle.properties
Normal file
30
src/main/resources/error-reporting/report-bundle.properties
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# suppress inspection "UnusedProperty" for whole file
|
||||||
|
#
|
||||||
|
# Copyright (c) 2017 Patrick Scheibe
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
# in the Software without restriction, including without limitation the rights
|
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in
|
||||||
|
# all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
# THE SOFTWARE.
|
||||||
|
#
|
||||||
|
|
||||||
|
report.error.to.plugin.vendor=Report error on GitHub
|
||||||
|
report.error.progress.dialog.text=Submitting error report...
|
||||||
|
report.error.connection.failure=Could not communicate with GitHub
|
||||||
|
|
||||||
|
git.issue.title=[Auto Generated Report]{0}
|
||||||
|
git.issue.label=auto-generated
|
||||||
|
git.issue.text=<a href="{0}">Created issue {1}</a>. Thanks for your feedback!
|
||||||
|
git.issue.duplicate.text=<a href="{0}">A similar issues was already reported (#{1})</a>. Thanks for your feedback!
|
Loading…
Reference in New Issue
Block a user