Skip to content

Commit ac13058

Browse files
Revert snippet text cursor positioning but keep sort order changes
Co-authored-by: RyanCavanaugh <[email protected]>
1 parent 1ed1122 commit ac13058

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/services/completions.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,14 +1731,7 @@ function createCompletionEntry(
17311731
// We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790.
17321732
// Somehow there was a global with a non-identifier name. Hopefully someone will complain about getting a "foo bar" global completion and provide a repro.
17331733
else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) {
1734-
if (useBraces && preferences.includeCompletionsWithSnippetText) {
1735-
// For symbol completions, position cursor inside brackets for better UX
1736-
insertText = needsConvertPropertyAccess ? `[${quotePropertyName(sourceFile, preferences, name)}$0]` : `[${name}$0]`;
1737-
isSnippet = true;
1738-
}
1739-
else {
1740-
insertText = useBraces ? needsConvertPropertyAccess ? `[${quotePropertyName(sourceFile, preferences, name)}]` : `[${name}]` : name;
1741-
}
1734+
insertText = useBraces ? needsConvertPropertyAccess ? `[${quotePropertyName(sourceFile, preferences, name)}]` : `[${name}]` : name;
17421735
if (insertQuestionDot || propertyAccessToConvert.questionDotToken) {
17431736
insertText = `?.${insertText}`;
17441737
}

0 commit comments

Comments
 (0)