Skip to content

Commit 7e281e5

Browse files
Merge branch 'main' into main
2 parents 82e918a + fafe5f7 commit 7e281e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+732
-743
lines changed

CHANGELOG.md

+21
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@
22

33
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
44

5+
## [1.2.0](https://github.com/robotcodedev/robotcode/compare/v1.1.0..v1.2.0) - 2025-05-07
6+
7+
### Bug Fixes
8+
9+
- **intellij:** Corrected handling of short by-longname argument ([b5fa232](https://github.com/robotcodedev/robotcode/commit/b5fa232f4c0fd3032b863363c141d8ffeff6c8c7))
10+
- **intellij:** Reenable semantic highlightning, because something has changed in the new LSP4IJ API ([5cdf3c3](https://github.com/robotcodedev/robotcode/commit/5cdf3c3ab87857db294e63bcdc0798f1cfd5eacd))
11+
- Update IntelliJ platform version and plugin dependencies ([e94c96b](https://github.com/robotcodedev/robotcode/commit/e94c96b99646e602820663f1210d0df962251bf1))
12+
13+
14+
because of some new features regarding syntax highlightning and text mate the minimal supported version is PyCharm 2025.1
15+
16+
17+
### Features
18+
19+
- **intellij:** Refactored textmate highlightning to use the new intellij textmate infrastructure ([74644f0](https://github.com/robotcodedev/robotcode/commit/74644f055e6c1dea38e37446ef430387c667b80c))
20+
- **langserver:** Refactor and optimize Robot Framework textmate syntax highlighting rules ([5b7c4b1](https://github.com/robotcodedev/robotcode/commit/5b7c4b13469072e3c39c8c112118149ac4b5b1cd))
21+
22+
this also fixes the loading of robotframework core test files in PyCharm
23+
24+
25+
526
## [1.1.0](https://github.com/robotcodedev/robotcode/compare/v1.0.3..v1.1.0) - 2025-04-29
627

728
### Bug Fixes

intellij-client/build.gradle.kts

+24-24
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ kotlin {
2727
// Configure project's dependencies
2828
repositories {
2929
mavenCentral()
30-
30+
3131
// IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html
3232
intellijPlatform {
3333
defaultRepositories()
@@ -37,22 +37,22 @@ repositories {
3737
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
3838
dependencies {
3939
compileOnly(libs.kotlinxSerialization)
40-
40+
4141
testImplementation(kotlin("test"))
4242
testImplementation(libs.junit)
43-
43+
4444
// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
4545
intellijPlatform {
4646
create(
4747
providers.gradleProperty("platformType"),
4848
providers.gradleProperty("platformVersion"),
4949
useInstaller = false,
5050
)
51-
51+
5252
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
5353
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
5454
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
55-
55+
5656
pluginVerifier()
5757
zipSigner()
5858
testFramework(TestFrameworkType.Platform)
@@ -64,22 +64,22 @@ intellijPlatform {
6464
pluginConfiguration {
6565
name = providers.gradleProperty("pluginName")
6666
version = providers.gradleProperty("pluginVersion")
67-
67+
6868
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
6969
description = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
7070
val start = "<!-- Plugin description -->"
7171
val end = "<!-- Plugin description end -->"
72-
72+
7373
with(it.lines()) {
7474
if (!containsAll(listOf(start, end))) {
7575
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
7676
}
7777
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
7878
}
7979
}
80-
80+
8181
val changelog = project.changelog
82-
82+
8383
// local variable for configuration cache compatibility // Get the latest available change notes from the changelog file
8484
changeNotes = providers.gradleProperty("pluginVersion").map { pluginVersion ->
8585
with(changelog) {
@@ -89,34 +89,34 @@ intellijPlatform {
8989
)
9090
}
9191
}
92-
92+
9393
ideaVersion {
9494
sinceBuild = providers.gradleProperty("pluginSinceBuild")
9595
untilBuild = providers.gradleProperty("pluginUntilBuild")
9696
}
9797
}
98-
98+
9999
signing {
100100
certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
101101
privateKey = providers.environmentVariable("PRIVATE_KEY")
102102
password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
103103
}
104-
104+
105105
publishing {
106106
token = providers.environmentVariable("PUBLISH_TOKEN")
107-
107+
108108
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
109109
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
110110
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
111111
channels = providers.gradleProperty("pluginVersion")
112112
.map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
113113
}
114-
114+
115115
pluginVerification {
116116
ides {
117117
recommended()
118118
}
119-
119+
120120
}
121121
}
122122

@@ -149,22 +149,22 @@ val prepareSandboxConfig: PrepareSandboxTask.() -> Unit = {
149149

150150
tasks {
151151
runIde {
152-
152+
153153
// From https://app.slack.com/client/T5P9YATH9/C5U8BM1MK
154154
// systemProperty("ide.experimental.ui", "true")
155155
// systemProperty("projectView.hide.dot.idea", "false")
156156
// systemProperty("terminal.new.ui", "false")
157157
// systemProperty("ide.tree.painter.compact.default", "true")
158158
}
159-
159+
160160
wrapper {
161161
gradleVersion = providers.gradleProperty("gradleVersion").get()
162162
}
163-
163+
164164
publishPlugin {
165165
dependsOn(patchChangelog)
166166
}
167-
167+
168168
prepareSandbox(prepareSandboxConfig)
169169
}
170170

@@ -190,29 +190,29 @@ tasks.withType<KotlinCompile> {
190190
)
191191
}
192192
}
193-
193+
194194
prepareSandboxTask(prepareSandboxConfig)
195-
195+
196196
plugins {
197197
robotServerPlugin(Constraints.LATEST_VERSION)
198198
}
199199
}
200200

201201
@Suppress("unused") val runIdePyCharmProf by intellijPlatformTesting.runIde.registering {
202202
type = IntelliJPlatformType.PyCharmProfessional
203-
203+
204204
prepareSandboxTask(prepareSandboxConfig)
205205
}
206206

207207
@Suppress("unused") val runIdePyCharmCommunityEAP by intellijPlatformTesting.runIde.registering {
208208
type = IntelliJPlatformType.PyCharmCommunity
209209
version = "LATEST-EAP-SNAPSHOT"
210-
210+
211211
prepareSandboxTask(prepareSandboxConfig)
212212
}
213213

214214
@Suppress("unused") val runIdeIntellijIdeaC by intellijPlatformTesting.runIde.registering {
215215
type = IntelliJPlatformType.IntellijIdeaCommunity
216-
216+
217217
prepareSandboxTask(prepareSandboxConfig)
218218
}

intellij-client/gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pluginGroup = dev.robotcode
44
pluginName = RobotCode - Robot Framework Support
55
pluginRepositoryUrl = https://github.com/robotcodedev/robotcode4ij
66
# SemVer format -> https://semver.org
7-
pluginVersion = 1.1.0
7+
pluginVersion = 1.2.0
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
pluginSinceBuild = 251
@@ -17,7 +17,7 @@ platformVersion = 2025.1
1717

1818
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1919
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
20-
#platformPlugins = com.redhat.devtools.lsp4ij:0.13.0-20250501-072621@nightly
20+
#platformPlugins = com.redhat.devtools.lsp4ij:0.13.0-20250502-121924@nightly
2121
platformPlugins = com.redhat.devtools.lsp4ij:0.12.0
2222

2323

intellij-client/gradle/libs.versions.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[versions]
22
# libraries
33
annotations = "26.0.2"
4-
kotlinxSerialization = "1.8.1"
4+
kotlinxSerialization = "1.7.3"
55
junit = "4.13.2"
66
lsp4j = "0.21.1"
77

88
# plugins
99
changelog = "2.2.1"
1010
intelliJPlatForm = "2.5.0"
11-
kotlin = "2.1.0"
11+
kotlin = "2.1.10"
1212
kover = "0.9.1"
1313

1414
[libraries.lsp4j]

intellij-client/src/main/kotlin/dev/robotcode/robotcode4ij/RobotCodeHelpers.kt

+15-15
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class RobotCodeHelpers {
2222
val toolPath: Path = bundledPath.resolve("tool")
2323
val robotCodePath: Path = toolPath.resolve("robotcode")
2424
val checkRobotVersion: Path = toolPath.resolve("utils").resolve("check_robot_version.py")
25-
25+
2626
val PYTHON_AND_ROBOT_OK_KEY = Key.create<Boolean?>("ROBOTCODE_PYTHON_AND_ROBOT_OK")
2727
}
2828
}
@@ -38,28 +38,28 @@ fun Project.checkPythonAndRobotVersion(reset: Boolean = false): Boolean {
3838
if (!reset && this.getUserData(RobotCodeHelpers.PYTHON_AND_ROBOT_OK_KEY) == true) {
3939
return true
4040
}
41-
41+
4242
val result = ApplicationManager.getApplication().executeOnPooledThread<Boolean> {
43-
43+
4444
val pythonInterpreter = this.robotPythonSdk?.homePath
45-
45+
4646
if (pythonInterpreter == null) {
4747
thisLogger().info("No Python Interpreter defined for project '${this.name}'")
4848
return@executeOnPooledThread false
4949
}
50-
50+
5151
if (!Path(pythonInterpreter).exists()) {
5252
thisLogger().warn("Python Interpreter $pythonInterpreter not exists")
5353
return@executeOnPooledThread false
5454
}
55-
55+
5656
if (!Path(pythonInterpreter).isRegularFile()) {
5757
thisLogger().warn("Python Interpreter $pythonInterpreter is not a regular file")
5858
return@executeOnPooledThread false
5959
}
60-
60+
6161
thisLogger().info("Use Python Interpreter $pythonInterpreter for project '${this.name}'")
62-
62+
6363
val res = ExecUtil.execAndGetOutput(
6464
GeneralCommandLine(
6565
pythonInterpreter, "-u", "-c", "import sys; print(sys.version_info[:2]>=(3,8))"
@@ -69,7 +69,7 @@ fun Project.checkPythonAndRobotVersion(reset: Boolean = false): Boolean {
6969
thisLogger().warn("Invalid python version")
7070
return@executeOnPooledThread false
7171
}
72-
72+
7373
val res1 = ExecUtil.execAndGetOutput(
7474
GeneralCommandLine(pythonInterpreter, "-u", RobotCodeHelpers.checkRobotVersion.pathString),
7575
timeoutInMilliseconds = 5000
@@ -78,13 +78,13 @@ fun Project.checkPythonAndRobotVersion(reset: Boolean = false): Boolean {
7878
thisLogger().warn("Invalid Robot Framework version")
7979
return@executeOnPooledThread false
8080
}
81-
81+
8282
return@executeOnPooledThread true
83-
83+
8484
}.get()
85-
85+
8686
this.putUserData(RobotCodeHelpers.PYTHON_AND_ROBOT_OK_KEY, result)
87-
87+
8888
return result
8989
}
9090

@@ -100,7 +100,7 @@ fun Project.buildRobotCodeCommandLine(
100100
if (!this.checkPythonAndRobotVersion()) {
101101
throw IllegalArgumentException("PythonSDK is not defined or robot version is not valid for project ${this.name}")
102102
}
103-
103+
104104
val pythonInterpreter = this.robotPythonSdk?.homePath
105105
val commandLine = GeneralCommandLine(
106106
pythonInterpreter,
@@ -115,6 +115,6 @@ fun Project.buildRobotCodeCommandLine(
115115
*extraArgs,
116116
*args
117117
).withWorkDirectory(this.basePath).withCharset(Charsets.UTF_8)
118-
118+
119119
return commandLine
120120
}

intellij-client/src/main/kotlin/dev/robotcode/robotcode4ij/TextMateBundleHolder.kt

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
package dev.robotcode.robotcode4ij
22

3-
import com.intellij.util.containers.Interner
43
import org.jetbrains.plugins.textmate.TextMateService
4+
import org.jetbrains.plugins.textmate.language.TextMateConcurrentMapInterner
55
import org.jetbrains.plugins.textmate.language.TextMateLanguageDescriptor
6-
import org.jetbrains.plugins.textmate.language.syntax.TextMateSyntaxTable
6+
import org.jetbrains.plugins.textmate.language.syntax.TextMateSyntaxTableBuilder
77

88

99
object TextMateBundleHolder {
10-
private val interner = Interner.createWeakInterner<CharSequence>()
10+
private val interner = TextMateConcurrentMapInterner()
1111

1212
val descriptor: TextMateLanguageDescriptor by lazy {
1313

1414
val reader = TextMateService.getInstance().readBundle(RobotCodeHelpers.basePath)
1515
?: throw IllegalStateException("Failed to read robotcode textmate bundle")
1616

17-
val syntaxTable = TextMateSyntaxTable()
17+
val builder = TextMateSyntaxTableBuilder(interner)
1818

1919
val grammarIterator = reader.readGrammars().iterator()
2020
while (grammarIterator.hasNext()) {
2121
val grammar = grammarIterator.next()
22-
val rootScopeName = syntaxTable.loadSyntax(grammar.plist.value, interner) ?: continue
22+
23+
val rootScopeName = builder.addSyntax(grammar.plist.value) ?: continue
2324
if (rootScopeName == "source.robotframework") {
24-
val syntax = syntaxTable.getSyntax(rootScopeName)
25-
return@lazy TextMateLanguageDescriptor(rootScopeName, syntax)
25+
val syntax = builder.build()
26+
return@lazy TextMateLanguageDescriptor(rootScopeName, syntax.getSyntax(rootScopeName))
2627
}
2728
}
2829

0 commit comments

Comments
 (0)