/// Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`.
assist_allowMergingIntoGlobImports: bool = "true",
+ /// Warm up caches on project load.
+ cache_warmup: bool = "true",
+
/// Show function name and docs in parameter hints.
callInfo_full: bool = "true",
hoverActions_run: bool = "true",
/// Whether to show inlay type hints for method chains.
- inlayHints_chainingHints: bool = "true",
+ inlayHints_chainingHints: bool = "true",
/// Maximum length for inlay hints. Set to null to have an unlimited length.
- inlayHints_maxLength: Option<usize> = "25",
+ inlayHints_maxLength: Option<usize> = "25",
/// Whether to show function parameter name inlay hints at the call
/// site.
- inlayHints_parameterHints: bool = "true",
+ inlayHints_parameterHints: bool = "true",
/// Whether to show inlay type hints for variables.
- inlayHints_typeHints: bool = "true",
+ inlayHints_typeHints: bool = "true",
+ /// Whether to hide inlay hints for constructors.
+ inlayHints_hideNamedConstructorHints: bool = "false",
/// Join lines inserts else between consecutive ifs.
joinLines_joinElseIf: bool = "true",
)
}
+ pub fn prefill_caches(&self) -> bool {
+ self.data.cache_warmup
+ }
+
pub fn location_link(&self) -> bool {
try_or!(self.caps.text_document.as_ref()?.definition?.link_support?, false)
}
type_hints: self.data.inlayHints_typeHints,
parameter_hints: self.data.inlayHints_parameterHints,
chaining_hints: self.data.inlayHints_chainingHints,
+ hide_named_constructor_hints: self.data.inlayHints_hideNamedConstructorHints,
max_length: self.data.inlayHints_maxLength,
}
}
.to_string();
schema.push_str(",\n");
- let mut new_schema = schema.clone();
+ // Transform the asciidoc form link to markdown style.
+ //
+ // https://link[text] => [text](https://link)
let url_matches = schema.match_indices("https://");
- let mut cnt = 0;
- for (idx, _) in url_matches {
+ let mut url_offsets = url_matches.map(|(idx, _)| idx).collect::<Vec<usize>>();
+ url_offsets.reverse();
+ for idx in url_offsets {
let link = &schema[idx..];
// matching on whitespace to ignore normal links
if let Some(link_end) = link.find(|c| c == ' ' || c == '[') {
if link.chars().nth(link_end) == Some('[') {
- new_schema.insert(idx + cnt, '(');
- new_schema.insert(idx + link_end + cnt + 1, ')');
- cnt = cnt + 2;
+ if let Some(link_text_end) = link.find(']') {
+ let link_text = link[link_end..(link_text_end + 1)].to_string();
+
+ schema.replace_range((idx + link_end)..(idx + link_text_end + 1), "");
+ schema.insert(idx, '(');
+ schema.insert(idx + link_end + 1, ')');
+ schema.insert_str(idx, &link_text);
+ }
}
}
}
let end = package_json.find(end_marker).unwrap();
let p = remove_ws(&package_json[start..end]);
- let s = remove_ws(&new_schema);
+ let s = remove_ws(&schema);
if !p.contains(&s) {
- package_json.replace_range(start..end, &new_schema);
+ package_json.replace_range(start..end, &schema);
ensure_file_contents(&package_json_path, &package_json)
}
}