File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/main/java/org/netbeans/modules/python/editor Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 13
13
import javax .swing .text .BadLocationException ;
14
14
import javax .swing .text .Document ;
15
15
import javax .swing .text .StyledDocument ;
16
+ import org .apache .commons .lang3 .StringUtils ;
16
17
import org .eclipse .lsp4j .DocumentFormattingParams ;
17
18
import org .eclipse .lsp4j .DocumentRangeFormattingParams ;
18
19
import org .eclipse .lsp4j .FormattingOptions ;
25
26
import org .netbeans .modules .editor .indent .spi .ExtraLock ;
26
27
import org .netbeans .modules .lsp .client .LSPBindings ;
27
28
import org .netbeans .modules .lsp .client .Utils ;
29
+ import org .netbeans .modules .python .PythonUtility ;
28
30
import org .openide .filesystems .FileObject ;
29
31
import org .openide .text .NbDocument ;
30
32
import org .openide .util .Exceptions ;
@@ -43,7 +45,8 @@ public void reformat() throws BadLocationException {
43
45
Document document = context .document ();
44
46
boolean rangeOrDoc = context .startOffset () != 0 ;
45
47
FileObject fileObject = NbEditorUtilities .getFileObject (document );
46
- if (fileObject != null ) {
48
+ if (fileObject != null && !StringUtils .containsAny (fileObject .getPath (),
49
+ PythonUtility .EXCLUDED_DIRS )) {
47
50
LSPBindings bindings = LSPBindings .getBindings (fileObject );
48
51
if (bindings != null ) {
49
52
boolean documentFormatting = Utils .isEnabled (bindings
You can’t perform that action at this time.
0 commit comments