paths: Replace lazy_static! with OnceLock (#13213)

This PR replaces the `lazy_static!` usages in the `paths` crate with
`OnceLock` from the standard library.

This allows us to drop the `lazy_static` dependency from this crate.

The paths are now exposed as accessor functions that reference a private
static value.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-06-18 12:22:37 -04:00 committed by GitHub
parent ba59e66314
commit 81475ac4cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 322 additions and 172 deletions

View file

@ -98,19 +98,19 @@ impl JsonLspAdapter {
},
{
"fileMatch": [
schema_file_match(&paths::SETTINGS),
&*paths::LOCAL_SETTINGS_RELATIVE_PATH,
schema_file_match(paths::settings_file()),
paths::local_settings_file_relative_path()
],
"schema": settings_schema,
},
{
"fileMatch": [schema_file_match(&paths::KEYMAP)],
"fileMatch": [schema_file_match(paths::keymap_file())],
"schema": KeymapFile::generate_json_schema(&action_names),
},
{
"fileMatch": [
schema_file_match(&paths::TASKS),
&*paths::LOCAL_TASKS_RELATIVE_PATH,
schema_file_match(paths::tasks_file()),
paths::local_tasks_file_relative_path()
],
"schema": tasks_schema,
}