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 1313import javax .swing .text .BadLocationException ;
1414import javax .swing .text .Document ;
1515import javax .swing .text .StyledDocument ;
16+ import org .apache .commons .lang3 .StringUtils ;
1617import org .eclipse .lsp4j .DocumentFormattingParams ;
1718import org .eclipse .lsp4j .DocumentRangeFormattingParams ;
1819import org .eclipse .lsp4j .FormattingOptions ;
2526import org .netbeans .modules .editor .indent .spi .ExtraLock ;
2627import org .netbeans .modules .lsp .client .LSPBindings ;
2728import org .netbeans .modules .lsp .client .Utils ;
29+ import org .netbeans .modules .python .PythonUtility ;
2830import org .openide .filesystems .FileObject ;
2931import org .openide .text .NbDocument ;
3032import org .openide .util .Exceptions ;
@@ -43,7 +45,8 @@ public void reformat() throws BadLocationException {
4345 Document document = context .document ();
4446 boolean rangeOrDoc = context .startOffset () != 0 ;
4547 FileObject fileObject = NbEditorUtilities .getFileObject (document );
46- if (fileObject != null ) {
48+ if (fileObject != null && !StringUtils .containsAny (fileObject .getPath (),
49+ PythonUtility .EXCLUDED_DIRS )) {
4750 LSPBindings bindings = LSPBindings .getBindings (fileObject );
4851 if (bindings != null ) {
4952 boolean documentFormatting = Utils .isEnabled (bindings
You can’t perform that action at this time.
0 commit comments