Project: aptanastudio
Issue APSTUD-4185: Content assist for nested JS in HTML auto-inserts and suggest incorrect proposals
While validating another ticket, I tried typing in the following HTML: {code} {code} I ran into a number of issues. # When I typed "event." it became "eventhis." # On another occasion, when I typed "event.", it became "event$$." # After I managed to get around that, proposals off of "event." showed global properties. Ideally, this would show some of the Event properties. # As I continued to type "event.ke", I started seeing global proposals starting with 'e'. Continuing more would give a strange alternation of globals starting with the last letter to showing all globals again. # Once I got to "document.", I got a list of globals again instead of document properties. # Continuing to type "document.getElementById" showed the same behavior when I was typing "event.keyCode": alternation of all globals and globals starting with last typed letter. # When I typed "document.getElementById('|')" and my cursor was at '|', I starting seeing HTML attribute proposals. Note that '\'' and ')' were auto-inserted, so I did not type those. # As I typed the contents of the string in getElementById, I saw the global-and-globals-with-last-letter behavior described above. # Likewise when typing ".click" I suspect this is due to the JS being in an unparsable state with JSContentAssistProcessor dropping back to lexeme-based location type calculation.
Story points: 8