Skip to content

Commit 4a0cf05

Browse files
Merge pull request #495 from Automattic/add-languages
Add more languages
2 parents e5548ae + 293c257 commit 4a0cf05

File tree

8 files changed

+247
-73
lines changed

8 files changed

+247
-73
lines changed

Cargo.lock

+104-71
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

harper-comments/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ tree-sitter-java = "0.20.0"
3030
tree-sitter-nix = "0.0.1"
3131
itertools = "0.14.0"
3232
tree-sitter-haskell = "0.15.0"
33+
tree-sitter-php = "=0.22.2"
34+
tree-sitter-dart = "0.0.3"
3335

3436
[dev-dependencies]
3537
paste = "1.0.15"

harper-comments/src/comment_parser.rs

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ impl CommentParser {
4141
"shellscript" => tree_sitter_bash::language(),
4242
"java" => tree_sitter_java::language(),
4343
"haskell" => tree_sitter_haskell::language(),
44+
"php" => tree_sitter_php::language_php(),
45+
"dart" => tree_sitter_dart::language(),
4446
_ => return None,
4547
};
4648

@@ -94,6 +96,8 @@ impl CommentParser {
9496
"bash" => "shellscript",
9597
"java" => "java",
9698
"hs" => "haskell",
99+
"php" => "php",
100+
"dart" => "dart",
97101
_ => return None,
98102
})
99103
}

harper-comments/tests/language_support.rs

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ create_test!(merged_lines.ts, 1);
5252
create_test!(javadoc_clean_simple.java, 0);
5353
create_test!(javadoc_complex.java, 4);
5454
create_test!(issue_132.rs, 1);
55+
create_test!(laravel_app.php, 2);
5556

5657
// These are to make sure nothing crashes.
5758
create_test!(empty.js, 0);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Application Name
8+
|--------------------------------------------------------------------------
9+
|
10+
| This value is the name of your application, which will be used when the
11+
| framework needs to place the application's name in a notification or
12+
| other UI elements where an application name needs to be displayed.
13+
|
14+
*/
15+
16+
'name' => env('APP_NAME', 'Laravel'),
17+
18+
/*
19+
|--------------------------------------------------------------------------
20+
| Application Environment
21+
|--------------------------------------------------------------------------
22+
|
23+
| This value determines the "environment" your application is currently
24+
| running in. This may determine how you prefer to configure various
25+
| services the application utilizes. Set this in your ".env" file.
26+
|
27+
*/
28+
29+
'env' => env('APP_ENV', 'production'),
30+
31+
/*
32+
|--------------------------------------------------------------------------
33+
| Application Debug Mode
34+
|--------------------------------------------------------------------------
35+
|
36+
| When your application is in debug mode, detailed error messages with
37+
| stack traces will be shown on every error that occurs within your
38+
| application. If disabled, a simple generic error page is shown.
39+
|
40+
*/
41+
42+
'debug' => (bool) env('APP_DEBUG', false),
43+
44+
/*
45+
|--------------------------------------------------------------------------
46+
| Application URL
47+
|--------------------------------------------------------------------------
48+
|
49+
| This URL is used by the console to properly generate URLs when using
50+
| the Artisan command line tool. You should set this to the root of
51+
| the application so that it's available within Artisan commands.
52+
|
53+
*/
54+
55+
'url' => env('APP_URL', 'http://localhost'),
56+
57+
/*
58+
|--------------------------------------------------------------------------
59+
| Application Timezone
60+
|--------------------------------------------------------------------------
61+
|
62+
| Here you may specify the default timezone for your application, which
63+
| will be used by the PHP date and date-time functions. The timezone
64+
| is set to "UTC" by default as it is suitable for most use cases.
65+
|
66+
*/
67+
68+
'timezone' => env('APP_TIMEZONE', 'UTC'),
69+
70+
/*
71+
|--------------------------------------------------------------------------
72+
| Application Locale Configuration
73+
|--------------------------------------------------------------------------
74+
|
75+
| The application locale determines the default locale that will be used
76+
| by Laravel's translation / localization methods. This option can be
77+
| set to any locale for which you plan to have translation strings.
78+
|
79+
*/
80+
81+
'locale' => env('APP_LOCALE', 'en'),
82+
83+
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
84+
85+
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
86+
87+
/*
88+
|--------------------------------------------------------------------------
89+
| Encryption Key
90+
|--------------------------------------------------------------------------
91+
|
92+
| This key is utilized by Laravel's encryption services and should be set
93+
| to a random, 32 character string to ensure that all encrypted values
94+
| are secure. You should do this prior to deploying the application.
95+
|
96+
*/
97+
98+
'cipher' => 'AES-256-CBC',
99+
100+
'key' => env('APP_KEY'),
101+
102+
'previous_keys' => [
103+
...array_filter(
104+
explode(',', env('APP_PREVIOUS_KEYS', ''))
105+
),
106+
],
107+
108+
/*
109+
|--------------------------------------------------------------------------
110+
| Maintenance Mode Driver
111+
|--------------------------------------------------------------------------
112+
|
113+
| These configuration options determine the driver used to determine and
114+
| manage Laravel's "maintenance mode" status. The "cache" driver will
115+
| allow maintenance mode to be controlled across multiple machines.
116+
|
117+
| Supported drivers: "file", "cache"
118+
|
119+
*/
120+
121+
'maintenance' => [
122+
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
123+
'store' => env('APP_MAINTENANCE_STORE', 'database'),
124+
],
125+
126+
];

harper-core/dictionary.dict

+5-1
Original file line numberDiff line numberDiff line change
@@ -49775,6 +49775,10 @@ a8c/SM
4977549775
a11n/1
4977649776
a12s/9
4977749777
intergenerational
49778+
Laravel/M
49779+
Typst/SM
49780+
Lua/SM
49781+
CMake/SM
4977849782
DBMS/12SM
4977949783
RDBMS/12SM
4978049784
WhatsApp/124MG
@@ -49791,4 +49795,4 @@ CQL/1
4979149795
KSQL/1
4979249796
PRQL/1
4979349797
MapReduce/1
49794-
SQLAlchemy/1
49798+
SQLAlchemy/1

packages/vscode-plugin/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@
5555
"onLanguage:toml",
5656
"onLanguage:typescript",
5757
"onLanguage:typescriptreact",
58-
"onLanguage:typst"
58+
"onLanguage:typst",
59+
"onLanguage:php",
60+
"onLanguage:dart"
5961
],
6062
"main": "./build/extension.js",
6163
"contributes": {

packages/web/src/routes/docs/integrations/language-server/+page.md

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ If you use Neovim, [read this documentation](./neovim#Configuration).
111111
| TypeScript | `typescript` ||
112112
| TypeScript React | `typescriptreact` ||
113113
| Typst | `typst` | |
114+
| PHP | `php` ||
115+
| Dart | `dart` ||
114116

115117
Want your language added?
116118
Let us know by [commenting on this issue](https://github.com/Automattic/harper/issues/79).

0 commit comments

Comments
 (0)