Skip to main content

parse_text_with_file

Function parse_text_with_file 

Source
pub fn parse_text_with_file(
    source: &str,
    name: &str,
    options: ParseOptions,
    path: &Path,
) -> Result<Module, Vec<Diagnostic>>
Expand description

Parse buffer text as if it were the file at path: include statements resolve against the file’s directory (spec §2.7), and diagnostics carry the file’s identity. The language server’s dirty-buffer path (C-043): unsaved edits analyze with the saved file’s include context. Includes are enabled regardless of the passed options’ enable_includes flag; every other option is honored as given.