Mirror: TypeScript LSP plugin that finds GraphQL documents in your code and provides diagnostics, auto-complete and hover-information.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Forward all arguments in getQuickInfoAtPosition proxy (#384)

authored by

Jovi De Croock and committed by
GitHub
71f3b894 f956716d

+12 -5
+5
.changeset/fix-expandable-hovers.md
··· 1 + --- 2 + '@0no-co/graphqlsp': patch 3 + --- 4 + 5 + Forward all arguments from the `getQuickInfoAtPosition` proxy to the underlying TypeScript language service, so that the `verbosityLevel` argument (added in TypeScript 5.9 for expandable hovers) is no longer stripped when GraphQLSP delegates back to TypeScript.
+7 -5
packages/graphqlsp/src/index.ts
··· 185 185 } 186 186 }; 187 187 188 - proxy.getQuickInfoAtPosition = (filename: string, cursorPosition: number) => { 188 + proxy.getQuickInfoAtPosition = ( 189 + ...args: Parameters<ts.LanguageService['getQuickInfoAtPosition']> 190 + ) => { 191 + const [filename, cursorPosition] = args; 189 192 const quickInfo = getGraphQLQuickInfo( 190 193 filename, 191 194 cursorPosition, ··· 195 198 196 199 if (quickInfo) return quickInfo; 197 200 198 - return info.languageService.getQuickInfoAtPosition( 199 - filename, 200 - cursorPosition 201 - ); 201 + // Forward all arguments (including `verbosityLevel` for expandable 202 + // hovers, added in TS 5.9) so we don't break the underlying feature. 203 + return info.languageService.getQuickInfoAtPosition(...args); 202 204 }; 203 205 204 206 logger('proxy: ' + JSON.stringify(proxy));