Home / Function/ scan_sources() — tailwindcss Function Reference

scan_sources() — tailwindcss Function Reference

Architecture documentation for the scan_sources() function in mod.rs from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  98a265b3_e586_5ffa_483e_55b79182bfbc["scan_sources()"]
  d865d4fd_bb15_6d9a_a900_10e82a6856fb["mod.rs"]
  98a265b3_e586_5ffa_483e_55b79182bfbc -->|defined in| d865d4fd_bb15_6d9a_a900_10e82a6856fb
  38bee1fa_4e14_30fb_3457_939e60cb3dd2["scan()"]
  38bee1fa_4e14_30fb_3457_939e60cb3dd2 -->|calls| 98a265b3_e586_5ffa_483e_55b79182bfbc
  ebfaa4fd_c34e_cba1_750b_0b0c97e8b525["get_files()"]
  ebfaa4fd_c34e_cba1_750b_0b0c97e8b525 -->|calls| 98a265b3_e586_5ffa_483e_55b79182bfbc
  ca6eb787_41dd_a6ba_52d2_2c0744d074f3["get_globs()"]
  ca6eb787_41dd_a6ba_52d2_2c0744d074f3 -->|calls| 98a265b3_e586_5ffa_483e_55b79182bfbc
  style 98a265b3_e586_5ffa_483e_55b79182bfbc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/oxide/src/scanner/mod.rs lines 316–352

    fn scan_sources(&mut self) {
        let Some(walker) = &mut self.walker else {
            return;
        };

        for entry in walker.build().filter_map(Result::ok) {
            let path = entry.into_path();
            let Ok(metadata) = path.metadata() else {
                continue;
            };
            if metadata.is_dir() {
                self.dirs.push(path);
            } else if metadata.is_file() {
                let extension = path
                    .extension()
                    .and_then(|x| x.to_str())
                    .unwrap_or_default(); // In case the file has no extension

                match extension {
                    // Special handing for CSS files, we don't want to extract candidates from
                    // these files, but we do want to extract used CSS variables.
                    "css" => {
                        self.css_files.push(path.clone());
                    }
                    _ => {
                        self.changed_content.push(ChangedContent::File(
                            path.to_path_buf(),
                            extension.to_owned(),
                        ));
                    }
                }

                self.extensions.insert(extension.to_owned());
                self.files.push(path);
            }
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does scan_sources() do?
scan_sources() is a function in the tailwindcss codebase, defined in crates/oxide/src/scanner/mod.rs.
Where is scan_sources() defined?
scan_sources() is defined in crates/oxide/src/scanner/mod.rs at line 316.
What calls scan_sources()?
scan_sources() is called by 3 function(s): get_files, get_globs, scan.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free