File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
packages/app/src/components/SQLEditor Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @hyperdx/app " : patch
3+ ---
4+
5+ fix: Fix intermittently-missing SQL autocomplete suggestions
Original file line number Diff line number Diff line change @@ -144,9 +144,10 @@ export default function SQLInlineEditor({
144144
145145 const compartmentRef = useRef < Compartment > ( new Compartment ( ) ) ;
146146
147+ const hasNonEmptyValue = value . trim ( ) . length > 0 ;
148+
147149 const updateAutocompleteColumns = useCallback (
148150 ( viewRef : EditorView ) => {
149- const currentText = viewRef . state . doc . toString ( ) ;
150151 const identifiers = [
151152 ...( filteredFields ?. map ( column => {
152153 if ( column . path . length > 1 ) {
@@ -171,15 +172,16 @@ export default function SQLInlineEditor({
171172 } ) ;
172173 viewRef . dispatch ( {
173174 effects : compartmentRef . current . reconfigure (
174- currentText . length > 0 ? auto : queryHistoryList ,
175+ hasNonEmptyValue ? auto : queryHistoryList ,
175176 ) ,
176177 } ) ;
177178 } ,
178179 [
179180 filteredFields ,
180181 additionalSuggestions ,
181- createHistoryList ,
182182 disableKeywordAutocomplete ,
183+ createHistoryList ,
184+ hasNonEmptyValue ,
183185 ] ,
184186 ) ;
185187
You can’t perform that action at this time.
0 commit comments