@@ -306,7 +306,7 @@ func (ls *INOLanguageServer) TextDocumentCompletionReqFromIDE(ctx context.Contex
306
306
defer ls .readUnlock (logger )
307
307
308
308
logger .Logf ("--> completion(%s)\n " , inoParams .TextDocument )
309
- cppTextDocPositionParams , err := ls .ide2clangTextDocumentPositionParams (logger , inoParams .TextDocumentPositionParams )
309
+ cppTextDocPositionParams , err := ls .ide2ClangTextDocumentPositionParams (logger , inoParams .TextDocumentPositionParams )
310
310
if err != nil {
311
311
logger .Logf ("Error: %s" , err )
312
312
return nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : err .Error ()}
@@ -354,7 +354,7 @@ func (ls *INOLanguageServer) TextDocumentHoverReqFromIDE(ctx context.Context, lo
354
354
ls .readLock (logger , true )
355
355
defer ls .readUnlock (logger )
356
356
357
- clangTextDocPosition , err := ls .ide2clangTextDocumentPositionParams (logger , ideParams .TextDocumentPositionParams )
357
+ clangTextDocPosition , err := ls .ide2ClangTextDocumentPositionParams (logger , ideParams .TextDocumentPositionParams )
358
358
if err != nil {
359
359
logger .Logf ("Error: %s" , err )
360
360
return nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : err .Error ()}
@@ -404,7 +404,7 @@ func (ls *INOLanguageServer) TextDocumentSignatureHelpReqFromIDE(ctx context.Con
404
404
inoTextDocumentPosition := inoParams .TextDocumentPositionParams
405
405
406
406
logger .Logf ("%s" , inoTextDocumentPosition )
407
- cppTextDocumentPosition , err := ls .ide2clangTextDocumentPositionParams (logger , inoTextDocumentPosition )
407
+ cppTextDocumentPosition , err := ls .ide2ClangTextDocumentPositionParams (logger , inoTextDocumentPosition )
408
408
if err != nil {
409
409
logger .Logf ("Error: %s" , err )
410
410
return nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : err .Error ()}
@@ -436,7 +436,7 @@ func (ls *INOLanguageServer) TextDocumentDefinitionReqFromIDE(ctx context.Contex
436
436
inoTextDocPosition := p .TextDocumentPositionParams
437
437
438
438
logger .Logf ("%s" , inoTextDocPosition )
439
- cppTextDocPosition , err := ls .ide2clangTextDocumentPositionParams (logger , inoTextDocPosition )
439
+ cppTextDocPosition , err := ls .ide2ClangTextDocumentPositionParams (logger , inoTextDocPosition )
440
440
if err != nil {
441
441
logger .Logf ("Error: %s" , err )
442
442
return nil , nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : err .Error ()}
@@ -481,7 +481,7 @@ func (ls *INOLanguageServer) TextDocumentTypeDefinitionReqFromIDE(ctx context.Co
481
481
482
482
logger .Logf ("%s" , inoTextDocumentPosition )
483
483
// inoURI := inoTextDocumentPosition.TextDocument.URI
484
- cppTextDocumentPosition , err := ls .ide2clangTextDocumentPositionParams (logger , inoTextDocumentPosition )
484
+ cppTextDocumentPosition , err := ls .ide2ClangTextDocumentPositionParams (logger , inoTextDocumentPosition )
485
485
if err != nil {
486
486
logger .Logf ("Error: %s" , err )
487
487
return nil , nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : err .Error ()}
@@ -527,7 +527,7 @@ func (ls *INOLanguageServer) TextDocumentImplementationReqFromIDE(ctx context.Co
527
527
inoTextDocumentPosition := inoParams .TextDocumentPositionParams
528
528
logger .Logf ("%s" , inoTextDocumentPosition )
529
529
530
- cppTextDocumentPosition , err := ls .ide2clangTextDocumentPositionParams (logger , inoTextDocumentPosition )
530
+ cppTextDocumentPosition , err := ls .ide2ClangTextDocumentPositionParams (logger , inoTextDocumentPosition )
531
531
if err != nil {
532
532
logger .Logf ("Error: %s" , err )
533
533
return nil , nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : err .Error ()}
@@ -564,45 +564,45 @@ func (ls *INOLanguageServer) TextDocumentImplementationReqFromIDE(ctx context.Co
564
564
return inoLocations , inoLocationLinks , nil
565
565
}
566
566
567
- func (ls * INOLanguageServer ) TextDocumentDocumentHighlightReqFromIDE (ctx context.Context , logger jsonrpc.FunctionLogger , inoParams * lsp.DocumentHighlightParams ) ([]lsp.DocumentHighlight , * jsonrpc.ResponseError ) {
567
+ func (ls * INOLanguageServer ) TextDocumentDocumentHighlightReqFromIDE (ctx context.Context , logger jsonrpc.FunctionLogger , ideParams * lsp.DocumentHighlightParams ) ([]lsp.DocumentHighlight , * jsonrpc.ResponseError ) {
568
568
ls .readLock (logger , true )
569
569
defer ls .readUnlock (logger )
570
570
571
- inoTextDocumentPosition := inoParams .TextDocumentPositionParams
572
- cppTextDocumentPosition , err := ls .ide2clangTextDocumentPositionParams (logger , inoTextDocumentPosition )
571
+ clangTextDocumentPosition , err := ls .ide2ClangTextDocumentPositionParams (logger , ideParams .TextDocumentPositionParams )
573
572
if err != nil {
574
- logger .Logf ("Error : %s" , err )
573
+ logger .Logf ("ERROR : %s" , err )
575
574
return nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : err .Error ()}
576
575
}
577
- cppURI := cppTextDocumentPosition .TextDocument .URI
576
+ clangURI := clangTextDocumentPosition .TextDocument .URI
578
577
579
- cppParams := * inoParams
580
- cppParams .TextDocumentPositionParams = cppTextDocumentPosition
581
- cppHighlights , clangErr , err := ls .Clangd .conn .TextDocumentDocumentHighlight (ctx , & cppParams )
578
+ clangParams := * ideParams
579
+ clangParams .TextDocumentPositionParams = clangTextDocumentPosition
580
+ clangHighlights , clangErr , err := ls .Clangd .conn .TextDocumentDocumentHighlight (ctx , & clangParams )
582
581
if err != nil {
583
- logger .Logf ("clangd connectiono error : %v" , err )
582
+ logger .Logf ("clangd connectiono ERROR : %v" , err )
584
583
ls .Close ()
585
584
return nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : err .Error ()}
586
585
}
587
586
if clangErr != nil {
588
- logger .Logf ("clangd response error : %v" , clangErr .AsError ())
587
+ logger .Logf ("clangd response ERROR : %v" , clangErr .AsError ())
589
588
return nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : clangErr .AsError ().Error ()}
590
589
}
591
590
592
- if cppHighlights != nil {
591
+ if clangHighlights == nil {
592
+ logger .Logf ("null response from clangd" )
593
593
return nil , nil
594
594
}
595
595
596
- inoHighlights := []lsp.DocumentHighlight {}
597
- for _ , cppHighlight := range cppHighlights {
598
- inoHighlight , err := ls .cpp2inoDocumentHighlight (logger , cppHighlight , cppURI )
596
+ ideHighlights := []lsp.DocumentHighlight {}
597
+ for _ , clangHighlight := range clangHighlights {
598
+ ideHighlight , err := ls .clang2IdeDocumentHighlight (logger , clangHighlight , clangURI )
599
599
if err != nil {
600
- logger .Logf ("ERROR converting location %s:%s: %s" , cppURI , cppHighlight .Range , err )
600
+ logger .Logf ("ERROR converting highlight %s:%s: %s" , clangURI , clangHighlight .Range , err )
601
601
return nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : clangErr .AsError ().Error ()}
602
602
}
603
- inoHighlights = append (inoHighlights , inoHighlight )
603
+ ideHighlights = append (ideHighlights , ideHighlight )
604
604
}
605
- return inoHighlights , nil
605
+ return ideHighlights , nil
606
606
}
607
607
608
608
func (ls * INOLanguageServer ) TextDocumentDocumentSymbolReqFromIDE (ctx context.Context , logger jsonrpc.FunctionLogger , inoParams * lsp.DocumentSymbolParams ) ([]lsp.DocumentSymbol , []lsp.SymbolInformation , * jsonrpc.ResponseError ) {
@@ -613,7 +613,7 @@ func (ls *INOLanguageServer) TextDocumentDocumentSymbolReqFromIDE(ctx context.Co
613
613
inoURI := inoTextDocument .URI
614
614
logger .Logf ("--> %s" )
615
615
616
- cppTextDocument , err := ls .ino2cppTextDocumentIdentifier (logger , inoTextDocument )
616
+ cppTextDocument , err := ls .ide2ClangTextDocumentIdentifier (logger , inoTextDocument )
617
617
if err != nil {
618
618
logger .Logf ("Error: %s" , err )
619
619
return nil , nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : err .Error ()}
@@ -655,7 +655,7 @@ func (ls *INOLanguageServer) TextDocumentCodeActionReqFromIDE(ctx context.Contex
655
655
logger .Logf ("--> codeAction(%s:%s)" , inoTextDocument , inoParams .Range .Start )
656
656
657
657
cppParams := * inoParams
658
- cppTextDocument , err := ls .ino2cppTextDocumentIdentifier (logger , inoTextDocument )
658
+ cppTextDocument , err := ls .ide2ClangTextDocumentIdentifier (logger , inoTextDocument )
659
659
if err != nil {
660
660
logger .Logf ("Error: %s" , err )
661
661
return nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : err .Error ()}
@@ -710,7 +710,7 @@ func (ls *INOLanguageServer) TextDocumentFormattingReqFromIDE(ctx context.Contex
710
710
inoURI := inoTextDocument .URI
711
711
logger .Logf ("--> formatting(%s)" , inoTextDocument )
712
712
713
- cppTextDocument , err := ls .ino2cppTextDocumentIdentifier (logger , inoTextDocument )
713
+ cppTextDocument , err := ls .ide2ClangTextDocumentIdentifier (logger , inoTextDocument )
714
714
if err != nil {
715
715
logger .Logf ("Error: %s" , err )
716
716
return nil , & jsonrpc.ResponseError {Code : jsonrpc .ErrorCodesInternalError , Message : err .Error ()}
@@ -884,7 +884,7 @@ func (ls *INOLanguageServer) TextDocumentDidSaveNotifFromIDE(logger jsonrpc.Func
884
884
ls .triggerRebuild ()
885
885
886
886
logger .Logf ("didSave(%s) hasText=%v" , inoParams .TextDocument , inoParams .Text != "" )
887
- if cppTextDocument , err := ls .ino2cppTextDocumentIdentifier (logger , inoParams .TextDocument ); err != nil {
887
+ if cppTextDocument , err := ls .ide2ClangTextDocumentIdentifier (logger , inoParams .TextDocument ); err != nil {
888
888
logger .Logf ("--E Error: %s" , err )
889
889
} else if cppTextDocument .URI .AsPath ().EquivalentTo (ls .buildSketchCpp ) {
890
890
logger .Logf (" didSave(%s) equals %s" , cppTextDocument , ls .buildSketchCpp )
@@ -1094,14 +1094,14 @@ func (ls *INOLanguageServer) didClose(logger jsonrpc.FunctionLogger, inoDidClose
1094
1094
}
1095
1095
}
1096
1096
1097
- cppIdentifier , err := ls .ino2cppTextDocumentIdentifier (logger , inoIdentifier )
1097
+ cppIdentifier , err := ls .ide2ClangTextDocumentIdentifier (logger , inoIdentifier )
1098
1098
return & lsp.DidCloseTextDocumentParams {
1099
1099
TextDocument : cppIdentifier ,
1100
1100
}, err
1101
1101
}
1102
1102
1103
1103
func (ls * INOLanguageServer ) ino2cppTextDocumentItem (logger jsonrpc.FunctionLogger , inoItem lsp.TextDocumentItem ) (cppItem lsp.TextDocumentItem , err error ) {
1104
- cppURI , err := ls .ino2cppDocumentURI (logger , inoItem .URI )
1104
+ cppURI , err := ls .ide2ClangDocumentURI (logger , inoItem .URI )
1105
1105
if err != nil {
1106
1106
return cppItem , err
1107
1107
}
@@ -1189,50 +1189,50 @@ func (ls *INOLanguageServer) didChange(logger jsonrpc.FunctionLogger, inoDidChan
1189
1189
}
1190
1190
1191
1191
func (ls * INOLanguageServer ) ino2cppVersionedTextDocumentIdentifier (logger jsonrpc.FunctionLogger , doc lsp.VersionedTextDocumentIdentifier ) (lsp.VersionedTextDocumentIdentifier , error ) {
1192
- cppURI , err := ls .ino2cppDocumentURI (logger , doc .URI )
1192
+ cppURI , err := ls .ide2ClangDocumentURI (logger , doc .URI )
1193
1193
res := doc
1194
1194
res .URI = cppURI
1195
1195
return res , err
1196
1196
}
1197
1197
1198
- func (ls * INOLanguageServer ) ino2cppTextDocumentIdentifier (logger jsonrpc.FunctionLogger , doc lsp.TextDocumentIdentifier ) (lsp.TextDocumentIdentifier , error ) {
1199
- cppURI , err := ls .ino2cppDocumentURI (logger , doc .URI )
1200
- res := doc
1201
- res .URI = cppURI
1202
- return res , err
1198
+ func (ls * INOLanguageServer ) ide2ClangTextDocumentIdentifier (logger jsonrpc.FunctionLogger , ideTextDocIdentifier lsp.TextDocumentIdentifier ) (lsp.TextDocumentIdentifier , error ) {
1199
+ clangURI , err := ls .ide2ClangDocumentURI (logger , ideTextDocIdentifier .URI )
1200
+ return lsp.TextDocumentIdentifier {URI : clangURI }, err
1203
1201
}
1204
1202
1205
- func (ls * INOLanguageServer ) ino2cppDocumentURI (logger jsonrpc.FunctionLogger , inoURI lsp.DocumentURI ) (lsp.DocumentURI , error ) {
1203
+ func (ls * INOLanguageServer ) ide2ClangDocumentURI (logger jsonrpc.FunctionLogger , ideURI lsp.DocumentURI ) (lsp.DocumentURI , error ) {
1206
1204
// Sketchbook/Sketch/Sketch.ino -> build-path/sketch/Sketch.ino.cpp
1207
1205
// Sketchbook/Sketch/AnotherTab.ino -> build-path/sketch/Sketch.ino.cpp (different section from above)
1208
- // Sketchbook/Sketch/AnotherFile.cpp -> build-path/sketch/AnotherFile.cpp (1:1)
1209
- // another/path/source.cpp -> unchanged
1210
-
1211
- // Convert sketch path to build path
1212
- inoPath := inoURI .AsPath ()
1213
- if inoPath .Ext () == ".ino" {
1214
- return lsp .NewDocumentURIFromPath (ls .buildSketchCpp ), nil
1206
+ idePath := ideURI .AsPath ()
1207
+ if idePath .Ext () == ".ino" {
1208
+ clangURI := lsp .NewDocumentURIFromPath (ls .buildSketchCpp )
1209
+ logger .Logf ("URI: %s -> %s" , ideURI , clangURI )
1210
+ return clangURI , nil
1215
1211
}
1216
1212
1217
- inside , err := inoPath .IsInsideDir (ls .sketchRoot )
1213
+ // another/path/source.cpp -> another/path/source.cpp (unchanged)
1214
+ inside , err := idePath .IsInsideDir (ls .sketchRoot )
1218
1215
if err != nil {
1219
- logger .Logf (" could not determine if '%s' is inside '%s'" , inoPath , ls .sketchRoot )
1220
- return lsp .NilURI , unknownURI (inoURI )
1216
+ logger .Logf ("ERROR: could not determine if '%s' is inside '%s'" , idePath , ls .sketchRoot )
1217
+ return lsp .NilURI , unknownURI (ideURI )
1221
1218
}
1222
1219
if ! inside {
1223
- logger .Logf (" '%s' not inside sketchroot '%s', passing doc identifier to as-is" , ls .sketchRoot , inoPath )
1224
- return inoURI , nil
1220
+ clangURI := ideURI
1221
+ logger .Logf ("URI: %s -> %s" , ideURI , clangURI )
1222
+ return clangURI , nil
1225
1223
}
1226
1224
1227
- rel , err := ls . sketchRoot . RelTo ( inoPath )
1228
- if err == nil {
1229
- cppPath := ls . buildSketchRoot . JoinPath ( rel )
1230
- logger .Logf (" URI: '%s' -> '%s'" , inoPath , cppPath )
1231
- return lsp .NewDocumentURIFromPath ( cppPath ), nil
1225
+ // Sketchbook/Sketch/AnotherFile.cpp -> build-path/sketch/AnotherFile.cpp
1226
+ rel , err := ls . sketchRoot . RelTo ( idePath )
1227
+ if err != nil {
1228
+ logger .Logf ("ERROR: could not determine rel-path of '%s' in '%s': %s " , idePath , ls . sketchRoot , err )
1229
+ return lsp .NilURI , err
1232
1230
}
1233
1231
1234
- logger .Logf (" could not determine rel-path of '%s' in '%s': %s" , inoPath , ls .sketchRoot , err )
1235
- return lsp .NilURI , err
1232
+ clangPath := ls .buildSketchRoot .JoinPath (rel )
1233
+ clangURI := lsp .NewDocumentURIFromPath (clangPath )
1234
+ logger .Logf ("URI: %s -> %s" , ideURI , clangURI )
1235
+ return clangURI , nil
1236
1236
}
1237
1237
1238
1238
func (ls * INOLanguageServer ) idePathToIdeURI (logger jsonrpc.FunctionLogger , inoPath string ) (lsp.DocumentURI , error ) {
@@ -1261,18 +1261,18 @@ func (ls *INOLanguageServer) clang2IdeRangeAndDocumentURI(logger jsonrpc.Functio
1261
1261
if err == nil {
1262
1262
if ls .sketchMapper .IsPreprocessedCppLine (clangRange .Start .Line ) {
1263
1263
idePath = sourcemapper .NotIno .File
1264
- logger .Logf (" Range is in PREPROCESSED section of the sketch" )
1264
+ logger .Logf ("Range is in PREPROCESSED section of the sketch" )
1265
1265
}
1266
1266
} else if _ , ok := err .(sourcemapper.AdjustedRangeErr ); ok {
1267
- logger .Logf (" Range has been END LINE ADJSUTED" )
1267
+ logger .Logf ("Range has been END LINE ADJSUTED" )
1268
1268
err = nil
1269
1269
} else {
1270
- logger .Logf (" Range conversion ERROR: %s" , err )
1270
+ logger .Logf ("Range conversion ERROR: %s" , err )
1271
1271
ls .sketchMapper .DebugLogAll ()
1272
1272
return lsp .NilURI , lsp .NilRange , err
1273
1273
}
1274
1274
ideURI , err := ls .idePathToIdeURI (logger , idePath )
1275
- logger .Logf (" Range: %s:%s -> %s:%s" , clangURI , clangRange , ideURI , ideRange )
1275
+ logger .Logf ("Range: %s:%s -> %s:%s" , clangURI , clangRange , ideURI , ideRange )
1276
1276
return ideURI , ideRange , err
1277
1277
}
1278
1278
@@ -1286,7 +1286,7 @@ func (ls *INOLanguageServer) clang2IdeRangeAndDocumentURI(logger jsonrpc.Functio
1286
1286
}
1287
1287
if ! inside {
1288
1288
ideURI := clangURI
1289
- logger .Logf (" Range: %s:%s -> %s:%s" , clangURI , clangRange , ideURI , ideRange )
1289
+ logger .Logf ("Range: %s:%s -> %s:%s" , clangURI , clangRange , ideURI , ideRange )
1290
1290
return clangURI , clangRange , nil
1291
1291
}
1292
1292
@@ -1298,40 +1298,39 @@ func (ls *INOLanguageServer) clang2IdeRangeAndDocumentURI(logger jsonrpc.Functio
1298
1298
}
1299
1299
idePath := ls .sketchRoot .JoinPath (rel ).String ()
1300
1300
ideURI , err := ls .idePathToIdeURI (logger , idePath )
1301
- logger .Logf (" Range: %s:%s -> %s:%s" , clangURI , clangRange , ideURI , ideRange )
1301
+ logger .Logf ("Range: %s:%s -> %s:%s" , clangURI , clangRange , ideURI , ideRange )
1302
1302
return ideURI , clangRange , err
1303
1303
}
1304
1304
1305
- func (ls * INOLanguageServer ) ide2clangTextDocumentPositionParams (logger jsonrpc.FunctionLogger , inoParams lsp.TextDocumentPositionParams ) (lsp.TextDocumentPositionParams , error ) {
1306
- inoTextDocument := inoParams .TextDocument
1307
- inoPosition := inoParams .Position
1308
- inoURI := inoTextDocument .URI
1309
- prefix := fmt .Sprintf ("TextDocumentIdentifier %s" , inoParams )
1305
+ func (ls * INOLanguageServer ) ide2ClangTextDocumentPositionParams (logger jsonrpc.FunctionLogger , ideParams lsp.TextDocumentPositionParams ) (lsp.TextDocumentPositionParams , error ) {
1306
+ ideTextDocument := ideParams .TextDocument
1307
+ idePosition := ideParams .Position
1308
+ ideURI := ideTextDocument .URI
1310
1309
1311
- cppTextDocument , err := ls .ino2cppTextDocumentIdentifier (logger , inoTextDocument )
1310
+ clangTextDocument , err := ls .ide2ClangTextDocumentIdentifier (logger , ideTextDocument )
1312
1311
if err != nil {
1313
- logger .Logf ("%s -> invalid text document: %s" , prefix , err )
1312
+ logger .Logf ("%s -> invalid text document: %s" , ideParams , err )
1314
1313
return lsp.TextDocumentPositionParams {}, err
1315
1314
}
1316
- cppPosition := inoPosition
1317
- if inoURI . Ext () == ".ino" {
1318
- if cppLine , ok := ls .sketchMapper .InoToCppLineOk (inoURI , inoPosition .Line ); ok {
1319
- cppPosition .Line = cppLine
1315
+ clangPosition := idePosition
1316
+ if ls . clangURIRefersToIno ( clangTextDocument . URI ) {
1317
+ if cppLine , ok := ls .sketchMapper .InoToCppLineOk (ideURI , idePosition .Line ); ok {
1318
+ clangPosition .Line = cppLine
1320
1319
} else {
1321
- logger .Logf ("%s -> invalid line requested: %s:%d" , prefix , inoURI , inoPosition .Line )
1322
- return lsp.TextDocumentPositionParams {}, unknownURI (inoURI )
1320
+ logger .Logf ("%s -> invalid line requested: %s:%d" , ideParams , ideURI , idePosition .Line )
1321
+ return lsp.TextDocumentPositionParams {}, unknownURI (ideURI )
1323
1322
}
1324
1323
}
1325
- cppParams := lsp.TextDocumentPositionParams {
1326
- TextDocument : cppTextDocument ,
1327
- Position : cppPosition ,
1324
+ clangParams := lsp.TextDocumentPositionParams {
1325
+ TextDocument : clangTextDocument ,
1326
+ Position : clangPosition ,
1328
1327
}
1329
- logger .Logf ("%s -> %s" , prefix , cppParams )
1330
- return cppParams , nil
1328
+ logger .Logf ("%s -> %s" , ideParams , clangParams )
1329
+ return clangParams , nil
1331
1330
}
1332
1331
1333
1332
func (ls * INOLanguageServer ) ino2cppRange (logger jsonrpc.FunctionLogger , inoURI lsp.DocumentURI , inoRange lsp.Range ) (lsp.DocumentURI , lsp.Range , error ) {
1334
- cppURI , err := ls .ino2cppDocumentURI (logger , inoURI )
1333
+ cppURI , err := ls .ide2ClangDocumentURI (logger , inoURI )
1335
1334
if err != nil {
1336
1335
return lsp .NilURI , lsp.Range {}, err
1337
1336
}
@@ -1356,7 +1355,7 @@ func (ls *INOLanguageServer) cpp2inoLocationArray(logger jsonrpc.FunctionLogger,
1356
1355
}
1357
1356
1358
1357
func (ls * INOLanguageServer ) ino2cppDocumentRangeFormattingParams (logger jsonrpc.FunctionLogger , inoParams * lsp.DocumentRangeFormattingParams ) (* lsp.DocumentRangeFormattingParams , error ) {
1359
- cppTextDocument , err := ls .ino2cppTextDocumentIdentifier (logger , inoParams .TextDocument )
1358
+ cppTextDocument , err := ls .ide2ClangTextDocumentIdentifier (logger , inoParams .TextDocument )
1360
1359
if err != nil {
1361
1360
return nil , err
1362
1361
}
@@ -1467,14 +1466,14 @@ func (ls *INOLanguageServer) cpp2inoLocation(logger jsonrpc.FunctionLogger, cppL
1467
1466
}, err
1468
1467
}
1469
1468
1470
- func (ls * INOLanguageServer ) cpp2inoDocumentHighlight (logger jsonrpc.FunctionLogger , cppHighlight lsp.DocumentHighlight , cppURI lsp.DocumentURI ) (lsp.DocumentHighlight , error ) {
1471
- _ , inoRange , err := ls .clang2IdeRangeAndDocumentURI (logger , cppURI , cppHighlight .Range )
1469
+ func (ls * INOLanguageServer ) clang2IdeDocumentHighlight (logger jsonrpc.FunctionLogger , clangHighlight lsp.DocumentHighlight , cppURI lsp.DocumentURI ) (lsp.DocumentHighlight , error ) {
1470
+ _ , ideRange , err := ls .clang2IdeRangeAndDocumentURI (logger , cppURI , clangHighlight .Range )
1472
1471
if err != nil {
1473
1472
return lsp.DocumentHighlight {}, err
1474
1473
}
1475
1474
return lsp.DocumentHighlight {
1476
- Kind : cppHighlight .Kind ,
1477
- Range : inoRange ,
1475
+ Kind : clangHighlight .Kind ,
1476
+ Range : ideRange ,
1478
1477
}, nil
1479
1478
}
1480
1479
0 commit comments