pub struct File {
pub id: u32,
pub package_id: String,
pub parse_status: FileParseStatus,
pub name: String,
pub display_path: String,
pub source_path: Option<PathBuf>,
pub source: String,
pub items: Vec<Expression>,
pub file_comment: Option<String>,
}Fields§
§id: u32§package_id: String§parse_status: FileParseStatus§name: StringStable bare filename (e.g. greet.lis); identity key for caching and
LSP path reconstruction.
display_path: StringCwd-relative path for diagnostics and --sourcemap directives, absolute
outside the cwd. Equals name for loaders that have no notion of cwd.
source_path: Option<PathBuf>Physical source path when it cannot be reconstructed from the package and filename, notably for generated Go typedefs.
source: String§items: Vec<Expression>§file_comment: Option<String>Implementations§
Source§impl File
impl File
Sourcepub fn from_parse(
id: u32,
package_id: &str,
name: String,
display_path: String,
source: String,
result: ParseResult,
) -> (Self, Vec<ParseError>)
pub fn from_parse( id: u32, package_id: &str, name: String, display_path: String, source: String, result: ParseResult, ) -> (Self, Vec<ParseError>)
Keep the parsed AST, status, and file comment together while returning its diagnostics.
pub fn new_cached( package_id: &str, name: &str, display_path: &str, source: &str, id: u32, ) -> Self
pub fn is_d_lis(&self) -> bool
pub fn imports(&self) -> Vec<FileImport>
pub fn public_declarations(&self) -> Vec<EcoString>
Sourcepub fn rewrite_import(&mut self, from: &str, to: &str)
pub fn rewrite_import(&mut self, from: &str, to: &str)
Redirects import "{from}" to to, keeping the source spelling as the qualifier.
pub fn go_filename(&self) -> String
Trait Implementations§
impl StructuralPartialEq for File
Auto Trait Implementations§
impl Forget for File
impl Freeze for File
impl Move for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnsafeUnpin for Filewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Expression>: UnsafeUnpin,
impl UnwindSafe for Filewhere
RawVecInner: UnwindSafe,
BoxRaw<Expression>: UnwindSafe,
Arc<Box<[Type]>>: UnwindSafe,
NonNull<u8>: UnwindSafe,
Arc<FunctionType>: UnwindSafe,
BoxRaw<Type>: UnwindSafe,
Arc<Spelling>: UnwindSafe,
BoxRaw<Annotation>: UnwindSafe,
BoxRaw<Pattern>: UnwindSafe,
BoxRaw<Binding>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more