Skip to content

Commit ff17bc3

Browse files
committed
[settings] replaced * with proper help icon in type annotations settings #SCL-21984 fixed
1 parent b3319f9 commit ff17bc3

File tree

3 files changed

+120
-51
lines changed

3 files changed

+120
-51
lines changed

scala/scala-impl/resources/messages/ScalaBundle.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,23 +1176,23 @@ type.annotations.panel.underscore.parameter=Underscore parameter
11761176
type.annotations.panel.enforce.for=Enforce for
11771177
type.annotations.panel.implicit.definition=Implicit definition
11781178
type.annotations.panel.unit.type=Unit type
1179-
type.annotations.panel.accidental.structural.type=Accidental structural type*
1180-
type.annotations.panel.accidental.structural.type.tooltip=<html>Enforces type annotations for values, which have structural type inferred, e.g.<br>\n<pre><code>\nval foo = Runnable {\n override def run(): Unit = ()\n def helper(): Unit = ()\n} // foo has inferred type Runnable { def helper(): Unit } \n</code></pre></html>
1179+
type.annotations.panel.accidental.structural.type=Accidental structural type
11811180
#Except when
11821181
type.annotations.panel.except.when=Except when
11831182
type.annotations.panel.member.of.anonymous.class=Member of anonymous class
11841183
type.annotations.panel.member.of.private.class=Member of private class
11851184
type.annotations.panel.member.of=Member of:
11861185
type.annotations.panel.annotated.with=Annotated with:
11871186
type.annotations.panel.constant.final.val=Constant (final val)
1188-
type.annotations.panel.type.is.stable=Type is stable*
1189-
type.annotations.panel.type.is.stable.tooltip=<html><body>When right-hand side is:<br> Literal: <code>123</code>, <code>\\"string\\"</code>, etc. (excluding <code>null</code>)<br> Unit expression: <code>()</code><br> Object creation: <code>new Foo(...)</code> (excluding one with refinement: <code>new Foo() {}</code>)<br> Factory method call: <code>Foo(...)</code> (calling <code>apply(...)</code> on companion object)<br> Empty collection: <code>Seq.empty[Int]</code>, <code>Map.empty[Int, String]</code>, etc.<br> Java enum constant: <code>Enum.VALUE</code><br> An exception: <code>throw Exception()</code> </body></html>
1187+
type.annotations.panel.type.is.stable=Type is stable
11901188
type.annotations.panel.type.matches=Type matches:
11911189
type.annotations.panel.in.test.sources=In test sources
1192-
type.annotations.panel.in.scala.dialect.sources=In Scala dialect sources*
1193-
type.annotations.panel.in.scala.dialect.sources.tooltip=*.sbt, *.sc, etc.
1190+
type.annotations.panel.in.scala.dialect.sources=In Scala dialect sources
11941191

11951192
### org/jetbrains/plugins/scala/lang/formatting/settings/TypeAnnotationsPanelBase.java
1193+
type.annotations.panel.accidental.structural.type.tooltip=<html>Enforces type annotations for values which have structural type inferred, e.g.<br>\n<pre><code>\nval foo = Runnable {\n override def run(): Unit = ()\n def helper(): Unit = ()\n} // foo has inferred type Runnable { def helper(): Unit } \n</code></pre></html>
1194+
type.annotations.panel.type.is.stable.tooltip=<html><body>When right-hand side is:<br> Literal: <code>123</code>, <code>\\"string\\"</code>, etc. (excluding <code>null</code>)<br> Unit expression: <code>()</code><br> Object creation: <code>new Foo(...)</code> (excluding one with refinement: <code>new Foo() {}</code>)<br> Factory method call: <code>Foo(...)</code> (calling <code>apply(...)</code> on companion object)<br> Empty collection: <code>Seq.empty[Int]</code>, <code>Map.empty[Int, String]</code>, etc.<br> Java enum constant: <code>Enum.VALUE</code><br> An exception: <code>throw Exception()</code> </body></html>
1195+
type.annotations.panel.in.scala.dialect.sources.tooltip=*.sbt, *.sc, etc.
11961196
#Type Annotations panel
11971197
type.annotations.panel.title=Type Annotations
11981198
type.annotations.panel.classes=Classes

scala/scala-impl/src/org/jetbrains/plugins/scala/lang/formatting/settings/TypeAnnotationsPanelBase.form

