Skip to content

Commit

Permalink
[rdct] remove guest naming from ToolWindowContentExtractor, pass clie…
Browse files Browse the repository at this point in the history
…nt session to it's isAvailable

GitOrigin-RevId: df0541ba88a050087fcb79c9b0ad00c5d38096e2
  • Loading branch information
Maria Filipanova authored and intellij-monorepo-bot committed Jul 30, 2024
1 parent d619012 commit 128eeab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public static void addThreadDump(Project project, List<ThreadState> threads, Run
content.putUserData(RunnerContentUi.LIGHTWEIGHT_CONTENT_MARKER, Boolean.TRUE);
content.setCloseable(true);
content.setDescription(JavaDebuggerBundle.message("thread.dump"));
content.putUserData(ToolWindowContentExtractor.SYNC_TAB_TO_GUEST, true);
content.putUserData(ToolWindowContentExtractor.SYNC_TAB_TO_REMOTE_CLIENTS, true);
ui.addContent(content);
ui.selectAndFocus(content, true, true);
myThreadDumpsCount++;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ui.viewModel.extraction;

import com.intellij.openapi.client.ClientProjectSession;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.util.Key;
import com.intellij.ui.content.Content;
Expand All @@ -10,17 +11,18 @@
/**
* This extension point is used to allow or disallow synchronization of content (tabs)
* in Run and Debug tool windows in Code With Me and/or JetBrains Gateway (remote development).
* In simple case you can just use {@link #SYNC_TAB_TO_GUEST} to mark content or process handler to be synchronized.
* If your content contains virtual files that must be visible by guests (i.e. in editors)
* you should mark them with {@link #FILE_VISIBLE_FOR_GUEST}.
* For Remote Development, by default, lux will be used to transfer the content.
* Otherwise, in simple cases you can just use {@link #SYNC_TAB_TO_REMOTE_CLIENTS} to mark content or process handler to be synchronized.
* If your content contains virtual files that must be visible (i.e. in editors)
* you should mark them with {@link #FILE_VISIBLE_FOR_REMOTE_CLIENTS}.
*/
@ApiStatus.Experimental
public interface ToolWindowContentExtractor {
ExtensionPointName<ToolWindowContentExtractor> EP_NAME = ExtensionPointName.create("com.intellij.toolWindowContentExtractor");
Key<Boolean> SYNC_TAB_TO_GUEST = Key.create("ToolWindowContentExtractor.SyncTabToGuest");
Key<Boolean> FILE_VISIBLE_FOR_GUEST = Key.create("ToolWindowContentExtractor.FileVisibleForGuest");
Key<Boolean> SYNC_TAB_TO_REMOTE_CLIENTS = Key.create("ToolWindowContentExtractor.SyncTabToGuest");
Key<Boolean> FILE_VISIBLE_FOR_REMOTE_CLIENTS = Key.create("ToolWindowContentExtractor.FileVisibleForGuest");

boolean isApplicable(@NotNull Content content);
boolean isApplicable(@NotNull Content content, @NotNull ClientProjectSession session);

boolean syncContentToGuests(@NotNull Content content);
boolean syncContentToRemoteClient(@NotNull Content content);
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void execute(@NotNull final Module module) {
try {
if (!setWorkDir(module)) return;
final ProcessHandler process = createProcess(module);
process.putUserData(ToolWindowContentExtractor.SYNC_TAB_TO_GUEST, true);
process.putUserData(ToolWindowContentExtractor.SYNC_TAB_TO_REMOTE_CLIENTS, true);
new RunContentExecutor(project, process)
.withFilter(new PythonTracebackFilter(project))
.withTitle("reStructuredText")
Expand Down
2 changes: 1 addition & 1 deletion python/src/com/jetbrains/python/run/PythonTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ public void run(final @Nullable Map<String, String> env, final @Nullable Console
final ProcessHandler process = createProcess(env);
final Project project = myModule.getProject();
stopProcessWhenAppClosed(process);
process.putUserData(ToolWindowContentExtractor.SYNC_TAB_TO_GUEST, true);
process.putUserData(ToolWindowContentExtractor.SYNC_TAB_TO_REMOTE_CLIENTS, true);
new RunContentExecutor(project, process)
.withFilter(new PythonTracebackFilter(project))
.withConsole(consoleView)
Expand Down

0 comments on commit 128eeab

Please sign in to comment.