Skip to content

Commit f5ad30f

Browse files
authored
clion: fix CNFE for nova mode (bazelbuild#7599)
oclang specific code was accidentally located in a shared library move it to oclang module and create a simple radler implementation.
1 parent 5c6108c commit f5ad30f

File tree

4 files changed

+51
-4
lines changed

4 files changed

+51
-4
lines changed

clwb/src/META-INF/clwb-oclang.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
~ Copyright 2023 The Bazel Authors. All rights reserved.
2+
~ Copyright 2025 The Bazel Authors. All rights reserved.
33
~
44
~ Licensed under the Apache License, Version 2.0 (the "License");
55
~ you may not use this file except in compliance with the License.
@@ -21,5 +21,6 @@
2121
<extensions defaultExtensionNs="com.google.idea.blaze">
2222
<clwb.googleTestUtilAdapter implementation="com.google.idea.blaze.clwb.oclang.run.CidrGoogleTestUtilAdapter"/>
2323
<TestContextProvider implementation="com.google.idea.blaze.clwb.oclang.run.producers.CppTestContextProvider"/>
24+
<BlazeTestEventsHandler implementation="com.google.idea.blaze.clwb.oclang.run.test.BlazeCidrTestEventsHandler"/>
2425
</extensions>
2526
</idea-plugin>

clwb/src/META-INF/clwb.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
~ Copyright 2016 The Bazel Authors. All rights reserved.
2+
~ Copyright 2025 The Bazel Authors. All rights reserved.
33
~
44
~ Licensed under the Apache License, Version 2.0 (the "License");
55
~ you may not use this file except in compliance with the License.
@@ -41,7 +41,6 @@
4141
<extensions defaultExtensionNs="com.google.idea.blaze">
4242
<SyncPlugin implementation="com.google.idea.blaze.clwb.sync.BlazeCLionSyncPlugin"/>
4343
<BlazeCommandRunConfigurationHandlerProvider implementation="com.google.idea.blaze.clwb.run.BlazeCidrRunConfigurationHandlerProvider" order="first"/>
44-
<BlazeTestEventsHandler implementation="com.google.idea.blaze.clwb.oclang.run.test.BlazeCidrTestEventsHandler"/>
4544
</extensions>
4645

4746
<extensions defaultExtensionNs="com.google.idea.blaze.cpp">
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright 2025 The Bazel Authors. All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.idea.blaze.clwb.radler
18+
19+
import com.google.idea.blaze.base.model.primitives.Kind
20+
import com.google.idea.blaze.base.model.primitives.LanguageClass
21+
import com.google.idea.blaze.base.model.primitives.RuleType
22+
import com.google.idea.blaze.base.run.smrunner.BlazeTestEventsHandler
23+
import com.intellij.execution.Location
24+
import com.intellij.execution.testframework.sm.runner.SMTestLocator
25+
import com.intellij.openapi.project.Project
26+
27+
class RadTestEventsHandler: BlazeTestEventsHandler {
28+
override fun handlesKind(kind: Kind?): Boolean {
29+
return kind != null
30+
&& kind.hasLanguage(LanguageClass.C)
31+
&& kind.getRuleType().equals(RuleType.TEST)
32+
}
33+
34+
override fun getTestLocator(): SMTestLocator? {
35+
// not supported yet
36+
return null
37+
}
38+
39+
override fun getTestFilter(
40+
project: Project?,
41+
testLocations: List<Location<*>?>?
42+
): String? {
43+
// not supported yet
44+
return null
45+
}
46+
}

clwb/src/com/google/idea/blaze/clwb/radler/optional-plugin.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
~ Copyright 2024 The Bazel Authors. All rights reserved.
2+
~ Copyright 2025 The Bazel Authors. All rights reserved.
33
~
44
~ Licensed under the Apache License, Version 2.0 (the "License");
55
~ you may not use this file except in compliance with the License.
@@ -18,5 +18,6 @@
1818
<TestContextProvider implementation="com.google.idea.blaze.clwb.radler.RadGoogleTestContextProvider"/>
1919
<TestContextProvider implementation="com.google.idea.blaze.clwb.radler.RadCatchTestContextProvider"/>
2020
<BinaryContextProvider implementation="com.google.idea.blaze.clwb.radler.RadBinaryContextProvider"/>
21+
<BlazeTestEventsHandler implementation="com.google.idea.blaze.clwb.radler.RadTestEventsHandler"/>
2122
</extensions>
2223
</idea-plugin>

0 commit comments

Comments
 (0)