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

Console history mix In 2024.2 #104 #105

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# KdbInsideBrains Changelog

## [5.10.1]

### Fixed

- Issue #104: In 2024.2, instances do not split console history

## [5.10.0]

### Changed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.kdb.inside.brains.view.console;

import com.intellij.execution.actions.ClearConsoleAction;
import com.intellij.execution.console.BaseConsoleExecuteActionHandler;
import com.intellij.execution.console.GutterContentProvider;
import com.intellij.execution.console.LanguageConsoleBuilder;
import com.intellij.execution.console.LanguageConsoleView;
Expand Down Expand Up @@ -173,24 +172,25 @@ private JBSplitter createWatchesSplitter() {
}

private TabInfo createConsoleTab() {
final LanguageConsoleBuilder b = new LanguageConsoleBuilder();
b.executionEnabled(view -> connection != null && connection.isConnected());

b.initActions(new BaseConsoleExecuteActionHandler(true) {
@Override
protected void execute(@NotNull String text, @NotNull LanguageConsoleView console) {
if (!showHistory) {
clearHistory();
gutterProvider.beforeEvaluate(console.getHistoryViewer());
}
processQuery(new KdbQuery(text));
}
}, "KdbConsolePanel-" + connection.getName());
final String historyName = "KdbConsolePanel-" + connection.getName();

final LanguageConsoleBuilder b = new LanguageConsoleBuilder();
b.gutterContentProvider(gutterProvider);

console = b.build(project, QLanguage.INSTANCE);

LanguageConsoleBuilder.registerExecuteAction(console,
text -> {
if (!showHistory) {
clearHistory();
gutterProvider.beforeEvaluate(console.getHistoryViewer());
}
processQuery(new KdbQuery(text));
},
historyName,
historyName,
view -> connection.isConnected()
);

printToConsole("Kdb console for instance: " + connection.getName() + ".\n", ConsoleViewContentType.SYSTEM_OUTPUT);

watchesSplitter.setFirstComponent(console.getComponent());
Expand Down Expand Up @@ -597,8 +597,7 @@ public void dispose() {
if (scope != null) {
scope.removeScopeListener(scopeListener);
}
// Disposer.dispose(console);
// Disposer.dispose(resultTabs);
Disposer.dispose(console);
}

private void printInstanceError(Exception ex) {
Expand Down
2 changes: 1 addition & 1 deletion version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pluginVersion=5.10.0
pluginVersion=5.10.1
Loading