11from ..libs .view_helpers import *
2+ from ..libs import log
23from .base_command import TypeScriptBaseTextCommand
34
45
@@ -8,6 +9,8 @@ class TypescriptFormatOnKey(TypeScriptBaseTextCommand):
89 in the case of "\n ", this is only called when no completion dialogue is visible
910 """
1011 def run (self , text , key = "" , insert_key = True ):
12+ log .debug ("running TypescriptFormatOnKey" )
13+
1114 if 0 == len (key ):
1215 return
1316 check_update_view (self .view )
@@ -27,19 +30,22 @@ def run(self, text, key="", insert_key=True):
2730class TypescriptFormatSelection (TypeScriptBaseTextCommand ):
2831 """Command to format the current selection"""
2932 def run (self , text ):
33+ log .debug ("running TypescriptFormatSelection" )
3034 r = self .view .sel ()[0 ]
3135 format_range (text , self .view , r .begin (), r .end ())
3236
3337
3438class TypescriptFormatDocument (TypeScriptBaseTextCommand ):
3539 """Command to format the entire buffer"""
3640 def run (self , text ):
41+ log .debug ("running TypescriptFormatDocument" )
3742 format_range (text , self .view , 0 , self .view .size ())
3843
3944
4045class TypescriptFormatLine (TypeScriptBaseTextCommand ):
4146 """Command to format the current line"""
4247 def run (self , text ):
48+ log .debug ("running TypescriptFormatLine" )
4349 line_region = self .view .line (self .view .sel ()[0 ])
4450 line_text = self .view .substr (line_region )
4551 if NON_BLANK_LINE_PATTERN .search (line_text ):
@@ -53,6 +59,7 @@ def run(self, text):
5359
5460class TypescriptFormatBrackets (TypeScriptBaseTextCommand ):
5561 def run (self , text ):
62+ log .debug ("running TypescriptFormatBrackets" )
5663 check_update_view (self .view )
5764 sel = self .view .sel ()
5865 if len (sel ) == 1 :
@@ -70,6 +77,7 @@ def run(self, text):
7077
7178class TypescriptPasteAndFormat (TypeScriptBaseTextCommand ):
7279 def run (self , text ):
80+ log .debug ("running TypescriptPasteAndFormat" )
7381 view = self .view
7482 check_update_view (view )
7583 regions_before_paste = regions_to_static_regions (view .sel ())
@@ -93,6 +101,7 @@ class TypescriptAutoIndentOnEnterBetweenCurlyBrackets(TypeScriptBaseTextCommand)
93101 """
94102
95103 def run (self , text ):
104+ log .debug ("running TypescriptAutoIndentOnEnterBetweenCurlyBrackets" )
96105 view = self .view
97106 view .run_command ('typescript_format_on_key' , {"key" : "\n " })
98107 loc = view .sel ()[0 ].begin ()
0 commit comments