From 1660092c7917d9b55edc4fbe250d4d91ade9badb Mon Sep 17 00:00:00 2001 From: Rishabh Rathod Date: Mon, 22 Aug 2022 13:37:03 +0530 Subject: [PATCH] fix: ternserver code (#16179) ## Description Hotfix to resolve `focusedValue` undefined error ## Type of change - Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? ## Checklist: - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes --- app/client/src/utils/autocomplete/TernServer.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/client/src/utils/autocomplete/TernServer.ts b/app/client/src/utils/autocomplete/TernServer.ts index 2626bd3b54..4ab26a3b20 100644 --- a/app/client/src/utils/autocomplete/TernServer.ts +++ b/app/client/src/utils/autocomplete/TernServer.ts @@ -207,7 +207,9 @@ class TernServer { } const doc = this.findDoc(cm.getDoc()); const cursor = cm.getCursor(); - const { extraChars } = this.getFocusedDocValueAndPos(doc); + const { extraChars, value: focusedValue } = this.getFocusedDocValueAndPos( + doc, + ); let completions: Completion[] = []; let after = "";