-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: Incorrect semanticdb span on Selectable (#18576)
Semanticdb range on selectDynamic in `foo.bar` previously contained `.bar` instead of `bar` Connected to scalameta/metals#5621 Also closes #16771 by porting scalameta/metals#4907
- Loading branch information
Showing
7 changed files
with
132 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package example | ||
|
||
import reflect.Selectable/*->scala::reflect::Selectable.*/.reflectiveSelectable/*->scala::reflect::Selectable.reflectiveSelectable().*/ | ||
|
||
object StructuralTypes/*<-example::StructuralTypes.*/: | ||
type User/*<-example::StructuralTypes.User#*/ = { | ||
def name/*<-local0*/: String/*->scala::Predef.String#*/ | ||
def age/*<-local1*/: Int/*->scala::Int#*/ | ||
def foo/*<-local3*/(x/*<-local2*/: Int/*->scala::Int#*/): Int/*->scala::Int#*/ | ||
} | ||
|
||
val user/*<-example::StructuralTypes.user.*/ = null.asInstanceOf/*->scala::Any#asInstanceOf().*/[User/*->example::StructuralTypes.User#*/] | ||
user/*->example::StructuralTypes.user.*/.name/*->scala::reflect::Selectable#selectDynamic().*/ | ||
user/*->example::StructuralTypes.user.*/.age/*->scala::reflect::Selectable#selectDynamic().*/ | ||
val fooBar/*<-example::StructuralTypes.fooBar.*/ = user/*->example::StructuralTypes.user.*/ foo/*->scala::reflect::Selectable#applyDynamic().*/ 123 | ||
|
||
val V/*<-example::StructuralTypes.V.*/: Object/*->java::lang::Object#*/ { | ||
def scalameta/*<-local4*/: String/*->scala::Predef.String#*/ | ||
} = /*<-local6*/new: | ||
def scalameta/*<-local5*/ = "4.0" | ||
V/*->example::StructuralTypes.V.*/.scalameta/*->scala::reflect::Selectable#selectDynamic().*/ | ||
end StructuralTypes/*->example::StructuralTypes.*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package example | ||
|
||
import reflect.Selectable.reflectiveSelectable | ||
|
||
object StructuralTypes: | ||
type User = { | ||
def name: String | ||
def age: Int | ||
def foo(x: Int): Int | ||
} | ||
|
||
val user = null.asInstanceOf[User] | ||
user.name | ||
user.age | ||
val fooBar = user foo 123 | ||
|
||
val V: Object { | ||
def scalameta: String | ||
} = new: | ||
def scalameta = "4.0" | ||
V.scalameta | ||
end StructuralTypes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters