Skip to content

Commit 6adb281

Browse files
Fix all line endings in completions.ts to use consistent CRLF
Co-authored-by: RyanCavanaugh <[email protected]>
1 parent 06b5873 commit 6adb281

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/services/completions.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,16 +1730,16 @@ function createCompletionEntry(
17301730
}
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.
1733-
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-
} else {
1739-
insertText = useBraces ? needsConvertPropertyAccess ? `[${quotePropertyName(sourceFile, preferences, name)}]` : `[${name}]` : name;
1740-
}
1741-
if (insertQuestionDot || propertyAccessToConvert.questionDotToken) {
1742-
insertText = `?.${insertText}`;
1733+
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+
} else {
1739+
insertText = useBraces ? needsConvertPropertyAccess ? `[${quotePropertyName(sourceFile, preferences, name)}]` : `[${name}]` : name;
1740+
}
1741+
if (insertQuestionDot || propertyAccessToConvert.questionDotToken) {
1742+
insertText = `?.${insertText}`;
17431743
}
17441744

17451745
const dot = findChildOfKind(propertyAccessToConvert, SyntaxKind.DotToken, sourceFile) ||
@@ -3854,13 +3854,13 @@ function getCompletionData(
38543854
// If this is nested like for `namespace N { export const sym = Symbol(); }`, we'll add the completion for `N`.
38553855
const firstAccessibleSymbol = nameSymbol && getFirstSymbolInChain(nameSymbol, contextToken, typeChecker);
38563856
const firstAccessibleSymbolId = firstAccessibleSymbol && getSymbolId(firstAccessibleSymbol);
3857-
if (firstAccessibleSymbolId && addToSeen(seenPropertySymbols, firstAccessibleSymbolId)) {
3858-
const index = symbols.length;
3859-
symbols.push(firstAccessibleSymbol);
3860-
3861-
// Symbol completions should have lower priority since they represent computed property access
3862-
symbolToSortTextMap[getSymbolId(firstAccessibleSymbol)] = SortText.GlobalsOrKeywords;
3863-
3857+
if (firstAccessibleSymbolId && addToSeen(seenPropertySymbols, firstAccessibleSymbolId)) {
3858+
const index = symbols.length;
3859+
symbols.push(firstAccessibleSymbol);
3860+
3861+
// Symbol completions should have lower priority since they represent computed property access
3862+
symbolToSortTextMap[getSymbolId(firstAccessibleSymbol)] = SortText.GlobalsOrKeywords;
3863+
38643864
const moduleSymbol = firstAccessibleSymbol.parent;
38653865
if (
38663866
!moduleSymbol ||

0 commit comments

Comments
 (0)