|
1987 | 1987 | }; |
1988 | 1988 | "rust-analyzer.workspace.discoverConfig" = { |
1989 | 1989 | description = '' |
1990 | | - Enables automatic discovery of projects using [`DiscoverWorkspaceConfig::command`]. |
| 1990 | + Enables automatic discovery of projects using |
| 1991 | + \[`DiscoverWorkspaceConfig::command`\]. |
1991 | 1992 |
|
1992 | | - [`DiscoverWorkspaceConfig`] also requires setting `progress_label` and `files_to_watch`. |
1993 | | - `progress_label` is used for the title in progress indicators, whereas `files_to_watch` |
1994 | | - is used to determine which build system-specific files should be watched in order to |
1995 | | - reload rust-analyzer. |
| 1993 | + \[`DiscoverWorkspaceConfig`\] also requires setting `progress_label` and |
| 1994 | + `files_to_watch`. `progress_label` is used for the title in progress |
| 1995 | + indicators, whereas `files_to_watch` is used to determine which build |
| 1996 | + system-specific files should be watched in order to reload |
| 1997 | + rust-analyzer. |
1996 | 1998 |
|
1997 | 1999 | Below is an example of a valid configuration: |
1998 | | - ```json |
| 2000 | +
|
| 2001 | + ``` json |
1999 | 2002 | "rust-analyzer.workspace.discoverConfig": { |
2000 | 2003 | "command": [ |
2001 | 2004 | "rust-project", |
|
2009 | 2012 | } |
2010 | 2013 | ``` |
2011 | 2014 |
|
2012 | | - ## On `DiscoverWorkspaceConfig::command` |
| 2015 | + **On `DiscoverWorkspaceConfig::command`** |
2013 | 2016 |
|
2014 | 2017 | **Warning**: This format is provisional and subject to change. |
2015 | 2018 |
|
2016 | | - [`DiscoverWorkspaceConfig::command`] *must* return a JSON object |
| 2019 | + \[`DiscoverWorkspaceConfig::command`\] *must* return a JSON object |
2017 | 2020 | corresponding to `DiscoverProjectData::Finished`: |
2018 | 2021 |
|
2019 | | - ```norun |
| 2022 | + ``` norun |
2020 | 2023 | #[derive(Debug, Clone, Deserialize, Serialize)] |
2021 | 2024 | #[serde(tag = "kind")] |
2022 | 2025 | #[serde(rename_all = "snake_case")] |
|
2029 | 2032 |
|
2030 | 2033 | As JSON, `DiscoverProjectData::Finished` is: |
2031 | 2034 |
|
2032 | | - ```json |
| 2035 | + ``` json |
2033 | 2036 | { |
2034 | 2037 | // the internally-tagged representation of the enum. |
2035 | 2038 | "kind": "finished", |
|
2051 | 2054 | which will be substituted with the JSON-serialized form of the following |
2052 | 2055 | enum: |
2053 | 2056 |
|
2054 | | - ```norun |
| 2057 | + ``` norun |
2055 | 2058 | #[derive(PartialEq, Clone, Debug, Serialize)] |
2056 | 2059 | #[serde(rename_all = "camelCase")] |
2057 | 2060 | pub enum DiscoverArgument { |
|
2062 | 2065 |
|
2063 | 2066 | The JSON representation of `DiscoverArgument::Path` is: |
2064 | 2067 |
|
2065 | | - ```json |
| 2068 | + ``` json |
2066 | 2069 | { |
2067 | 2070 | "path": "src/main.rs" |
2068 | 2071 | } |
2069 | 2072 | ``` |
2070 | 2073 |
|
2071 | 2074 | Similarly, the JSON representation of `DiscoverArgument::Buildfile` is: |
2072 | 2075 |
|
2073 | | - ``` |
2074 | | - { |
2075 | | - "buildfile": "BUILD" |
2076 | | - } |
2077 | | - ``` |
| 2076 | + { |
| 2077 | + "buildfile": "BUILD" |
| 2078 | + } |
2078 | 2079 |
|
2079 | | - `DiscoverArgument::Path` is used to find and generate a `rust-project.json`, |
2080 | | - and therefore, a workspace, whereas `DiscoverArgument::buildfile` is used to |
2081 | | - to update an existing workspace. As a reference for implementors, |
2082 | | - buck2's `rust-project` will likely be useful: |
| 2080 | + `DiscoverArgument::Path` is used to find and generate a |
| 2081 | + `rust-project.json`, and therefore, a workspace, whereas |
| 2082 | + `DiscoverArgument::buildfile` is used to to update an existing |
| 2083 | + workspace. As a reference for implementors, buck2's `rust-project` will |
| 2084 | + likely be useful: |
2083 | 2085 | https://github.com/facebook/buck2/tree/main/integrations/rust-project. |
| 2086 | +
|
2084 | 2087 | ''; |
2085 | 2088 | pluginDefault = null; |
2086 | 2089 | type = { |
|
0 commit comments