mirror of
https://github.com/SpaceManiac/SpacemanDMM.git
synced 2025-12-23 05:36:47 +00:00
parent
8f1fda64ee
commit
70bb8b682d
3 changed files with 28 additions and 8 deletions
|
|
@ -72,6 +72,12 @@ The `[langserver]` section has the following options:
|
|||
|
||||
* `dreamchecker` - Set to `true` to run dreamchecker within the language server.
|
||||
|
||||
### DM Doc
|
||||
|
||||
The `[dmdoc]` section has the following options:
|
||||
|
||||
* `use_typepath_names` - Set to `true` to have dmdoc use the true typepath name instead of the value of the `name` var for types
|
||||
|
||||
## Example
|
||||
|
||||
```toml
|
||||
|
|
|
|||
|
|
@ -218,14 +218,22 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
progress.update(&ty.path);
|
||||
|
||||
let mut parsed_type = ParsedType::default();
|
||||
parsed_type.name = ty
|
||||
.get()
|
||||
.vars
|
||||
.get("name")
|
||||
.and_then(|v| v.value.constant.as_ref())
|
||||
.and_then(|c| c.as_str())
|
||||
.unwrap_or("")
|
||||
.into();
|
||||
if context.config().dmdoc.use_typepath_names {
|
||||
parsed_type.name = ty
|
||||
.get()
|
||||
.name
|
||||
.as_str()
|
||||
.into();
|
||||
} else {
|
||||
parsed_type.name = ty
|
||||
.get()
|
||||
.vars
|
||||
.get("name")
|
||||
.and_then(|v| v.value.constant.as_ref())
|
||||
.and_then(|c| c.as_str())
|
||||
.unwrap_or("")
|
||||
.into();
|
||||
}
|
||||
|
||||
let mut anything = false;
|
||||
let mut substance = false;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ pub struct Config {
|
|||
display: WarningDisplay,
|
||||
pub langserver: Langserver,
|
||||
diagnostics: HashMap<String, WarningLevel>,
|
||||
pub dmdoc: DMDoc,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default, Debug, Clone)]
|
||||
|
|
@ -29,6 +30,11 @@ pub struct Langserver {
|
|||
pub dreamchecker: bool,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default, Debug, Clone)]
|
||||
pub struct DMDoc {
|
||||
pub use_typepath_names: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone, Copy, PartialEq)]
|
||||
#[serde(rename_all(deserialize = "lowercase"))]
|
||||
pub enum WarningLevel {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue