@@ -443,40 +443,39 @@ func (ls *INOLanguageServer) TextDocumentHoverReqFromIDE(ctx context.Context, lo
443
443
return & ideResp , nil
444
444
}
445
445
446
- func (ls * INOLanguageServer ) clangURIRefersToIno (uri lsp.DocumentURI ) bool {
447
- return uri .AsPath ().EquivalentTo (ls .buildSketchCpp )
446
+ func (ls * INOLanguageServer ) clangURIRefersToIno (clangURI lsp.DocumentURI ) bool {
447
+ return clangURI .AsPath ().EquivalentTo (ls .buildSketchCpp )
448
448
}
449
449
450
- func (ls * INOLanguageServer ) TextDocumentSignatureHelpReqFromIDE (ctx context.Context , logger jsonrpc.FunctionLogger , inoParams * lsp.SignatureHelpParams ) (* lsp.SignatureHelp , * jsonrpc.ResponseError ) {
450
+ func (ls * INOLanguageServer ) TextDocumentSignatureHelpReqFromIDE (ctx context.Context , logger jsonrpc.FunctionLogger , ideParams * lsp.SignatureHelpParams ) (* lsp.SignatureHelp , * jsonrpc.ResponseError ) {
451
451
ls .readLock (logger , true )
452
452
defer ls .readUnlock (logger )
453
453
454
- inoTextDocumentPosition := inoParams .TextDocumentPositionParams
455
-
456
- logger .Logf ("%s" , inoTextDocumentPosition )
457
- cppTextDocumentPosition , err := ls .ide2ClangTextDocumentPositionParams (logger , inoTextDocumentPosition )
454
+ clangTextDocumentPosition , err := ls .ide2ClangTextDocumentPositionParams (logger , ideParams .TextDocumentPositionParams )
458
455
if err != nil {
459
456
logger .Logf ("Error: %s" , err )
460
457
return nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : err .Error ()}
461
458
}
462
459
463
- logger .Logf ("-> %s" , cppTextDocumentPosition )
464
- cppParams := * inoParams
465
- cppParams .TextDocumentPositionParams = cppTextDocumentPosition
466
- cppSignatureHelp , cppErr , err := ls .Clangd .conn .TextDocumentSignatureHelp (ctx , inoParams )
460
+ clangParams := & lsp.SignatureHelpParams {
461
+ TextDocumentPositionParams : clangTextDocumentPosition ,
462
+ WorkDoneProgressParams : ideParams .WorkDoneProgressParams ,
463
+ Context : ideParams .Context ,
464
+ }
465
+ clangSignatureHelp , clangErr , err := ls .Clangd .conn .TextDocumentSignatureHelp (ctx , clangParams )
467
466
if err != nil {
468
467
logger .Logf ("clangd communication error: %v" , err )
469
468
ls .Close ()
470
469
return nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : err .Error ()}
471
470
}
472
- if cppErr != nil {
473
- logger .Logf ("clangd response error: %v" , cppErr .AsError ())
474
- return nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : cppErr .AsError ().Error ()}
471
+ if clangErr != nil {
472
+ logger .Logf ("clangd response error: %v" , clangErr .AsError ())
473
+ return nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : clangErr .AsError ().Error ()}
475
474
}
476
475
477
476
// No need to convert back to inoSignatureHelp
478
-
479
- return cppSignatureHelp , nil
477
+ ideSignatureHelp := clangSignatureHelp
478
+ return ideSignatureHelp , nil
480
479
}
481
480
482
481
func (ls * INOLanguageServer ) TextDocumentDefinitionReqFromIDE (ctx context.Context , logger jsonrpc.FunctionLogger , ideParams * lsp.DefinitionParams ) ([]lsp.Location , []lsp.LocationLink , * jsonrpc.ResponseError ) {
0 commit comments