Skip to content

Commit 4b364bd

Browse files
committed
Removed extra debug logging
1 parent eb339ec commit 4b364bd

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

cs_cljfmt.py

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,25 @@
22
from . import cs_common, cs_parser
33

44
def format_string(view, text):
5-
with cs_common.Measure("cljfmt fix {} chars", len(text)):
6-
try:
7-
cmd = 'cljfmt.exe' if 'windows' == sublime.platform() else 'cljfmt'
8-
cwd = None
9-
if file := view.file_name():
10-
cwd = os.path.dirname(file)
11-
elif folders := view.window().folders():
12-
cwd = folders[0]
5+
try:
6+
cmd = 'cljfmt.exe' if 'windows' == sublime.platform() else 'cljfmt'
7+
cwd = None
8+
if file := view.file_name():
9+
cwd = os.path.dirname(file)
10+
elif folders := view.window().folders():
11+
cwd = folders[0]
1312

14-
proc = subprocess.run([cmd, 'fix', '-'],
15-
input = text,
16-
text = True,
17-
capture_output = True,
18-
check = True,
19-
cwd = cwd)
20-
except FileNotFoundError:
21-
sublime.error_message(f'`{cmd}` is not on $PATH')
22-
raise
23-
if 'Failed' not in proc.stderr:
24-
return proc.stdout
13+
proc = subprocess.run([cmd, 'fix', '-'],
14+
input = text,
15+
text = True,
16+
capture_output = True,
17+
check = True,
18+
cwd = cwd)
19+
except FileNotFoundError:
20+
sublime.error_message(f'`{cmd}` is not on $PATH')
21+
raise
22+
if 'Failed' not in proc.stderr:
23+
return proc.stdout
2524

2625
def indent_lines(view, selections, edit):
2726
regions = [region for region in selections if not region.empty()]
@@ -48,9 +47,7 @@ def indent_lines(view, selections, edit):
4847

4948
def newline_indent(view, point):
5049
text = view.substr(sublime.Region(0, point))
51-
parsed = None
52-
with cs_common.Measure("parse {} chars", len(text)):
53-
parsed = cs_parser.parse(text)
50+
parsed = cs_parser.parse(text)
5451
to_close = []
5552
node = parsed
5653
start = node.children[-1].start if node.children else 0

cs_indent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def run(self, edit):
137137
class ClojureSublimedReindentLinesCommand(sublime_plugin.TextCommand):
138138
def run(self, edit):
139139
view = self.view
140-
with cs_common.Measure("Reindent Lines {}", view.sel()):
140+
with cs_common.Measure("Reindent Lines {} chars", sum([r.size() for r in view.sel()])):
141141
if 'cljfmt' == cs_common.setting('formatter'):
142142
cs_cljfmt.indent_lines(view, view.sel(), edit)
143143
else:

0 commit comments

Comments
 (0)