-
Notifications
You must be signed in to change notification settings - Fork 37
Improve detection of definitions #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// SYNTAX TEST "source.scala" | ||
|
||
def // comment | ||
// ^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^ comment.line.double-slash.scala | ||
|
||
def /* comment */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about supporting things like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, low priority. There might be some useful code for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not really sure if it is worth adding more complexity into the rule to support this syntax that nobody should be using anyway. |
||
// ^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^^^^ comment.block.scala | ||
|
||
val // comment | ||
// ^^^ keyword.declaration.stable.scala | ||
// ^^^^^^^^^^ comment.line.double-slash.scala | ||
|
||
val /* comment */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about |
||
// ^^^ keyword.declaration.stable.scala | ||
// ^^^^^^^^^^^^^ comment.block.scala | ||
|
||
var // comment | ||
// ^^^ keyword.declaration.volatile.scala | ||
// ^^^^^^^^^^ comment.line.double-slash.scala | ||
|
||
var /* comment */ | ||
// ^^^ keyword.declaration.volatile.scala | ||
// ^^^^^^^^^^^^^ comment.block.scala | ||
|
||
given // comment | ||
// ^^^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^ comment.line.double-slash.scala | ||
|
||
given /* comment */ | ||
// ^^^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^^^^ comment.block.scala | ||
|
||
class // comment | ||
// ^^^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^ comment.line.double-slash.scala | ||
|
||
class /* comment */ | ||
// ^^^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^^^^ comment.block.scala | ||
|
||
trait // comment | ||
// ^^^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^ comment.line.double-slash.scala | ||
|
||
trait /* comment */ | ||
// ^^^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^^^^ comment.block.scala | ||
|
||
object // comment | ||
// ^^^^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^ comment.line.double-slash.scala | ||
|
||
object /* comment */ | ||
// ^^^^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^^^^ comment.block.scala | ||
|
||
enum // comment | ||
// ^^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^ comment.line.double-slash.scala | ||
|
||
enum /* comment */ | ||
// ^^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^^^^ comment.block.scala | ||
|
||
type // comment | ||
// ^^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^ comment.line.double-slash.scala | ||
|
||
type /* comment */ | ||
// ^^^^ keyword.declaration.scala | ||
// ^^^^^^^^^^^^^ comment.block.scala |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SYNTAX TEST "source.scala" | ||
|
||
|
||
val | ||
// ^^^ keyword.declaration.stable.scala | ||
|
||
var | ||
// ^^^ keyword.declaration.volatile.scala | ||
|
||
def | ||
// ^^^ keyword.declaration.scala | ||
|
||
type | ||
// ^^^^ keyword.declaration.scala | ||
|
||
class | ||
// ^^^^^ keyword.declaration.scala | ||
|
||
trait | ||
// ^^^^^ keyword.declaration.scala | ||
|
||
object | ||
// ^^^^^^ keyword.declaration.scala | ||
|
||
given | ||
// ^^^^^ keyword.declaration.scala | ||
|
||
enum | ||
// ^^^^ keyword.declaration.scala | ||
|
||
case class | ||
// ^^^^ keyword.declaration.scala | ||
// ^^^^^ keyword.declaration.scala | ||
|
||
case object | ||
// ^^^^ keyword.declaration.scala | ||
// ^^^^^^ keyword.declaration.scala | ||
|
||
inline def | ||
// ^^^^^^ storage.modifier.other | ||
// ^^^ keyword.declaration.scala | ||
|
||
package object | ||
// ^^^^^^^ keyword.other.scoping.scala | ||
// ^^^^^^ keyword.declaration.scala |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good refactoring 👍