Skip to content

Commit

Permalink
Enable sharding in the IDE
Browse files Browse the repository at this point in the history
Summary: Similar idea to D64331815. We want to test out sharding in the IDE, but we should make sure we don't absolutely trash UX around it. This lets us double check that sharding works and actually speeds up type checking. If it looks good, then we'll enable it by default.

Reviewed By: grievejia

Differential Revision: D64418245

fbshipit-source-id: 91abe3f1fd5a4a5632cd3c4bfc58547673ecccc4
  • Loading branch information
connernilsen authored and facebook-github-bot committed Oct 16, 2024
1 parent 5e65518 commit 2c7269a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/commands/pyre_language_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,8 @@ async def _query_buck_for_type_errors(
tempfile.NamedTemporaryFile(mode="w") as argfile,
):
print("--", file=argfile)
if self.get_language_server_features().type_error_sharding.is_enabled():
print("--enable-sharding\ntrue", file=argfile)
print(
*[
argument
Expand Down Expand Up @@ -995,6 +997,7 @@ async def handle_overlay_type_errors(
"telemetry_version": 3,
"new_file_loaded": new_file_loaded,
"isolation_dir": isolation_dir,
"sharding_enabled": self.get_language_server_features().type_error_sharding.is_enabled(),
},
**daemon_status_before.as_telemetry_dict(),
},
Expand Down
4 changes: 4 additions & 0 deletions client/language_server/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def is_disabled(self) -> bool:
FormattingAvailability = _Availability
PerTargetTypeErrorsAvailability = CustomAvailability
PerTargetIsolationDirAvailability = CustomAvailability
TypeErrorShardingAvailability = CustomAvailability
PythonAutoTargetsAvailability = CustomAvailability
SystemPyAutoTargetsAvailability = CustomAvailability
# TODO: T204372341 remove this once we have rolled out addition and removal features
Expand All @@ -123,6 +124,9 @@ class LanguageServerFeatures:
per_target_isolation_dir: PerTargetIsolationDirAvailability = (
PerTargetIsolationDirAvailability.from_enabled(False)
)
type_error_sharding: TypeErrorShardingAvailability = (
TypeErrorShardingAvailability.from_enabled(False)
)
unsaved_changes: UnsavedChangesAvailability = UnsavedChangesAvailability.DISABLED
telemetry: TelemetryAvailability = TelemetryAvailability.DISABLED
completion: CompletionAvailability = CompletionAvailability.DISABLED
Expand Down

0 comments on commit 2c7269a

Please sign in to comment.