Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issues when deleting notebook cells #1074

Merged
merged 2 commits into from
Feb 13, 2025
Merged

Conversation

DetachHead
Copy link
Owner

this went undetected during my testing due to #1073

fixes #1069

This comment has been minimized.

@DetachHead DetachHead force-pushed the fix-deleting-notebook-crash branch from 5ba26a3 to d3f5d89 Compare February 13, 2025 11:05

This comment has been minimized.

@DetachHead DetachHead changed the title fix crash deleting notebook cell when lsp is running in background analysis mode fix issues when deleting notebook cells Feb 13, 2025
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

sympy (https://github.com/sympy/sympy)
+     Type of "sqrtdenest" is "(expr: Unknown, max_iter: int = 3) -> Unknown" (reportUnknownVariableType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/simplify/tests/test_sqrtdenest.py:123:5 - warning: Type of "z1" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/simplify/tests/test_sqrtdenest.py:123:5 - warning: Type of "z1" is partially unknown
+     Type of "z1" is "Unknown | Expr | Any | Self@Expr | Mul | Add | None" (reportUnknownVariableType)
-     Type of "z1" is "Unknown | Expr | Any" (reportUnknownVariableType)
+     Type of "z1" is "Unknown | Expr | Any | Self@Expr" (reportUnknownVariableType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-     Type of "z" is "Unknown | Expr | Any" (reportUnknownVariableType)
+     Type of "z" is "Unknown | Expr | Any | Self@Expr" (reportUnknownVariableType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-     Type of "trigsimp" is "(expr: Unknown, inverse: bool = False, **opts: Unknown) -> (Any | Unknown | Basic | atan2 | Expr | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Add | Mul | Dict)" (reportUnknownVariableType)
+     Type of "trigsimp" is "(expr: Unknown, inverse: bool = False, **opts: Unknown) -> (Any | Unknown | Basic | atan2 | Expr | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Add | Mul | Dict)" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/simplify/tests/test_trigsimp.py:93:16 - error: Operator "-" not supported for types "Any | Unknown | Basic | atan2 | Expr | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Add | Mul | Dict" and "float"
+   /tmp/mypy_primer/projects/sympy/sympy/simplify/tests/test_trigsimp.py:93:16 - error: Operator "-" not supported for types "Any | Unknown | Basic | atan2 | Expr | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Add | Mul | Dict" and "float"
-     Type of "trigsimp" is "(**args: Unknown) -> (Any | Unknown | Basic | atan2 | Expr | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Add | Mul | Dict)" (reportUnknownMemberType)
+     Type of "trigsimp" is "(**args: Unknown) -> (Any | Unknown | Basic | atan2 | Expr | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Add | Mul | Dict)" (reportUnknownMemberType)

... (truncated 3985 lines) ...

imagehash (https://github.com/JohannesBuchner/imagehash): 314.13x slower (0.0s -> 10.5s in a single noisy sample)

spack (https://github.com/spack/spack)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zip/package.py:20:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zip/package.py:20:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zip/package.py:22:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zip/package.py:22:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zipkin/package.py:24:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zipkin/package.py:24:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zlib/package.py:54:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zlib/package.py:54:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zlib/package.py:55:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zlib/package.py:55:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zlib-ng/package.py:32:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zlib-ng/package.py:32:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zlib-ng/package.py:33:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zlib-ng/package.py:33:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zlib-ng/package.py:54:9 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zlib-ng/package.py:54:9 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zlib-ng/package.py:55:9 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zlib-ng/package.py:55:9 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:30:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:30:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:31:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:31:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:32:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:32:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:44:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:44:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:46:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:46:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:47:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:47:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:48:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:48:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:49:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:49:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:51:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:51:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/zoltan/package.py:52:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)

... (truncated 605 lines) ...

@DetachHead DetachHead merged commit bd61a24 into main Feb 13, 2025
20 checks passed
@DetachHead DetachHead deleted the fix-deleting-notebook-crash branch February 13, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Failed to find lsp uri" errors when deleting cells in Jupyter Notebook
1 participant