Skip to content

Commit

Permalink
Refactor Enter Between Braces Handler
Browse files Browse the repository at this point in the history
Replace `ErlangEnterBetweenBracesHandler` with `ErlangEnterBetweenBracesDelegate` to utilize the updated API. Updated the plugin configuration to register the new delegate for better brace handling functionality.
  • Loading branch information
ignatov committed Sep 30, 2024
1 parent e525961 commit c196fc6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 42 deletions.
2 changes: 1 addition & 1 deletion resources/META-INF/ErlangPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<typedHandler implementation="org.intellij.erlang.editor.ErlangTypedHandler" id="ErlangBinary"/>
<enterHandlerDelegate implementation="org.intellij.erlang.editor.ErlangEnterInCommentsHandler" id="ErlangEnterInComments"/>
<enterHandlerDelegate implementation="org.intellij.erlang.editor.ErlangEnterHandler" id="ErlangEnter"/>
<enterHandlerDelegate implementation="org.intellij.erlang.editor.ErlangEnterBetweenBracesHandler" id="ErlangEnterBetweenBraces"/>
<enterBetweenBracesDelegate language="Erlang" implementationClass="org.intellij.erlang.editor.ErlangEnterBetweenBracesDelegate" id="ErlangEnterBwetweenBraces"/>

<extendWordSelectionHandler implementation="org.intellij.erlang.editor.ErlangWordSelectioner" order="last"/>
<lang.smartEnterProcessor language="Erlang" implementationClass="org.intellij.erlang.editor.ErlangClausesSmartEnterProcessor" id="ErlangClause"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2012-2015 Sergey Ignatov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.intellij.erlang.editor;

import com.intellij.codeInsight.editorActions.enter.EnterBetweenBracesDelegate;

public class ErlangEnterBetweenBracesDelegate extends EnterBetweenBracesDelegate {
@Override
protected boolean isBracePair(char lBrace, char rBrace) {
return super.isBracePair(lBrace, rBrace) || lBrace == '[' && rBrace == ']';
}
}

This file was deleted.

0 comments on commit c196fc6

Please sign in to comment.