MCPcopy Create free account
hub / github.com/astral-sh/ruff / write_virtual_file

Method write_virtual_file

crates/ruff_db/src/system/test.rs:330–339  ·  view source on GitHub ↗

Writes the content of the given virtual file. ## Panics If the db isn't using the [`InMemorySystem`].

(
        &mut self,
        path: impl AsRef<SystemVirtualPath>,
        content: impl AsRef<[u8]>,
    )

Source from the content-addressed store, hash-verified

328 /// ## Panics
329 /// If the db isn't using the [`InMemorySystem`].
330 fn write_virtual_file(
331 &mut self,
332 path: impl AsRef<SystemVirtualPath>,
333 content: impl AsRef<[u8]>,
334 ) {
335 let path = path.as_ref();
336 self.test_system()
337 .memory_file_system()
338 .write_virtual_file(path, content);
339 }
340
341 /// Uses the given system instead of the testing system.
342 ///

Callers

nothing calls this directly

Implementers 8

db.rscrates/ty_project/src/db.rs
db.rscrates/ty_module_resolver/src/db.rs
lib.rscrates/ruff_db/src/lib.rs
db.rscrates/ty_python_core/src/db.rs
lib.rscrates/mdtest/src/lib.rs
db.rscrates/ty_python_semantic/src/db.rs
corpus.rscrates/ty_python_semantic/tests/corpus
ty_check_invalid_syntax.rsfuzz/fuzz_targets/ty_check_invalid_syn

Calls 3

as_refMethod · 0.45
memory_file_systemMethod · 0.45
test_systemMethod · 0.45

Tested by

no test coverage detected