Lines changed: 75 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,6 @@
115115
<text resource-bundle="messages/ScalaBundle" key="type.annotations.panel.member.of.private.class"/>
116116
</properties>
117117
</component>
118-
<component id="37134" class="javax.swing.JCheckBox" binding="myStableType">
119-
<constraints>
120-
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
121-
</constraints>
122-
<properties>
123-
<selected value="true"/>
124-
<text resource-bundle="messages/ScalaBundle" key="type.annotations.panel.type.is.stable"/>
125-
<toolTipText resource-bundle="messages/ScalaBundle" key="type.annotations.panel.type.is.stable.tooltip"/>
126-
</properties>
127-
</component>
128118
<hspacer id="49b13">
129119
<constraints>
130120
<grid row="0" column="0" row-span="12" col-span="1" vsize-policy="1" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false">
@@ -140,15 +130,6 @@
140130
<text resource-bundle="messages/ScalaBundle" key="type.annotations.panel.in.test.sources"/>
141131
</properties>
142132
</component>
143-
<component id="4eb3a" class="javax.swing.JCheckBox" binding="myDialectSources">
144-
<constraints>
145-
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
146-
</constraints>
147-
<properties>
148-
<text resource-bundle="messages/ScalaBundle" key="type.annotations.panel.in.scala.dialect.sources"/>
149-
<toolTipText resource-bundle="messages/ScalaBundle" key="type.annotations.panel.in.scala.dialect.sources.tooltip"/>
150-
</properties>
151-
</component>
152133
<grid id="43d6d" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
153134
<margin top="0" left="0" bottom="0" right="0"/>
154135
<constraints>
@@ -235,6 +216,58 @@
235216
</component>
236217
</children>
237218
</grid>
219+
<grid id="35963" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
220+
<margin top="0" left="0" bottom="0" right="0"/>
221+
<constraints>
222+
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="2" indent="0" use-parent-layout="false"/>
223+
</constraints>
224+
<properties/>
225+
<border type="none"/>
226+
<children>
227+
<component id="37134" class="javax.swing.JCheckBox" binding="myStableType">
228+
<constraints>
229+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
230+
</constraints>
231+
<properties>
232+
<selected value="true"/>
233+
<text resource-bundle="messages/ScalaBundle" key="type.annotations.panel.type.is.stable"/>
234+
</properties>
235+
</component>
236+
<component id="38b9b" class="com.intellij.ui.ContextHelpLabel" binding="myStableTypeHelp" custom-create="true">
237+
<constraints>
238+
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="1" use-parent-layout="false"/>
239+
</constraints>
240+
<properties>
241+
<alignmentX value="0.0"/>
242+
</properties>
243+
</component>
244+
</children>
245+
</grid>
246+
<grid id="7b9c4" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
247+
<margin top="0" left="0" bottom="0" right="0"/>
248+
<constraints>
249+
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="2" indent="0" use-parent-layout="false"/>
250+
</constraints>
251+
<properties/>
252+
<border type="none"/>
253+
<children>
254+
<component id="4eb3a" class="javax.swing.JCheckBox" binding="myDialectSources">
255+
<constraints>
256+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
257+
</constraints>
258+
<properties>
259+
<label value="In Scala dialect sources"/>
260+
<text resource-bundle="messages/ScalaBundle" key="type.annotations.panel.in.scala.dialect.sources"/>
261+
</properties>
262+
</component>
263+
<component id="4f252" class="com.intellij.ui.ContextHelpLabel" binding="myDialectSourcesHelp" custom-create="true">
264+
<constraints>
265+
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="1" use-parent-layout="false"/>
266+
</constraints>
267+
<properties/>
268+
</component>
269+
</children>
270+
</grid>
238271
</children>
239272
</grid>
240273
<vspacer id="5ab88">
@@ -278,16 +311,31 @@
278311
<text resource-bundle="messages/ScalaBundle" key="type.annotations.panel.unit.type"/>
279312
</properties>
280313
</component>
281-
<component id="d134d" class="javax.swing.JCheckBox" binding="myStructuralType">
314+
<grid id="dce2b" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
315+
<margin top="0" left="0" bottom="0" right="0"/>
282316
<constraints>
283-
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
317+
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="2" indent="0" use-parent-layout="false"/>
284318
</constraints>
285-
<properties>
286-
<selected value="true"/>
287-
<text resource-bundle="messages/ScalaBundle" key="type.annotations.panel.accidental.structural.type"/>
288-
<toolTipText resource-bundle="messages/ScalaBundle" key="type.annotations.panel.accidental.structural.type.tooltip"/>
289-
</properties>
290-
</component>
319+
<properties/>
320+
<border type="none"/>
321+
<children>
322+
<component id="d134d" class="javax.swing.JCheckBox" binding="myStructuralType">
323+
<constraints>
324+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
325+
</constraints>
326+
<properties>
327+
<selected value="true"/>
328+
<text resource-bundle="messages/ScalaBundle" key="type.annotations.panel.accidental.structural.type"/>
329+
</properties>
330+
</component>
331+
<component id="39a57" class="com.intellij.ui.ContextHelpLabel" binding="myStructuralTypeHelp" custom-create="true">
332+
<constraints>
333+
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="1" use-parent-layout="false"/>
334+
</constraints>
335+
<properties/>
336+
</component>
337+
</children>
338+
</grid>
291339
</children>
292340
</grid>
293341
<hspacer id="49c65">

0 commit comments

Comments
 (0)