Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Commit a61c117

Browse files
committed
Only use show_query's 'enabled' property in stream
1 parent d97073c commit a61c117

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

SQLTools.sublime-settings

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"limit": 50
3939
},
4040
"show_query": {
41-
"placement": "disabled"
41+
"enabled": true,
42+
"placement": "top"
4243
},
4344
"format" : {
4445
"keyword_case" : "upper",

SQLToolsAPI/Command.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ def run(self):
7070
if self.process:
7171
self.process.terminate()
7272

73-
if 'show_query' in self.options and self.options['show_query']:
74-
formattedQueryInfo = self._formatShowQuery(self.query, queryTimerStart, queryTimerEnd)
75-
self.callback(formattedQueryInfo)
73+
if 'show_query' in self.options:
74+
if 'enabled' in self.options['show_query'] and self.options['show_query']['enabled']:
75+
formattedQueryInfo = self._formatShowQuery(self.query, queryTimerStart, queryTimerEnd)
76+
self.callback(formattedQueryInfo + '\n')
7677

7778
return
7879

@@ -93,13 +94,13 @@ def run(self):
9394
'replace').replace('\r', '')
9495

9596
if 'show_query' in self.options:
96-
queryPlacement = self.options['show_query'].get('placement', 'disabled')
97-
if isinstance(queryPlacement, str) and queryPlacement != 'disabled':
97+
if 'enabled' in self.options['show_query'] and self.options['show_query']['enabled']:
9898
formattedQueryInfo = self._formatShowQuery(self.query, queryTimerStart, queryTimerEnd)
99+
queryPlacement = self.options['show_query'].get('placement', 'top')
99100
if queryPlacement == 'top':
100101
resultString = "{0}\n{1}".format(formattedQueryInfo, resultString)
101102
elif queryPlacement == 'bottom':
102-
resultString = "{0}\n{1}".format(resultString, formattedQueryInfo)
103+
resultString = "{0}{1}\n".format(resultString, formattedQueryInfo)
103104

104105
self.callback(resultString)
105106

0 commit comments

Comments
 (0)