(params: any, context: HandlerContext)
| 10 | import {HandlerContext} from './utils.js'; |
| 11 | |
| 12 | export async function onGetTcb(params: any, context: HandlerContext) { |
| 13 | if (!params.textDocument?.uri?.startsWith('file:')) { |
| 14 | return null; |
| 15 | } |
| 16 | |
| 17 | const filePath = fileURLToPath(params.textDocument.uri); |
| 18 | const result = await context.languageService.getTcb(filePath, params.position); |
| 19 | if (!result) { |
| 20 | return null; |
| 21 | } |
| 22 | |
| 23 | return { |
| 24 | uri: params.textDocument.uri, |
| 25 | content: result.code, |
| 26 | selections: result.selections, |
| 27 | }; |
| 28 | } |