pub struct LanguagePack {
pub name: String,
pub extensions: Vec<String>,
pub entry_points: Vec<String>,
pub symbols: Vec<SymbolRule>,
}Expand description
A language pack for the workspace API surface (#669): how to recognize a language’s files, which files expose its public API, and how to extract its public symbols — entirely as DATA, so a new language is config, not code.
Built-in packs cover Rust, Python, Bash, and C/C++. A project ships more by
dropping a <name>.toml into ~/.newt/language-packs/ (global) or
.newt/language-packs/ (project-local), or inline under
[[context.api_surface.language_packs]]. Packs merge by name (a custom
pack with a built-in’s name replaces it), so anyone can add Java, Ruby, Swift,
Objective-C, … without touching the binary.
Fields§
§name: StringStable id (a config pack with a built-in’s name replaces that built-in).
extensions: Vec<String>File extensions this pack claims, no dot — ["rs"], ["h", "hpp", "cpp"].
entry_points: Vec<String>Entry-point filename globs (the public-API files, listed first in the
surface). Supported globs: exact (lib.rs), suffix (*.h), or all (*).
Empty ⇒ no file is prioritized for this pack.
symbols: Vec<SymbolRule>Public-symbol extraction rules, applied per source line.
Trait Implementations§
Source§impl Clone for LanguagePack
impl Clone for LanguagePack
Source§fn clone(&self) -> LanguagePack
fn clone(&self) -> LanguagePack
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LanguagePack
impl Debug for LanguagePack
Source§impl<'de> Deserialize<'de> for LanguagePack
impl<'de> Deserialize<'de> for LanguagePack
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for LanguagePack
Source§impl PartialEq for LanguagePack
impl PartialEq for LanguagePack
Source§fn eq(&self, other: &LanguagePack) -> bool
fn eq(&self, other: &LanguagePack) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for LanguagePack
impl Serialize for LanguagePack
impl StructuralPartialEq for LanguagePack
Auto Trait Implementations§
impl Freeze for LanguagePack
impl RefUnwindSafe for LanguagePack
impl Send for LanguagePack
impl Sync for LanguagePack
impl Unpin for LanguagePack
impl UnsafeUnpin for LanguagePack
impl UnwindSafe for LanguagePack
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
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