Skip to content

Commit

Permalink
Merge #7827 #7828
Browse files Browse the repository at this point in the history
7827: RES: Fix that glob import can override named item in some cases r=vlad20012 a=dima74

Fixes #7233

changelog: Fix that glob import can override named item in some cases


7828: TOML: remove toml plugin sources from repository  r=Undin a=Undin

[TOML](https://github.com/toml-lang/toml) language is becoming more widely used for different configuration files in a lot of technologies like
- different configs in Rust ecosystem ([Cargo.toml](https://doc.rust-lang.org/cargo/reference/manifest.html), [rustfmt.toml](https://rust-lang.github.io/rustfmt), Cargo [config](https://doc.rust-lang.org/cargo/reference/config.html#configuration-format), etc.)
- [Pipfile](https://www.jetbrains.com/help/pycharm/using-pipfile.html) in Pipenv
- [Gopkg.toml](https://golang.github.io/dep/docs/Gopkg.toml.html) and [Gopkg.lock](https://golang.github.io/dep/docs/Gopkg.lock.html) in golang
- [libs.versions.toml](https://docs.gradle.org/nightly/userguide/platforms.html#sub:conventional-dependencies-toml) in Gradle 7.0
- etc.

To simplify future integrations for technologies described above (for example, [dependency version completion](https://youtrack.jetbrains.com/issue/IDEA-262280) in [libs.versions.toml](https://docs.gradle.org/nightly/userguide/platforms.html#sub:conventional-dependencies-toml)), TOML plugin sources were moved to [intellij-community](https://github.com/JetBrains/intellij-community/tree/master/plugins/toml) repository recently.

And these changes finish this transfer by removing the corresponding sources from this repo.

How it affects someone:
- from users' point of view:
    - the plugin is still free
    - new plugin builds will be published into the same place so installation/update workflow won't change
    - no new redundant plugin updates
    - probably, the plugin will be bundled into some IDEs (it's not implemented yet) to provide the plugin features out of the box
    - the plugin will be always compatible with the latest IDE version because it's built during building of IDEs themselves
    - new features and most fixes won't be backported for previous major IDE versions
    - users of technologies described above probably will get new integrations with TOML plugin
- from developer/contributor point of view:
    - the plugin is still open-source
    - new contributions should be made in [intellij-community](https://github.com/JetBrains/intellij-community) repo
    - new features/APIs introduced in TOML plugin will be possible to use only with the latest IDE version
    - no compatibility issues like #7687 between Rust anf TOML plugin
    - now it's possible to write integrations with TOML plugin for technologies described above

changelog: Move development of [TOML](https://plugins.jetbrains.com/plugin/8195-toml) plugin into [intellij-community](https://github.com/JetBrains/intellij-community/tree/master/plugins/toml) repository to simplify integration for other technologies.
Note, the plugin is still free and open-source

Co-authored-by: Dmitry Murzin <diralik@yandex.ru>
Co-authored-by: Arseniy Pendryak <a.pendryak@yandex.ru>
  • Loading branch information
3 people committed Sep 14, 2021
3 parents 4c13915 + dc4d433 + b759b80 commit 51e3cf3
Show file tree
Hide file tree
Showing 295 changed files with 212 additions and 6,006 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/rust-nightly.yml
Expand Up @@ -23,8 +23,6 @@ jobs:
outputs:
rust-commit: ${{ steps.fetch-commits.outputs.rust-commit }}
rust-nightly: ${{ steps.fetch-commits.outputs.rust-nightly }}
toml-commit: ${{ steps.fetch-commits.outputs.toml-commit }}
toml-nightly: ${{ steps.fetch-commits.outputs.toml-nightly }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -41,15 +39,11 @@ jobs:
run: |
echo "::set-output name=rust-commit::$(git log -n 1 --format=format:%H)"
echo "::set-output name=rust-nightly::$(python scripts/get_tag_commit.py --tag "rust-nightly")"
echo "::set-output name=toml-commit::$(git log -n 1 --format=format:%H intellij-toml *gradle*)"
echo "::set-output name=toml-nightly::$(python scripts/get_tag_commit.py --tag "toml-nightly")"
- name: Show commits
run: |
echo "rust-commit: ${{ steps.fetch-commits.outputs.rust-commit }}"
echo "rust-nightly: ${{ steps.fetch-commits.outputs.rust-nightly }}"
echo "toml-commit: ${{ steps.fetch-commits.outputs.toml-commit }}"
echo "toml-nightly: ${{ steps.fetch-commits.outputs.toml-nightly }}"
build-native-code:
Expand Down Expand Up @@ -155,12 +149,6 @@ jobs:
name: macos-arm64
path: bin/macos/arm64

- name: Publish toml plugin
if: needs.fetch-latest-changes.outputs.toml-commit != needs.fetch-latest-changes.outputs.toml-nightly
uses: gradle/gradle-build-action@v1
with:
arguments: ":intellij-toml:publishPlugin"

- name: Publish rust plugin
uses: gradle/gradle-build-action@v1
with:
Expand All @@ -184,4 +172,3 @@ jobs:
- name: Save commits
run: |
python scripts/save_tag.py --tag rust-nightly --commit ${{ needs.fetch-latest-changes.outputs.rust-commit }}
python scripts/save_tag.py --tag toml-nightly --commit ${{ needs.fetch-latest-changes.outputs.toml-commit }}
13 changes: 0 additions & 13 deletions .github/workflows/rust-release.yml
Expand Up @@ -88,8 +88,6 @@ jobs:
outputs:
rust-commit: ${{ steps.fetch-commits.outputs.rust-commit }}
rust-release: ${{ steps.fetch-commits.outputs.rust-release }}
toml-commit: ${{ steps.fetch-commits.outputs.toml-commit }}
toml-release: ${{ steps.fetch-commits.outputs.toml-release }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -107,15 +105,11 @@ jobs:
run: |
echo "::set-output name=rust-commit::$(git log -n 1 --format=format:%H)"
echo "::set-output name=rust-release::$(python scripts/get_tag_commit.py --tag "rust-${{ needs.get-channel.outputs.channel }}")"
echo "::set-output name=toml-commit::$(git log -n 1 --format=format:%H intellij-toml *gradle*)"
echo "::set-output name=toml-release::$(python scripts/get_tag_commit.py --tag "toml-${{ needs.get-channel.outputs.channel }}")"
- name: Show commits
run: |
echo "rust-commit: ${{ steps.fetch-commits.outputs.rust-commit }}"
echo "rust-release: ${{ steps.fetch-commits.outputs.rust-release }}"
echo "toml-commit: ${{ steps.fetch-commits.outputs.toml-commit }}"
echo "toml-release: ${{ steps.fetch-commits.outputs.toml-release }}"
build-native-code:
if: needs.fetch-latest-changes.outputs.rust-commit != needs.fetch-latest-changes.outputs.rust-release
Expand Down Expand Up @@ -222,12 +216,6 @@ jobs:
name: macos-arm64
path: bin/macos/arm64

- name: Publish toml plugin
if: needs.fetch-latest-changes.outputs.toml-commit != needs.fetch-latest-changes.outputs.toml-release
uses: gradle/gradle-build-action@v1
with:
arguments: ":intellij-toml:publishPlugin"

- name: Publish rust plugin
uses: gradle/gradle-build-action@v1
with:
Expand All @@ -251,4 +239,3 @@ jobs:
- name: Save commits
run: |
python scripts/save_tag.py --tag rust-${{ needs.get-channel.outputs.channel }} --commit ${{ needs.fetch-latest-changes.outputs.rust-commit }}
python scripts/save_tag.py --tag toml-${{ needs.get-channel.outputs.channel }} --commit ${{ needs.fetch-latest-changes.outputs.toml-commit }}
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -47,7 +47,7 @@ LLDB only

## TOML

If you are looking for the TOML plugin, see [intellij-toml] directory.
If you are looking for the TOML plugin, see [toml] directory in [intellij-community](https://github.com/JetBrains/intellij-community) repository.

## Contributing

Expand All @@ -61,7 +61,7 @@ understand the high-level structure of the codebase. If you are not sure where t
[help wanted]: https://github.com/intellij-rust/intellij-rust/labels/help%20wanted
[CONTRIBUTING.md]: CONTRIBUTING.md
[ARCHITECTURE.md]: ARCHITECTURE.md
[intellij-toml]: intellij-toml/
[toml]: https://github.com/JetBrains/intellij-community/tree/master/plugins/toml

<!-- Badges -->
[gitter-chat]: https://gitter.im/intellij-rust/intellij-rust
Expand Down
82 changes: 4 additions & 78 deletions build.gradle.kts
@@ -1,7 +1,6 @@
import groovy.json.JsonSlurper
import org.apache.tools.ant.taskdefs.condition.Os.*
import org.gradle.api.JavaVersion.VERSION_1_8
import org.gradle.api.internal.HasConvention
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
Expand All @@ -11,7 +10,6 @@ import org.jetbrains.intellij.tasks.PatchPluginXmlTask
import org.jetbrains.intellij.tasks.PrepareSandboxTask
import org.jetbrains.intellij.tasks.PublishPluginTask
import org.jetbrains.intellij.tasks.RunIdeTask
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jsoup.Jsoup
import java.io.Writer
Expand All @@ -35,6 +33,7 @@ val baseVersion = when (baseIDE) {
else -> error("Unexpected IDE name: `$baseIDE`")
}

val tomlPlugin = "org.toml.lang:${prop("tomlPluginVersion")}"
val nativeDebugPlugin = "com.intellij.nativeDebug:${prop("nativeDebugPluginVersion")}"
val graziePlugin = "tanvd.grazi"
val psiViewerPlugin = "PsiViewer:${prop("psiViewerPluginVersion")}"
Expand Down Expand Up @@ -119,7 +118,7 @@ allprojects {

buildSearchableOptions {
// buildSearchableOptions task doesn't make sense for non-root subprojects
val isRootProject = project.name in listOf("plugin", "intellij-toml")
val isRootProject = project.name == "plugin"
enabled = isRootProject && prop("enableBuildSearchableOptions").toBoolean()
}

Expand Down Expand Up @@ -244,7 +243,7 @@ project(":plugin") {
intellij {
pluginName.set("intellij-rust")
val pluginList = mutableListOf(
project(":intellij-toml"),
tomlPlugin,
intelliLangPlugin,
graziePlugin,
psiViewerPlugin,
Expand Down Expand Up @@ -335,14 +334,12 @@ project(":") {
}

dependencies {
implementation(project(":common"))
implementation("org.jetbrains:markdown:0.2.0") {
exclude(module = "kotlin-runtime")
exclude(module = "kotlin-stdlib")
exclude(module = "kotlin-stdlib-common")
}
api("com.vdurmont:semver4j:3.1.0")
testImplementation(project(":common", "testOutput"))
testImplementation("com.squareup.okhttp3:mockwebserver:4.9.0")
}

Expand Down Expand Up @@ -413,9 +410,7 @@ project(":idea") {
}
dependencies {
implementation(project(":"))
implementation(project(":common"))
testImplementation(project(":", "testOutput"))
testImplementation(project(":common", "testOutput"))
}
}

Expand All @@ -426,10 +421,8 @@ project(":clion") {
}
dependencies {
implementation(project(":"))
implementation(project(":common"))
implementation(project(":debugger"))
testImplementation(project(":", "testOutput"))
testImplementation(project(":common", "testOutput"))
}
}

Expand All @@ -444,27 +437,19 @@ project(":debugger") {
}
dependencies {
implementation(project(":"))
implementation(project(":common"))
testImplementation(project(":", "testOutput"))
testImplementation(project(":common", "testOutput"))
}
}

project(":toml") {
intellij {
plugins.set(listOf(project(":intellij-toml")))
plugins.set(listOf(tomlPlugin))
}
dependencies {
implementation("org.eclipse.jgit:org.eclipse.jgit:5.9.0.202009080501-r") { exclude("org.slf4j") }

implementation(project(":"))
implementation(project(":common"))
testImplementation(project(":", "testOutput"))
testImplementation(project(":common", "testOutput"))

// TODO: Drop when gradle-intellij-plugin will be adding add all transitive dependencies
compileOnly(project(":intellij-toml:core"))
testCompileOnly(project(":intellij-toml:core"))
}
}

Expand All @@ -474,9 +459,7 @@ project(":intelliLang") {
}
dependencies {
implementation(project(":"))
implementation(project(":common"))
testImplementation(project(":", "testOutput"))
testImplementation(project(":common", "testOutput"))
}
}

Expand All @@ -487,27 +470,21 @@ project(":copyright") {
}
dependencies {
implementation(project(":"))
implementation(project(":common"))
testImplementation(project(":", "testOutput"))
testImplementation(project(":common", "testOutput"))
}
}

project(":duplicates") {
dependencies {
implementation(project(":"))
implementation(project(":common"))
testImplementation(project(":", "testOutput"))
testImplementation(project(":common", "testOutput"))
}
}

project(":coverage") {
dependencies {
implementation(project(":"))
implementation(project(":common"))
testImplementation(project(":", "testOutput"))
testImplementation(project(":common", "testOutput"))
}
}

Expand All @@ -517,9 +494,7 @@ project(":grazie") {
}
dependencies {
implementation(project(":"))
implementation(project(":common"))
testImplementation(project(":", "testOutput"))
testImplementation(project(":common", "testOutput"))
}
}

Expand All @@ -529,9 +504,7 @@ project(":js") {
}
dependencies {
implementation(project(":"))
implementation(project(":common"))
testImplementation(project(":", "testOutput"))
testImplementation(project(":common", "testOutput"))
}
}

Expand All @@ -542,57 +515,10 @@ project(":ml-completion") {
dependencies {
implementation("org.jetbrains.intellij.deps.completion:completion-ranking-rust:0.2.2")
implementation(project(":"))
implementation(project(":common"))
testImplementation(project(":", "testOutput"))
testImplementation(project(":common", "testOutput"))
}
}

project(":intellij-toml") {
version = "0.2.$patchVersion.${prop("buildNumber")}$versionSuffix"

dependencies {
implementation(project(":intellij-toml:core"))
}

tasks {
withType<PublishPluginTask> {
token.set(prop("publishToken"))
channels.set(listOf(channel))
}
}
}

project(":intellij-toml:core") {
dependencies {
implementation(project(":common"))
testImplementation(project(":common", "testOutput"))
}

val generateTomlLexer = task<GenerateLexer>("generateTomlLexer") {
source = "src/main/grammars/TomlLexer.flex"
targetDir = "src/gen/org/toml/lang/lexer"
targetClass = "_TomlLexer"
purgeOldFiles = true
}

val generateTomlParser = task<GenerateParser>("generateTomlParser") {
source = "src/main/grammars/TomlParser.bnf"
targetRoot = "src/gen"
pathToParser = "/org/toml/lang/parse/TomlParser.java"
pathToPsiRoot = "/org/toml/lang/psi"
purgeOldFiles = true
}

tasks {
withType<KotlinCompile> {
dependsOn(generateTomlLexer, generateTomlParser)
}
}
}

project(":common")

task("runPrettyPrintersTests") {
doLast {
val lldbPath = when {
Expand Down
Expand Up @@ -25,8 +25,6 @@ import com.intellij.openapi.util.Key
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapiext.isInternal
import com.intellij.openapiext.isUnitTestMode
import com.intellij.psi.search.GlobalSearchScopes
import com.intellij.util.ArrayUtil
import com.intellij.util.ui.StatusText
Expand All @@ -39,6 +37,8 @@ import org.rust.cargo.runconfig.CargoCommandConfigurationExtension
import org.rust.cargo.runconfig.ConfigurationExtensionContext
import org.rust.cargo.runconfig.command.CargoCommandConfiguration
import org.rust.clion.valgrind.legacy.RsValgrindRunnerLegacy
import org.rust.openapiext.isInternal
import org.rust.openapiext.isUnitTestMode
import java.io.File
import java.io.IOException

Expand Down
15 changes: 0 additions & 15 deletions common/src/main/kotlin/com/intellij/lang/parser/utils.kt

This file was deleted.

13 changes: 0 additions & 13 deletions common/src/main/kotlin/com/intellij/openapiext/utils.kt

This file was deleted.

Expand Up @@ -11,11 +11,11 @@ import com.intellij.coverage.CoverageSuite
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapiext.isDispatchThread
import com.intellij.rt.coverage.data.LineData
import com.intellij.rt.coverage.data.ProjectData
import org.rust.coverage.LcovCoverageReport.Serialization.readLcov
import org.rust.openapiext.computeWithCancelableProgress
import org.rust.openapiext.isDispatchThread
import java.io.File
import java.io.IOException

Expand Down
2 changes: 2 additions & 0 deletions gradle-211.properties
Expand Up @@ -4,6 +4,8 @@
ideaVersion=IU-2021.1.2
clionVersion=CL-2021.1.2

# https://plugins.jetbrains.com/plugin/8195-toml/versions
tomlPluginVersion=0.2.155.4114-211
# https://plugins.jetbrains.com/plugin/12775-native-debugging-support/versions
nativeDebugPluginVersion=211.7442.9
# https://plugins.jetbrains.com/plugin/227-psiviewer/versions
Expand Down

0 comments on commit 51e3cf3

Please sign in to comment.