mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
fix: Fix intermittently-missing SQL autocomplete suggestions (#1980)
This commit is contained in:
parent
cdc29d5a88
commit
dd313f7754
2 changed files with 10 additions and 3 deletions
5
.changeset/tasty-owls-heal.md
Normal file
5
.changeset/tasty-owls-heal.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@hyperdx/app": patch
|
||||
---
|
||||
|
||||
fix: Fix intermittently-missing SQL autocomplete suggestions
|
||||
|
|
@ -144,9 +144,10 @@ export default function SQLInlineEditor({
|
|||
|
||||
const compartmentRef = useRef<Compartment>(new Compartment());
|
||||
|
||||
const hasNonEmptyValue = value.trim().length > 0;
|
||||
|
||||
const updateAutocompleteColumns = useCallback(
|
||||
(viewRef: EditorView) => {
|
||||
const currentText = viewRef.state.doc.toString();
|
||||
const identifiers = [
|
||||
...(filteredFields?.map(column => {
|
||||
if (column.path.length > 1) {
|
||||
|
|
@ -171,15 +172,16 @@ export default function SQLInlineEditor({
|
|||
});
|
||||
viewRef.dispatch({
|
||||
effects: compartmentRef.current.reconfigure(
|
||||
currentText.length > 0 ? auto : queryHistoryList,
|
||||
hasNonEmptyValue ? auto : queryHistoryList,
|
||||
),
|
||||
});
|
||||
},
|
||||
[
|
||||
filteredFields,
|
||||
additionalSuggestions,
|
||||
createHistoryList,
|
||||
disableKeywordAutocomplete,
|
||||
createHistoryList,
|
||||
hasNonEmptyValue,
|
||||
],
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue