Skip to content

Commit 1ede13b

Browse files
committed
CR feedback
1 parent 17b9749 commit 1ede13b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

typescript/commands/build.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import sublime_plugin
1+
import sublime_plugin
22

33
from ..libs.global_vars import *
44
from ..libs import cli
@@ -7,7 +7,7 @@
77
class TypescriptBuildCommand(sublime_plugin.WindowCommand):
88
def run(self):
99
if get_node_path() is None:
10-
print("Cannot found node. Build cancelled.")
10+
print("Cannot find node. Build cancelled.")
1111
return
1212

1313
file_name = self.window.active_view().file_name()
@@ -17,19 +17,19 @@ def run(self):
1717
tsconfig_dir = dirname(project_info["body"]["configFileName"])
1818
self.window.run_command("exec", {
1919
"cmd": [get_node_path(), TSC_PATH, "-p", tsconfig_dir],
20+
# regex to capture build result for displaying in the output panel
2021
"file_regex": "^(.+?)\\((\\d+),(\\d+)\\): (.+)$"
2122
})
2223
else:
2324
sublime.active_window().show_input_panel(
2425
"Build parameters: ",
2526
"", # initial text
26-
self.compile_inferred_project,
27+
lambda params: self.compile_inferred_project(file_name, params),
2728
None, # on change
2829
None # on cancel
2930
)
3031

31-
def compile_inferred_project(self, params=""):
32-
file_name = self.window.active_view().file_name()
32+
def compile_inferred_project(self, file_name, params=""):
3333
cmd = [get_node_path(), TSC_PATH, file_name]
3434
print(cmd)
3535
if params != "":

0 commit comments

Comments
 (0)