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 org.eclipse.lsp4e/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Language Server Protocol client for Eclipse IDE (Incubation)
Bundle-SymbolicName: org.eclipse.lsp4e;singleton:=true
Bundle-Version: 0.19.9.qualifier
Bundle-Version: 0.19.10.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-21
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.12.0",
org.eclipse.equinox.common;bundle-version="3.8.0",
Expand Down
3 changes: 3 additions & 0 deletions org.eclipse.lsp4e/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@
<initializer
class="org.eclipse.lsp4e.operations.linkedediting.LSPLinkedEditingBase$PreferenceInitializer">
</initializer>
<initializer
class="org.eclipse.lsp4e.operations.rename.LSPInlineRenameLinkedMode$PreferenceInitializer">
</initializer>
</extension>

<extension point="org.eclipse.ui.genericeditor.foldingReconcilers">
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.lsp4e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<artifactId>org.eclipse.lsp4e</artifactId>
<packaging>eclipse-plugin</packaging>
<version>0.19.9-SNAPSHOT</version>
<version>0.19.10-SNAPSHOT</version>

<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
Expand Down Expand Up @@ -71,6 +71,15 @@
public final class LSPInlineRenameLinkedMode {

private static final String INLINE_RENAME_PREFERENCE = "org.eclipse.lsp4e.inlineRename"; //$NON-NLS-1$
private static final boolean INLINE_RENAME_ACTIVE_DEFAULT = true;

public static final class PreferenceInitializer extends AbstractPreferenceInitializer {
@Override
public void initializeDefaultPreferences() {
final var store = LanguageServerPlugin.getDefault().getPreferenceStore();
store.setDefault(INLINE_RENAME_PREFERENCE, INLINE_RENAME_ACTIVE_DEFAULT);
}
}

static boolean start(final IDocument document, final ITextViewer viewer, final int offset, final Shell shell) {
if (!isInlineRenameEnabled()) {
Expand Down Expand Up @@ -121,8 +130,7 @@ protected IStatus run(final IProgressMonitor monitor) {
}

private static boolean isInlineRenameEnabled() {
final var prefs = InstanceScope.INSTANCE.getNode(LanguageServerPlugin.PLUGIN_ID);
return prefs.getBoolean(INLINE_RENAME_PREFERENCE, true);
return LanguageServerPlugin.getDefault().getPreferenceStore().getBoolean(INLINE_RENAME_PREFERENCE);
}

private static @Nullable RefactoringStatus runPrepareRename(final LSPRenameProcessor processor) {
Expand Down
Loading