Skip to content
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
2 changes: 1 addition & 1 deletion .claude/commands/pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ Create a branch (if needed), commit staged/unstaged changes, push, and open/upda
- Body: formatted using this repo's PR template (`.github/PULL_REQUEST_TEMPLATE.md`),
with an additional footer: `🤖 Generated with [Claude Code](https://claude.ai/claude-code)`
- Labels — add any that are relevant:
- `bug`, `build`, `ci/cd`, `code-folding`, dependencies`, `enhancement`, `refactor`, `sytax-highlighting`
- `bug`, `build`, `ci/cd`, `dependencies`, `enhancement`, `refactor`
- Only add a `tests` label if the PR is *only* adding test coverage
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6

- name: Set up JDK 17
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '17'
java-version: '25'
distribution: 'temurin'

# Initializes the CodeQL tools for scanning.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:

strategy:
matrix:
java: [ '17', '21', '23' ]
java: [ '25', '26' ]

steps:
- uses: actions/checkout@v6

- name: Verify gradle wrapper
uses: gradle/actions/wrapper-validation@v5
if: matrix.java == '17'
uses: gradle/actions/wrapper-validation@v6
if: matrix.java == '25'

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,13 @@ public boolean removeCompletion(Completion c) {
public static class CaseInsensitiveComparator implements Comparator,
Serializable {

/**
* Empty constructor.
*/
public CaseInsensitiveComparator() {
// Empty constructor for Javadoc/linting
}

@Override
public int compare(Object o1, Object o2) {
String s1 = o1 instanceof String ? (String)o1 :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ protected void doAutocomplete() {
*/
private static KeyStroke getCopyKeyStroke() {
int key = KeyEvent.VK_C;
int mask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
int mask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx();
return KeyStroke.getKeyStroke(key, mask);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.Rectangle2D;
import java.beans.*;
import java.util.List;
import javax.swing.*;
Expand Down Expand Up @@ -380,8 +381,8 @@ static boolean getDebug() {
* @return The default auto-complete trigger key.
*/
public static KeyStroke getDefaultTriggerKey() {
// Default to CTRL, even on Mac, since Ctrl+Space activates Spotlight
int mask = InputEvent.CTRL_MASK;
// Default to CTRL, even on Mac, since Cmd+Space activates Spotlight
int mask = InputEvent.CTRL_DOWN_MASK;
return KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, mask);
}

Expand Down Expand Up @@ -865,19 +866,17 @@ protected int refreshPopupWindow() {
popupWindow.setCompletions(completions);

if (!popupWindow.isVisible()) {
Rectangle r;
Rectangle2D r;
try {
r = textComponent.modelToView(textComponent
.getCaretPosition());
r = textComponent.modelToView2D(textComponent.getCaretPosition());
} catch (BadLocationException ble) {
ble.printStackTrace();
return -1;
}
Point p = new Point(r.x, r.y);
Point p = new Point((int)r.getX(), (int)r.getY());
SwingUtilities.convertPointToScreen(p, textComponent);
r.x = p.x;
r.y = p.y;
popupWindow.setLocationRelativeTo(r);
Rectangle r2 = new Rectangle(p.x, p.y, (int)r.getWidth(), (int)r.getHeight());
popupWindow.setLocationRelativeTo(r2);
setPopupVisible(true);
}

Expand Down Expand Up @@ -1416,11 +1415,17 @@ public void removeUpdate(DocumentEvent e) {
}

/**
* The <code>Action</code> that displays the popup window if auto-completion
* is enabled.
* The <code>Action</code> that displays the popup window if auto-completionn is enabled.
*/
protected class AutoCompleteAction extends AbstractAction {

/**
* Empty constructor.
*/
protected AutoCompleteAction() {
// Empty constructor for Javadoc constructor/linting
}

@Override
public void actionPerformed(ActionEvent e) {
if (isAutoCompleteEnabled()) {
Expand Down Expand Up @@ -1486,8 +1491,7 @@ public void actionPerformed(ActionEvent e) {
* Listens for events in the parent window of the text component with
* auto-completion enabled.
*/
private final class ParentWindowListener extends ComponentAdapter implements
WindowFocusListener {
private final class ParentWindowListener extends ComponentAdapter implements WindowFocusListener {

public void addTo(Window w) {
w.addComponentListener(this);
Expand Down Expand Up @@ -1558,8 +1562,7 @@ public void uninstall(AutoCompletePopupWindow popupWindow) {
/**
* Listens for events from the text component we're installed on.
*/
private final class TextComponentListener extends FocusAdapter implements
HierarchyListener {
private final class TextComponentListener extends FocusAdapter implements HierarchyListener {

void addTo(JTextComponent tc) {
tc.addFocusListener(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private String createTypeColor() {
public void delegateToSubstanceRenderer() throws Exception {
Class<?> clazz = Class.forName(SUBSTANCE_RENDERER_CLASS_NAME);
DefaultListCellRenderer delegate =
(DefaultListCellRenderer)clazz.newInstance();
(DefaultListCellRenderer)clazz.getDeclaredConstructor().newInstance();
setDelegateRenderer(delegate);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ public abstract class CompletionProviderBase implements CompletionProvider {
new SortByRelevanceComparator();


/**
* Empty constructor.
*/
public CompletionProviderBase() {
// Constructor only for no-oart Javadoc comment/linting
}


@Override
public void clearParameterizedCompletionParams() {
paramListEnd = paramListStart = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public String getAlreadyEnteredText(JTextComponent comp) {
@Override
public List<Completion> getCompletionsAt(JTextComponent tc, Point p) {

int offset = tc.viewToModel(p);
int offset = tc.viewToModel2D(p);
if (offset<0 || offset>=tc.getDocument().getLength()) {
lastCompletionsAtText = null;
return lastParameterizedCompletionsAt = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ public Object getTypeObject() {
}

/**
* Returns whether this is the last parameter in the completion text.
*
* @return Whether this parameter is an "ending parameter;"
* that is, whether this parameter is at a logical "ending
* point" in the completion text. If the user types in a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.awt.event.FocusListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.List;
import javax.swing.AbstractAction;
Expand Down Expand Up @@ -205,12 +206,11 @@ public void activate() {
parentWindow, this, ac, pc);
try {
int dot = tc.getCaretPosition();
Rectangle r = tc.modelToView(dot);
Point p = new Point(r.x, r.y);
Rectangle2D r = tc.modelToView2D(dot);
Point p = new Point((int)r.getX(), (int)r.getY());
SwingUtilities.convertPointToScreen(p, tc);
r.x = p.x;
r.y = p.y;
tip.setLocationRelativeTo(r);
Rectangle r2 = new Rectangle(p.x, p.y, (int)r.getWidth(), (int)r.getHeight());
tip.setLocationRelativeTo(r2);
tip.setVisible(true);
} catch (BadLocationException ble) { // Should never happen
UIManager.getLookAndFeel().provideErrorFeedback(tc);
Expand Down Expand Up @@ -472,7 +472,7 @@ private void installKeyBindings() {
oldTabAction = am.get(IM_KEY_TAB);
am.put(IM_KEY_TAB, new NextParamAction());

ks = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK);
ks = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_DOWN_MASK);
oldShiftTabKey = im.get(ks);
im.put(ks, IM_KEY_SHIFT_TAB);
oldShiftTabAction = am.get(IM_KEY_SHIFT_TAB);
Expand Down Expand Up @@ -674,12 +674,11 @@ private void prepareParamChoicesWindow() {

JTextComponent tc = ac.getTextComponent();
try {
Rectangle r = tc.modelToView(offs);
Point p = new Point(r.x, r.y);
Rectangle2D r = tc.modelToView2D(offs);
Point p = new Point((int)r.getX(), (int)r.getY());
SwingUtilities.convertPointToScreen(p, tc);
r.x = p.x;
r.y = p.y;
paramChoicesWindow.setLocationRelativeTo(r);
Rectangle r2 = new Rectangle(p.x, p.y, (int)r.getWidth(), (int)r.getHeight());
paramChoicesWindow.setLocationRelativeTo(r2);
} catch (BadLocationException ble) { // Should never happen
UIManager.getLookAndFeel().provideErrorFeedback(tc);
ble.printStackTrace();
Expand Down Expand Up @@ -770,7 +769,7 @@ private void uninstallKeyBindings() {
im.put(ks, oldTabKey);
am.put(IM_KEY_TAB, oldTabAction);

ks = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK);
ks = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_DOWN_MASK);
im.put(ks, oldShiftTabKey);
am.put(IM_KEY_SHIFT_TAB, oldShiftTabAction);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
*/
public class SortByRelevanceComparator implements Comparator<Completion>, Serializable {

/**
* Compares to {@code CompletionProvider}s by their relevance before sorting them
* lexicographically.
*/
public SortByRelevanceComparator() {
// Do nothing (for Javadoc comment)
}


@Override
public int compare(Completion c1, Completion c2) {
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ plugins {

apply plugin: 'io.github.gradle-nexus.publish-plugin'

// We require building with JDK 17 or later. Built artifact compatibility
// We require building with JDK 25 or later. Built artifact compatibility
// is controlled by javaLanguageVersion
assert JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)
assert JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_25)

group = 'com.fifesoft'
// NOTE: Local Java 17: /Library/Java/JavaVirtualMachines/jdk-17.0.13+11/Contents/Home
// NOTE: Local Java 25: /Library/Java/JavaVirtualMachines/jdk-25.0.1+8/Contents/Home

allprojects {

Expand All @@ -31,7 +31,7 @@ allprojects {
}

wrapper {
gradleVersion = '9.2.1'
gradleVersion = '9.6.1'
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Note that Maven- and signing-related properties are in <gradle-user-home>/gradle.properties
javaLanguageVersion=8
javaLanguageVersion=11
version=3.3.4-SNAPSHOT

# Ugh, see https://github.com/gradle/gradle/issues/11308
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 3 additions & 3 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 12 additions & 23 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.