pub enum ManifestLanguage {
Json,
Toml,
GoMod,
Xml,
CMake,
}Expand description
Manifest file languages for component extraction.
These are distinct from SupportedLanguage because manifest files
have different grammars (JSON, TOML, XML, etc.) and use specialized
SCM queries focused on extracting component names and dependencies.
Variants§
Json
JSON manifests (package.json, vcpkg.json)
Toml
TOML manifests (Cargo.toml, pyproject.toml)
GoMod
Go module files (go.mod)
Xml
XML manifests (.csproj, .vbproj, .fsproj)
CMake
CMake files (CMakeLists.txt)
Implementations§
Source§impl ManifestLanguage
impl ManifestLanguage
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Get the language name as used in SCM query file names.
Maps to {name}-manifest-tags.scm query files.
Sourcepub fn tree_sitter_language(&self) -> Language
pub fn tree_sitter_language(&self) -> Language
Get the tree-sitter Language for this manifest type.
Sourcepub fn from_filename(filename: &str) -> Option<Self>
pub fn from_filename(filename: &str) -> Option<Self>
Detect manifest language from filename.
Returns None if the filename is not a recognized manifest file.
§Recognized Manifest Files
| Filename Pattern | Language | Component Type |
|---|---|---|
package.json | Json | npm/Node.js |
vcpkg.json | Json | vcpkg (C/C++) |
Cargo.toml | Toml | Rust crate |
pyproject.toml | Toml | Python package |
go.mod | GoMod | Go module |
*.csproj | Xml | C# project |
*.vbproj | Xml | VB.NET project |
*.fsproj | Xml | F# project |
CMakeLists.txt | CMake | CMake project |
Sourcepub fn from_path(path: &Path) -> Option<Self>
pub fn from_path(path: &Path) -> Option<Self>
Detect manifest language from file path.
Extracts the filename from the path and calls from_filename.
Sourcepub fn is_manifest_file(path: &Path) -> bool
pub fn is_manifest_file(path: &Path) -> bool
Check if a file path is a manifest file.
Sourcepub fn exact_filenames() -> &'static [&'static str]
pub fn exact_filenames() -> &'static [&'static str]
Get all recognized manifest filenames (exact matches).
Sourcepub fn manifest_extensions() -> &'static [&'static str]
pub fn manifest_extensions() -> &'static [&'static str]
Get all recognized manifest file extensions.
Trait Implementations§
Source§impl Clone for ManifestLanguage
impl Clone for ManifestLanguage
Source§fn clone(&self) -> ManifestLanguage
fn clone(&self) -> ManifestLanguage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ManifestLanguage
impl Debug for ManifestLanguage
Source§impl Display for ManifestLanguage
impl Display for ManifestLanguage
Source§impl Hash for ManifestLanguage
impl Hash for ManifestLanguage
Source§impl PartialEq for ManifestLanguage
impl PartialEq for ManifestLanguage
impl Copy for ManifestLanguage
impl Eq for ManifestLanguage
impl StructuralPartialEq for ManifestLanguage
Auto Trait Implementations§
impl Freeze for ManifestLanguage
impl RefUnwindSafe for ManifestLanguage
impl Send for ManifestLanguage
impl Sync for ManifestLanguage
impl Unpin for ManifestLanguage
impl UnwindSafe for ManifestLanguage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more