Change NO_EXPLICIT_VISIBILITY_IN_API_MODE diagnostic range to 'declaration modifiers + name'.
Motivation: missing visibility modifier is an error in visibility modifiers list, so we should highlight this list. Including a name in the range is convenient for using alt+enter (you don't have to move cursor from name to fun/class/val keyword) Also change NO_EXPLICIT_RETURN_TYPE_IN_API_MODE diagnostic range to 'declaration name' to match corresponding IDE inspection. Fix stylistic problems and typos after review
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
class <!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>Foo1()<!> {}
|
||||
// SKIP_TXT
|
||||
|
||||
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>class Foo1<!>() {}
|
||||
|
||||
public class Foo2() {
|
||||
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>fun method()<!> {}
|
||||
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>fun method<!>() {}
|
||||
public fun method2() {}
|
||||
private fun method3() {}
|
||||
|
||||
<!NO_EXPLICIT_RETURN_TYPE_IN_API_MODE, NO_EXPLICIT_VISIBILITY_IN_API_MODE!>fun implicit()<!> = 10
|
||||
<!NO_EXPLICIT_RETURN_TYPE_IN_API_MODE!>public fun implicit2()<!> = 10
|
||||
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>fun <!NO_EXPLICIT_RETURN_TYPE_IN_API_MODE!>implicit<!><!>() = 10
|
||||
public fun <!NO_EXPLICIT_RETURN_TYPE_IN_API_MODE!>implicit2<!>() = 10
|
||||
public fun implicit3(): Int = 10
|
||||
}
|
||||
|
||||
public data class FooData(val i: Int, val s: String)
|
||||
|
||||
data class <!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>FooData2(val i: Int, val s: String)<!>
|
||||
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>data class FooData2<!>(val i: Int, val s: String)
|
||||
|
||||
public class WithNested {
|
||||
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>class Nested<!> {}
|
||||
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>inner class Inner<!> {}
|
||||
}
|
||||
Reference in New Issue
Block a user