[JavaScript] Updated triggerWordLength to fix issues where mid-word code completion would show incorrect suggestions and insertion would inset extra characters.