@@ -40,6 +40,7 @@ export type PrevCompletionMap = Record<
4040 documentationOverride ?: string | ts . SymbolDisplayPart [ ]
4141 detailPrepend ?: string
4242 documentationAppend ?: string
43+ range ?: [ number , number ]
4344 // textChanges?: ts.TextChange[]
4445 }
4546>
@@ -48,7 +49,7 @@ export type PrevCompletionsAdditionalData = {
4849 completionsSymbolMap : Map < /*entryName*/ string , Array < { symbol : ts . Symbol ; source ?: string } > >
4950}
5051
51- type GetCompletionAtPositionReturnType = {
52+ export type GetCompletionAtPositionReturnType = {
5253 completions : ts . CompletionInfo
5354 /** Let default getCompletionEntryDetails to know original name or let add documentation from here */
5455 prevCompletionsMap : PrevCompletionMap
@@ -267,6 +268,13 @@ export const getCompletionsAtPosition = (
267268 prior . entries = prior . entries . filter ( ( { name, kind } ) => kind === ts . ScriptElementKind . warning || ! name . startsWith ( '__' ) )
268269 }
269270 }
271+ if ( isVueFile && exactNode && ts . isArrayLiteralExpression ( ts . isIdentifier ( exactNode ) ? exactNode . parent : exactNode ) ) {
272+ const type = languageService
273+ . getProgram ( ) !
274+ . getTypeChecker ( ) !
275+ . getTypeOfSymbol ( prior . entries . find ( e => e . name === 'Logo' ) ?. symbol ! )
276+ console . log ( type )
277+ }
270278 // #endregion
271279
272280 addSourceDefinition ( prior . entries )
@@ -382,6 +390,13 @@ export const getCompletionsAtPosition = (
382390 }
383391 }
384392
393+ for ( const entry of prior . entries ) {
394+ const { replacementSpan } = entry
395+ if ( ! replacementSpan ) continue
396+ prevCompletionsMap [ entry . name ] ??= { }
397+ prevCompletionsMap [ entry . name ] ! . range = [ replacementSpan . start , ts . textSpanEnd ( replacementSpan ) ]
398+ }
399+
385400 // Otherwise may crash Volar
386401 prior . entries = prior . entries . map ( entry => ( {
387402 ...entry ,
0 commit comments