Rename Notebook related symbols (#6862)

This PR renames the following symbols:

* `PySourceType::Jupyter` -> `PySourceType::Ipynb`
* `SourceKind::Jupyter` -> `SourceKind::IpyNotebook`
* `JupyterIndex` -> `NotebookIndex`
This commit is contained in:
Dhruv Manilawala
2023-08-25 11:40:54 +05:30
committed by GitHub
parent 61b2ffa8e8
commit d1f07008f7
11 changed files with 41 additions and 41 deletions

View File

@@ -58,7 +58,7 @@ pub enum PySourceType {
#[default]
Python,
Stub,
Jupyter,
Ipynb,
}
impl PySourceType {
@@ -70,8 +70,8 @@ impl PySourceType {
matches!(self, PySourceType::Stub)
}
pub const fn is_jupyter(&self) -> bool {
matches!(self, PySourceType::Jupyter)
pub const fn is_ipynb(&self) -> bool {
matches!(self, PySourceType::Ipynb)
}
}
@@ -79,7 +79,7 @@ impl From<&Path> for PySourceType {
fn from(path: &Path) -> Self {
match path.extension() {
Some(ext) if ext == "pyi" => PySourceType::Stub,
Some(ext) if ext == "ipynb" => PySourceType::Jupyter,
Some(ext) if ext == "ipynb" => PySourceType::Ipynb,
_ => PySourceType::Python,
}
}