File tree Expand file tree Collapse file tree
org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/linkedediting Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616import java .util .Optional ;
1717import java .util .concurrent .CompletableFuture ;
1818
19+ import org .eclipse .core .runtime .preferences .DefaultScope ;
1920import org .eclipse .core .runtime .preferences .IEclipsePreferences ;
2021import org .eclipse .core .runtime .preferences .IEclipsePreferences .IPreferenceChangeListener ;
2122import org .eclipse .core .runtime .preferences .IEclipsePreferences .PreferenceChangeEvent ;
3334
3435public class LSPLinkedEditingBase implements IPreferenceChangeListener {
3536 public static final String LINKED_EDITING_PREFERENCE = "org.eclipse.ui.genericeditor.linkedediting" ; //$NON-NLS-1$
37+ private static final boolean LINKED_EDITING_ACTIVE_DEFAULT = true ;
3638
3739 private @ Nullable CompletableFuture <List <LinkedEditingRanges >> request ;
3840 protected boolean fEnabled ;
3941
4042 protected void install () {
41- IEclipsePreferences preferences = InstanceScope .INSTANCE .getNode (LanguageServerPlugin .PLUGIN_ID );
42- preferences .addPreferenceChangeListener (this );
43- this .fEnabled = preferences .getBoolean (LINKED_EDITING_PREFERENCE , true );
43+ IEclipsePreferences defaultScopePreferences = DefaultScope .INSTANCE .getNode (LanguageServerPlugin .PLUGIN_ID );
44+ boolean defaultValue = defaultScopePreferences .getBoolean (LINKED_EDITING_PREFERENCE , LINKED_EDITING_ACTIVE_DEFAULT );
45+
46+ IEclipsePreferences instanceScopePreferences = InstanceScope .INSTANCE .getNode (LanguageServerPlugin .PLUGIN_ID );
47+ instanceScopePreferences .addPreferenceChangeListener (this );
48+
49+ this .fEnabled = instanceScopePreferences .getBoolean (LINKED_EDITING_PREFERENCE , defaultValue );
4450 }
4551
4652 protected void uninstall () {
You can’t perform that action at this time.
0 commit comments