Improved startup responsiveness on large monorepos#10786
Conversation
…ile discovery code non-blocking. This addresses #3075.
|
@rchiodo, I'd appreciate a code review for this change. I want to make sure that it doesn't break any pylance functionality. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Okay thanks. I'll have to pull it into pylance to try it out. I don't think I can really tell just by looking at it. |
| // Given a file map returned by the source enumerator, this function | ||
| // adds any open files that match the include file spec and returns a | ||
| // final deduped file list. | ||
| private _getTrackedFileList(fileMap: Map<string, Uri>): Uri[] { |
There was a problem hiding this comment.
i wonder if we should change this to return an iterator instead.. for cases where its 100k plus entries.
|
|
||
| // If we have an active source enumerator, call it to continue | ||
| // the source file enumeration process. | ||
| if (this._sourceEnumerator) { |
There was a problem hiding this comment.
I think this may mess up pylance's tracking of the file list. We don't schedule analysis in pull diagnostics mode. Instead diagnostics are requested by the client. So this function doesn't run.
That would mean the tracking list would be off. We'd have to do this tracking update in that scenario too.
Can you move this code to a separate function? We can then call it for pull diagnostics in Pylance.
There was a problem hiding this comment.
I've refactored the code and moved this portion to a new protected method that pylance can call in the pull diagnostics mode.
rchiodo
left a comment
There was a problem hiding this comment.
Otherwise I tested it with Pylance and it sure seems like things are faster.
|
Diff from mypy_primer, showing the effect of this PR on open source code: sympy (https://github.com/sympy/sympy)
- Return type mismatch: base method returns type "type[Self@Basic]", override returns type "(*args: Unknown) -> MyClass"
+ Return type mismatch: base method returns type "type[Basic]", override returns type "(*args: Unknown) -> MyClass"
- Type "(*args: Unknown) -> MyClass" is not assignable to type "type[Self@Basic]" (reportIncompatibleMethodOverride)
+ Type "(*args: Unknown) -> MyClass" is not assignable to type "type[Basic]" (reportIncompatibleMethodOverride)
+ .../projects/sympy/sympy/codegen/ast.py:915:9 - error: "func" incorrectly overrides property of same name in class "Basic"
+ Property method "fget" is incompatible
+ Return type mismatch: base method returns type "type[Self@Basic]", override returns type "() -> String"
+ Type "() -> String" is not assignable to type "type[Self@Basic]" (reportIncompatibleMethodOverride)
- Return type mismatch: base method returns type "Basic", override returns type "tuple[Unknown, ...] | Unknown | Product* | Basic | BooleanFalse | BooleanTrue | Equality | Expr | Self@Product | ComplexInfinity | Float | Infinity | Integer | NaN | NegativeInfinity | NegativeOne | Number | One | Rational | Zero"
+ Return type mismatch: base method returns type "Basic", override returns type "tuple[Unknown, ...] | Unknown | Product* | Basic | Expr | BooleanFalse | BooleanTrue | Equality | Self@Product | ComplexInfinity | Float | Infinity | Integer | NaN | NegativeInfinity | NegativeOne | Number | One | Rational | Zero"
- Type "tuple[Unknown, ...] | Unknown | Product* | Basic | BooleanFalse | BooleanTrue | Equality | Expr | ComplexInfinity | Float | Infinity | Integer | NaN | NegativeInfinity | NegativeOne | Number | One | Rational | Zero" is not assignable to type "Basic"
+ Type "tuple[Unknown, ...] | Unknown | Product* | Basic | Expr | BooleanFalse | BooleanTrue | Equality | ComplexInfinity | Float | Infinity | Integer | NaN | NegativeInfinity | NegativeOne | Number | One | Rational | Zero" is not assignable to type "Basic"
- .../projects/sympy/sympy/concrete/products.py:275:21 - error: Operator "/" not supported for types "Literal[1]" and "Basic | One | Unknown | tuple[Unknown, ...] | Product* | Equality | BooleanFalse | BooleanTrue | NaN | Zero | NegativeOne | Integer | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr"
+ .../projects/sympy/sympy/concrete/products.py:275:21 - error: Operator "/" not supported for types "Literal[1]" and "Basic | One | Unknown | tuple[Unknown, ...] | Product* | Expr | Equality | BooleanFalse | BooleanTrue | NaN | Zero | NegativeOne | Integer | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number"
+ .../projects/sympy/sympy/functions/combinatorial/numbers.py:3170:13 - error: No overloads for "sum" match the provided arguments (reportCallIssue)
+ .../projects/sympy/sympy/functions/combinatorial/numbers.py:3170:17 - error: Argument of type "Generator[str | Unknown, None, None]" cannot be assigned to parameter "iterable" of type "Iterable[_SupportsSumNoDefaultT@sum]" in function "sum"
+ "Generator[str | Unknown, None, None]" is not assignable to "Iterable[_SupportsSumNoDefaultT@sum]"
+ Type parameter "_T_co@Iterable" is covariant, but "str | Unknown" is not a subtype of "_SupportsSumNoDefaultT@sum"
+ Type "str | Unknown" is not assignable to type "_SupportsSumWithNoDefaultGiven"
+ Type "str | Unknown" is not assignable to type "_SupportsSumWithNoDefaultGiven"
+ "str" is incompatible with protocol "_SupportsSumWithNoDefaultGiven" (reportArgumentType)
+ .../projects/sympy/sympy/functions/combinatorial/numbers.py:3191:30 - error: Operator "*" not supported for types "list[int]" and "int | str | Unknown"
+ Operator "*" not supported for types "list[int]" and "str" when expected type is "Iterable[Unknown]" (reportOperatorIssue)
+ .../projects/sympy/sympy/functions/special/hyper.py:728:34 - error: Cannot access attribute "as_leading_term" for class "Basic"
+ Attribute "as_leading_term" is unknown (reportAttributeAccessIssue)
- .../projects/sympy/sympy/geometry/tests/test_util.py:127:21 - error: Argument of type "Generator[Expr | Any | Unknown, None, None]" cannot be assigned to parameter "iterable" of type "Iterable[SupportsRichComparisonT@min]" in function "min"
+ .../projects/sympy/sympy/geometry/tests/test_util.py:127:21 - error: Argument of type "Generator[Expr | Any, None, None]" cannot be assigned to parameter "iterable" of type "Iterable[SupportsRichComparisonT@min]" in function "min"
- "Generator[Expr | Any | Unknown, None, None]" is not assignable to "Iterable[SupportsRichComparisonT@min]"
+ "Generator[Expr | Any, None, None]" is not assignable to "Iterable[SupportsRichComparisonT@min]"
- Type parameter "_T_co@Iterable" is covariant, but "Expr | Any | Unknown" is not a subtype of "SupportsRichComparisonT@min"
+ Type parameter "_T_co@Iterable" is covariant, but "Expr | Any" is not a subtype of "SupportsRichComparisonT@min"
- Type "Expr | Any | Unknown" is not assignable to type "SupportsRichComparison"
+ Type "Expr | Any" is not assignable to type "SupportsRichComparison"
- Type "Expr | Any | Unknown" is not assignable to type "SupportsRichComparison"
+ Type "Expr | Any" is not assignable to type "SupportsRichComparison"
- .../projects/sympy/sympy/geometry/tests/test_util.py:127:21 - error: Argument of type "Generator[Expr | Any | Unknown, None, None]" cannot be assigned to parameter "iterable" of type "Iterable[SupportsRichComparisonT@max]" in function "max"
+ .../projects/sympy/sympy/geometry/tests/test_util.py:127:21 - error: Argument of type "Generator[Expr | Any, None, None]" cannot be assigned to parameter "iterable" of type "Iterable[SupportsRichComparisonT@max]" in function "max"
- "Generator[Expr | Any | Unknown, None, None]" is not assignable to "Iterable[SupportsRichComparisonT@max]"
+ "Generator[Expr | Any, None, None]" is not assignable to "Iterable[SupportsRichComparisonT@max]"
- Type parameter "_T_co@Iterable" is covariant, but "Expr | Any | Unknown" is not a subtype of "SupportsRichComparisonT@max"
+ Type parameter "_T_co@Iterable" is covariant, but "Expr | Any" is not a subtype of "SupportsRichComparisonT@max"
- Type "Expr | Any | Unknown" is not assignable to type "SupportsRichComparison"
+ Type "Expr | Any" is not assignable to type "SupportsRichComparison"
- Type "Expr | Any | Unknown" is not assignable to type "SupportsRichComparison"
+ Type "Expr | Any" is not assignable to type "SupportsRichComparison"
- .../projects/sympy/sympy/geometry/tests/test_util.py:127:23 - error: Cannot access attribute "distance" for class "tuple[int, int]"
- Attribute "distance" is unknown (reportAttributeAccessIssue)
- .../projects/sympy/sympy/geometry/tests/test_util.py:127:23 - error: Cannot access attribute "distance" for class "list[int]"
- Attribute "distance" is unknown (reportAttributeAccessIssue)
- Attribute "distance" is unknown (reportAttributeAccessIssue)
- .../projects/sympy/sympy/geometry/tests/test_util.py:138:17 - error: Argument of type "Generator[Expr | Any | Unknown, None, None]" cannot be assigned to parameter "iterable" of type "Iterable[SupportsRichComparisonT@min]" in function "min"
- "Generator[Expr | Any | Unknown, None, None]" is not assignable to "Iterable[SupportsRichComparisonT@min]"
- Type parameter "_T_co@Iterable" is covariant, but "Expr | Any | Unknown" is not a subtype of "SupportsRichComparisonT@min"
- Type "Expr | Any | Unknown" is not assignable to type "SupportsRichComparison"
- Type "Expr | Any | Unknown" is not assignable to type "SupportsRichComparison"
- Type "Expr" is not assignable to type "SupportsRichComparison" (reportArgumentType)
- .../projects/sympy/sympy/geometry/tests/test_util.py:138:17 - error: Argument of type "Generator[Expr | Any | Unknown, None, None]" cannot be assigned to parameter "iterable" of type "Iterable[SupportsRichComparisonT@max]" in function "max"
- "Generator[Expr | Any | Unknown, None, None]" is not assignable to "Iterable[SupportsRichComparisonT@max]"
- Type parameter "_T_co@Iterable" is covariant, but "Expr | Any | Unknown" is not a subtype of "SupportsRichComparisonT@max"
- Type "Expr | Any | Unknown" is not assignable to type "SupportsRichComparison"
- Type "Expr | Any | Unknown" is not assignable to type "SupportsRichComparison"
- Type "Expr" is not assignable to type "SupportsRichComparison" (reportArgumentType)
- .../projects/sympy/sympy/geometry/tests/test_util.py:138:19 - error: Cannot access attribute "distance" for class "tuple[int, int]"
- Attribute "distance" is unknown (reportAttributeAccessIssue)
- .../projects/sympy/sympy/geometry/tests/test_util.py:138:19 - error: Cannot access attribute "distance" for class "list[int]"
+ .../projects/sympy/sympy/holonomic/tests/test_holonomic.py:626:12 - error: Operator "-" not supported for types "Basic" and "Basic" (reportOperatorIssue)
+ .../projects/sympy/sympy/holonomic/tests/test_holonomic.py:747:12 - error: Operator "-" not supported for types "Basic" and "Basic" (reportOperatorIssue)
+ .../projects/sympy/sympy/holonomic/tests/test_holonomic.py:753:12 - error: Operator "-" not supported for types "Basic" and "Basic" (reportOperatorIssue)
+ .../projects/sympy/sympy/holonomic/tests/test_holonomic.py:755:12 - error: Operator "-" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/integrals/meijerint.py:2127:21 - error: Operator "+=" not supported for types "list[Unknown] | list[exp] | Unknown | Any" and "Unknown | tuple[Basic, ...] | Any"
- Operator "+" not supported for types "list[exp]" and "tuple[Basic, ...]" (reportOperatorIssue)
... (truncated 951 lines) ...
openlibrary (https://github.com/internetarchive/openlibrary)
+ .../projects/openlibrary/openlibrary/plugins/openlibrary/stats.py:150:24 - error: "__name__" is not a known attribute of "None" (reportOptionalMemberAccess)
+ .../projects/openlibrary/openlibrary/plugins/openlibrary/stats.py:151:73 - error: "encoding" is not a known attribute of "None" (reportOptionalMemberAccess)
+ .../projects/openlibrary/openlibrary/plugins/openlibrary/stats.py:152:35 - error: "encoding" is not a known attribute of "None" (reportOptionalMemberAccess)
- .../projects/openlibrary/openlibrary/views/loanstats.py:135:16 - error: Cannot assign to attribute "reading_log" for class "list[Unknown | list[Unknown]]"
- Attribute "reading_log" is unknown (reportAttributeAccessIssue)
- 1226 errors, 70 warnings, 0 informations
+ 1228 errors, 70 warnings, 0 informations
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "str | int" cannot be assigned to parameter "penalty" of type "str" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "int | str" cannot be assigned to parameter "penalty" of type "str" in function "__init__"
- Type "str | int" is not assignable to type "str"
+ Type "int | str" is not assignable to type "str"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "str | int" cannot be assigned to parameter "dual" of type "bool" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "int | str" cannot be assigned to parameter "dual" of type "bool" in function "__init__"
- Type "str | int" is not assignable to type "bool"
+ Type "int | str" is not assignable to type "bool"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "str | int" cannot be assigned to parameter "tol" of type "float" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "int | str" cannot be assigned to parameter "tol" of type "float" in function "__init__"
- Type "str | int" is not assignable to type "float"
+ Type "int | str" is not assignable to type "float"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "str | int" cannot be assigned to parameter "C" of type "float" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "int | str" cannot be assigned to parameter "C" of type "float" in function "__init__"
- Type "str | int" is not assignable to type "float"
+ Type "int | str" is not assignable to type "float"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "str | int" cannot be assigned to parameter "fit_intercept" of type "bool" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "int | str" cannot be assigned to parameter "fit_intercept" of type "bool" in function "__init__"
- Type "str | int" is not assignable to type "bool"
+ Type "int | str" is not assignable to type "bool"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "str | int" cannot be assigned to parameter "intercept_scaling" of type "int" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "int | str" cannot be assigned to parameter "intercept_scaling" of type "int" in function "__init__"
- Type "str | int" is not assignable to type "int"
+ Type "int | str" is not assignable to type "int"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "str | int" cannot be assigned to parameter "solver" of type "str" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "int | str" cannot be assigned to parameter "solver" of type "str" in function "__init__"
- Type "str | int" is not assignable to type "str"
+ Type "int | str" is not assignable to type "str"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "str | int" cannot be assigned to parameter "max_iter" of type "int" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "int | str" cannot be assigned to parameter "max_iter" of type "int" in function "__init__"
- Type "str | int" is not assignable to type "int"
+ Type "int | str" is not assignable to type "int"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "str | int" cannot be assigned to parameter "multi_class" of type "str" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "int | str" cannot be assigned to parameter "multi_class" of type "str" in function "__init__"
- Type "str | int" is not assignable to type "str"
+ Type "int | str" is not assignable to type "str"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "str | int" cannot be assigned to parameter "verbose" of type "int" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "int | str" cannot be assigned to parameter "verbose" of type "int" in function "__init__"
- Type "str | int" is not assignable to type "int"
+ Type "int | str" is not assignable to type "int"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "str | int" cannot be assigned to parameter "warm_start" of type "bool" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1073:62 - error: Argument of type "int | str" cannot be assigned to parameter "warm_start" of type "bool" in function "__init__"
- Type "str | int" is not assignable to type "bool"
+ Type "int | str" is not assignable to type "bool"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "str | int" cannot be assigned to parameter "penalty" of type "str" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "int | str" cannot be assigned to parameter "penalty" of type "str" in function "__init__"
- Type "str | int" is not assignable to type "str"
+ Type "int | str" is not assignable to type "str"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "str | int" cannot be assigned to parameter "dual" of type "bool" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "int | str" cannot be assigned to parameter "dual" of type "bool" in function "__init__"
- Type "str | int" is not assignable to type "bool"
+ Type "int | str" is not assignable to type "bool"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "str | int" cannot be assigned to parameter "tol" of type "float" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "int | str" cannot be assigned to parameter "tol" of type "float" in function "__init__"
- Type "str | int" is not assignable to type "float"
+ Type "int | str" is not assignable to type "float"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "str | int" cannot be assigned to parameter "C" of type "float" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "int | str" cannot be assigned to parameter "C" of type "float" in function "__init__"
- Type "str | int" is not assignable to type "float"
+ Type "int | str" is not assignable to type "float"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "str | int" cannot be assigned to parameter "fit_intercept" of type "bool" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "int | str" cannot be assigned to parameter "fit_intercept" of type "bool" in function "__init__"
- Type "str | int" is not assignable to type "bool"
+ Type "int | str" is not assignable to type "bool"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "str | int" cannot be assigned to parameter "intercept_scaling" of type "int" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "int | str" cannot be assigned to parameter "intercept_scaling" of type "int" in function "__init__"
- Type "str | int" is not assignable to type "int"
+ Type "int | str" is not assignable to type "int"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "str | int" cannot be assigned to parameter "solver" of type "str" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "int | str" cannot be assigned to parameter "solver" of type "str" in function "__init__"
- Type "str | int" is not assignable to type "str"
+ Type "int | str" is not assignable to type "str"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "str | int" cannot be assigned to parameter "max_iter" of type "int" in function "__init__"
+ .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "int | str" cannot be assigned to parameter "max_iter" of type "int" in function "__init__"
- Type "str | int" is not assignable to type "int"
+ Type "int | str" is not assignable to type "int"
- .../projects/scikit-learn/sklearn/linear_model/tests/test_logistic.py:1074:69 - error: Argument of type "str | int" cannot be assigned to parameter "multi_class" of type "str" in function "__init__"
... (truncated 31 lines) ...
prefect (https://github.com/PrefectHQ/prefect)
- .../projects/prefect/src/integrations/prefect-sqlalchemy/prefect_sqlalchemy/database.py:308:44 - error: Argument of type "Dict[str, Any]" cannot be assigned to parameter "begin" of type "bool" in function "get_connection"
+ .../projects/prefect/src/integrations/prefect-sqlalchemy/prefect_sqlalchemy/database.py:308:44 - error: Argument of type "dict[str, Any]" cannot be assigned to parameter "begin" of type "bool" in function "get_connection"
- "Dict[str, Any]" is not assignable to "bool" (reportArgumentType)
+ "dict[str, Any]" is not assignable to "bool" (reportArgumentType)
- .../projects/prefect/src/integrations/prefect-sqlalchemy/prefect_sqlalchemy/database.py:341:46 - error: Argument of type "Dict[str, Any]" cannot be assigned to parameter "begin" of type "bool" in function "get_connection"
+ .../projects/prefect/src/integrations/prefect-sqlalchemy/prefect_sqlalchemy/database.py:341:46 - error: Argument of type "dict[str, Any]" cannot be assigned to parameter "begin" of type "bool" in function "get_connection"
- "Dict[str, Any]" is not assignable to "bool" (reportArgumentType)
+ "dict[str, Any]" is not assignable to "bool" (reportArgumentType)
- .../projects/prefect/src/integrations/prefect-sqlalchemy/prefect_sqlalchemy/database.py:344:40 - error: Argument of type "Dict[str, Any]" cannot be assigned to parameter "begin" of type "bool" in function "get_connection"
+ .../projects/prefect/src/integrations/prefect-sqlalchemy/prefect_sqlalchemy/database.py:344:40 - error: Argument of type "dict[str, Any]" cannot be assigned to parameter "begin" of type "bool" in function "get_connection"
- "Dict[str, Any]" is not assignable to "bool" (reportArgumentType)
+ "dict[str, Any]" is not assignable to "bool" (reportArgumentType)
- .../projects/prefect/src/integrations/prefect-sqlalchemy/prefect_sqlalchemy/database.py:361:52 - error: Argument of type "Dict[str, Any]" cannot be assigned to parameter "hash_algo" of type "(...) -> Any" in function "hash_objects"
+ .../projects/prefect/src/integrations/prefect-sqlalchemy/prefect_sqlalchemy/database.py:361:52 - error: Argument of type "dict[str, Any]" cannot be assigned to parameter "hash_algo" of type "(...) -> Any" in function "hash_objects"
- Type "Dict[str, Any]" is not assignable to type "(...) -> Any" (reportArgumentType)
+ Type "dict[str, Any]" is not assignable to type "(...) -> Any" (reportArgumentType)
- .../projects/prefect/src/integrations/prefect-sqlalchemy/prefect_sqlalchemy/database.py:361:52 - error: Argument of type "Dict[str, Any]" cannot be assigned to parameter "raise_on_failure" of type "bool" in function "hash_objects"
+ .../projects/prefect/src/integrations/prefect-sqlalchemy/prefect_sqlalchemy/database.py:361:52 - error: Argument of type "dict[str, Any]" cannot be assigned to parameter "raise_on_failure" of type "bool" in function "hash_objects"
- "Dict[str, Any]" is not assignable to "bool" (reportArgumentType)
+ "dict[str, Any]" is not assignable to "bool" (reportArgumentType)
mitmproxy (https://github.com/mitmproxy/mitmproxy)
- .../projects/mitmproxy/docs/src/examples/addons/wsgi-flask-app.py
- .../projects/mitmproxy/docs/src/examples/addons/wsgi-flask-app.py:9:6 - error: Import "flask" could not be resolved (reportMissingImports)
- .../projects/mitmproxy/docs/src/examples/contrib/all_markers.py
- .../projects/mitmproxy/docs/src/examples/contrib/all_markers.py:13:59 - error: Cannot access attribute "view" for class "Master"
- Attribute "view" is unknown (reportAttributeAccessIssue)
- .../projects/mitmproxy/docs/src/examples/contrib/change_upstream_proxy.py
- .../projects/mitmproxy/docs/src/examples/contrib/change_upstream_proxy.py:28:34 - error: Object of type "None" is not subscriptable (reportOptionalSubscript)
- .../projects/mitmproxy/docs/src/examples/contrib/check_ssl_pinning.py
- .../projects/mitmproxy/docs/src/examples/contrib/check_ssl_pinning.py:4:8 - warning: Import "OpenSSL" could not be resolved from source (reportMissingModuleSource)
- .../projects/mitmproxy/docs/src/examples/contrib/check_ssl_pinning.py:29:20 - error: "crypto" is not a known attribute of module "OpenSSL" (reportAttributeAccessIssue)
- .../projects/mitmproxy/docs/src/examples/contrib/check_ssl_pinning.py:57:22 - error: "crypto" is not a known attribute of module "OpenSSL" (reportAttributeAccessIssue)
- .../projects/mitmproxy/docs/src/examples/contrib/check_ssl_pinning.py:93:19 - error: "certs" is not a known attribute of module "mitmproxy" (reportAttributeAccessIssue)
- .../projects/mitmproxy/docs/src/examples/contrib/http_manipulate_cookies.py
- .../projects/mitmproxy/docs/src/examples/contrib/http_manipulate_cookies.py:87:37 - error: "headers" is not a known attribute of "None" (reportOptionalMemberAccess)
- .../projects/mitmproxy/docs/src/examples/contrib/http_manipulate_cookies.py:102:23 - error: "headers" is not a known attribute of "None" (reportOptionalMemberAccess)
- .../projects/mitmproxy/docs/src/examples/contrib/jsondump.py
- .../projects/mitmproxy/docs/src/examples/contrib/jsondump.py:41:8 - warning: Import "requests" could not be resolved from source (reportMissingModuleSource)
- .../projects/mitmproxy/docs/src/examples/contrib/jsondump.py:182:20 - error: Object of type "None" cannot be used as iterable value (reportOptionalIterable)
- .../projects/mitmproxy/docs/src/examples/contrib/jsondump.py:188:23 - error: "acquire" is not a known attribute of "None" (reportOptionalMemberAccess)
- .../projects/mitmproxy/docs/src/examples/contrib/jsondump.py:190:23 - error: "release" is not a known attribute of "None" (reportOptionalMemberAccess)
- .../projects/mitmproxy/docs/src/examples/contrib/jsondump.py:192:27 - error: Argument of type "Any | None" cannot be assigned to parameter "url" of type "str | bytes" in function "post"
- Type "Any | None" is not assignable to type "str | bytes"
- Type "None" is not assignable to type "str | bytes"
- "None" is not assignable to "str"
- "None" is not assignable to "bytes" (reportArgumentType)
- .../projects/mitmproxy/docs/src/examples/contrib/mitmproxywrapper.py
- .../projects/mitmproxy/docs/src/examples/contrib/mitmproxywrapper.py:164:59 - error: Argument of type "None" cannot be assigned to parameter "RequestHandlerClass" of type "(Any, _RetAddress, TCPServer) -> BaseRequestHandler" in function "__init__"
- Type "None" is not assignable to type "(Any, _RetAddress, TCPServer) -> BaseRequestHandler" (reportArgumentType)
- .../projects/mitmproxy/docs/src/examples/contrib/modify_body_inject_iframe.py
- .../projects/mitmproxy/docs/src/examples/contrib/modify_body_inject_iframe.py:2:6 - warning: Import "bs4" could not be resolved from source (reportMissingModuleSource)
- .../projects/mitmproxy/docs/src/examples/contrib/modify_body_inject_iframe.py:14:34 - error: Argument of type "bytes | None" cannot be assigned to parameter "markup" of type "str | bytes | SupportsRead[str] | SupportsRead[bytes]" in function "__init__"
- Type "bytes | None" is not assignable to type "str | bytes | SupportsRead[str] | SupportsRead[bytes]"
- Type "None" is not assignable to type "str | bytes | SupportsRead[str] | SupportsRead[bytes]"
- "None" is not assignable to "str"
- "None" is not assignable to "bytes"
- "None" is incompatible with protocol "SupportsRead[str]"
- "read" is not present
- "None" is incompatible with protocol "SupportsRead[bytes]"
- "read" is not present (reportArgumentType)
- .../projects/mitmproxy/docs/src/examples/contrib/modify_body_inject_iframe.py:14:48 - error: "content" is not a known attribute of "None" (reportOptionalMemberAccess)
- .../projects/mitmproxy/docs/src/examples/contrib/modify_body_inject_iframe.py:20:31 - error: "content" is not a known attribute of "None" (reportOptionalMemberAccess)
- .../projects/mitmproxy/docs/src/examples/contrib/ntlm_upstream_proxy.py
- .../projects/mitmproxy/docs/src/examples/contrib/ntlm_upstream_proxy.py:8:6 - error: Import "ntlm_auth" could not be resolved (reportMissingImports)
- .../projects/mitmproxy/docs/src/examples/contrib/ntlm_upstream_proxy.py:9:6 - error: Import "ntlm_auth" could not be resolved (reportMissingImports)
- .../projects/mitmproxy/docs/src/examples/contrib/ntlm_upstream_proxy.py:18:41 - error: "HttpConnectUpstreamHook" is unknown import symbol (reportAttributeAccessIssue)
- .../projects/mitmproxy/docs/src/examples/contrib/ntlm_upstream_proxy.py:38:22 - error: Argument of type "UnionType" cannot be assigned to parameter "typespec" of type "type" in function "add_option"
- "UnionType" is not assignable to "type" (reportArgumentType)
- .../projects/mitmproxy/docs/src/examples/contrib/ntlm_upstream_proxy.py:47:22 - error: Argument of type "UnionType" cannot be assigned to parameter "typespec" of type "type" in function "add_option"
- "UnionType" is not assignable to "type" (reportArgumentType)
... (truncated 267 lines) ...``` |
Improved startup responsiveness on large monorepos by making source file discovery code non-blocking. This addresses #3075.
Without this change, pyright hangs for tens of seconds when used on a large monorepo (>100K files). With this change, pyright's LSP functionality (hover, goto definition, etc.) are responsive almost immediately. Some LSP functions like "find all references" or "workspace symbols" will be inaccurate or incomplete until all project files are enumerated, but these features are not all that usable on a monorepo — at least unless you're using pylance with a populated index.