Skip to content
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

Fix colorization for top-level declarations #148

Merged
merged 2 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions syntaxes/hack.json
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@
"name": "meta.function-call.invoke.php"
},
"interface": {
"begin": "^(?i)\\s*(?:(public|internal)?\\s+)(interface)\\b",
"begin": "^(?i)\\s*(?:(public|internal)\\s+)?(interface)\\b",
"beginCaptures": {
"1": {
"name": "storage.modifier.php"
Expand Down Expand Up @@ -697,7 +697,7 @@
]
},
{
"begin": "(?i)^\\s*(?:(public|internal)?\\s+)(enum)\\s+(class)\\s+([a-z0-9_]+)\\s*:?",
"begin": "(?i)^\\s*(?:(public|internal)\\s+)?(enum)\\s+(class)\\s+([a-z0-9_]+)\\s*:?",
"beginCaptures": {
"1": {
"name": "storage.modifier.php"
Expand Down Expand Up @@ -725,7 +725,7 @@
]
},
{
"begin": "(?i)^\\s*(?:(public|internal)?\\s+)(enum)\\s+([a-z0-9_]+)\\s*:?",
"begin": "(?i)^\\s*(?:(public|internal)\\s+)?(enum)\\s+([a-z0-9_]+)\\s*:?",
"beginCaptures": {
"1": {
"name": "storage.modifier.php"
Expand All @@ -749,7 +749,7 @@
]
},
{
"begin": "(?i)^\\s*(?:(public|internal)?\\s+)(trait)\\s+([a-z0-9_]+)\\s*",
"begin": "(?i)^\\s*(?:(public|internal)\\s+)?(trait)\\s+([a-z0-9_]+)\\s*",
"beginCaptures": {
"1": {
"name": "storage.modifier.php"
Expand Down Expand Up @@ -1022,7 +1022,7 @@
"name": "keyword.control.exception.php"
},
{
"begin": "(?i)\\s*(?:(public|internal)?\\s+)(function)\\s*(?=\\()",
"begin": "(?i)\\s*(?:(public|internal)\\s+)?(function)\\s*(?=\\()",
"beginCaptures": {
"1": {
"name": "storage.modifier.php"
Expand Down
24 changes: 24 additions & 0 deletions syntaxes/test/modules.hack
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,27 @@ internal interface foo {
public interface foo {
}

interface foo {
}

internal enum foo {
}

public enum foo {
}

enum foo {
}

internal enum class foo {
}

public enum class foo {
}

enum class foo {
}

internal trait foo {
internal int $x;
internal function y(): void {
Expand All @@ -32,6 +41,9 @@ internal trait foo {
public trait foo {
}

trait foo {
}

internal class foo {
internal int $x;
internal function y(): void {
Expand All @@ -40,3 +52,15 @@ internal class foo {

public class foo {
}

class foo {
}

internal function foo(): void {
}

public function foo(): void {
}

function foo(): void {
}