-
Notifications
You must be signed in to change notification settings - Fork 734
Closed
Labels
CrashDomain: EditorRelated to the LSP server, editor experienceRelated to the LSP server, editor experience
Description
Stack trace
panic handling request textDocument/rangeFormatting interface conversion: ast.nodeData is *ast.ExpressionStatement, not *ast.CallExpression goroutine 4623 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:26 +0x64
github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop.func1.1()
github.com/microsoft/typescript-go/internal/lsp/server.go:363 +0x54
panic({0x65a6e0?, 0x400a0481b0?})
runtime/panic.go:792 +0x124
github.com/microsoft/typescript-go/internal/ast.(*Node).AsCallExpression(...)
github.com/microsoft/typescript-go/internal/ast/ast.go:1146
github.com/microsoft/typescript-go/internal/format.isArgumentAndStartLineOverlapsExpressionBeingCalled(0x400a74cd00?, 0x400a74cd00?, 0x4003a6a370?, 0x4009fb0788?)
github.com/microsoft/typescript-go/internal/format/indent.go:129 +0xdc
github.com/microsoft/typescript-go/internal/format.getIndentationForNodeWorker(0x975790?, 0x400f1c3088?, 0x30?, 0x4004034d38, 0x976d18?, 0x400f1c3088, 0x0, 0x400a026a10)
github.com/microsoft/typescript-go/internal/format/indent.go:96 +0x21c
github.com/microsoft/typescript-go/internal/format.GetIndentationForNode(0x4003a6a370, 0x4004034d38, 0x400f1c3088, 0x400a026a10)
github.com/microsoft/typescript-go/internal/format/indent.go:16 +0x6c
github.com/microsoft/typescript-go/internal/format.FormatSpan({0x976d18, 0x400a048180}, {0x30, 0x54}, 0x400f1c3088, 0x1)
github.com/microsoft/typescript-go/internal/format/api.go:69 +0xc8
github.com/microsoft/typescript-go/internal/format.FormatSelection({0x976d18, 0x400a048180}, 0x400f1c3088, 0x96c300?, 0x54)
github.com/microsoft/typescript-go/internal/format/api.go:93 +0x50
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getFormattingEditsForRange(0x4016631398?, {0x976d50?, 0x400eff2f50?}, 0x400f1c3088, 0x81a8a0?, {0x16631398?, 0x40?})
github.com/microsoft/typescript-go/internal/ls/format.go:95 +0x60
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).ProvideFormatDocumentRange(0x40166313b0, {0x976d50, 0x400eff2f50}, {0x400adad800?, 0x400427a0c0?}, 0x4002609660, {{0xb63d6c8?, 0x40?}, {0x56c514?, 0x0?}})
github.com/microsoft/typescript-go/internal/ls/format.go:61 +0xb0
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleDocumentRangeFormat(0xf5d5f04d72148beb?, {0x976d50, 0x400eff2f50}, 0x400ae68ae0)
github.com/microsoft/typescript-go/internal/lsp/server.go:797 +0x9c
github.com/microsoft/typescript-go/internal/lsp.init.func1.registerRequestHandler[...].19({0x976d50, 0x400eff2f50}, 0x400ae68d50)
github.com/microsoft/typescript-go/internal/lsp/server.go:535 +0x68
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleRequestOrNotification(0x40001cc000, {0x976d50, 0x400eff2f50}, 0x400ae68d50)
github.com/microsoft/typescript-go/internal/lsp/server.go:471 +0x108
github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop.func1()
github.com/microsoft/typescript-go/internal/lsp/server.go:376 +0x70
created by github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop in goroutine 36
github.com/microsoft/typescript-go/internal/lsp/server.go:396 +0x4c4
Steps to reproduce
function foo<T, U>(x: string, y: T, z: U) {
}
foo<number,number>("hello", 123,456)/**/Metadata
Metadata
Assignees
Labels
CrashDomain: EditorRelated to the LSP server, editor experienceRelated to the LSP server, editor experience