@@ -691,6 +691,15 @@ func (handler *InoHandler) transformClangdResult(method string, uri lsp.Document
691
691
defer handler .synchronizer .DataMux .RUnlock ()
692
692
693
693
switch r := result .(type ) {
694
+ case * lsp.Hover :
695
+ // method "textDocument/hover"
696
+ if len (r .Contents .Value ) == 0 {
697
+ return nil
698
+ }
699
+ if uri .AsPath ().EquivalentTo (handler .buildSketchCpp ) {
700
+ _ , * r .Range = handler .sketchMapper .CppToInoRange (* r .Range )
701
+ }
702
+
694
703
case * lsp.CompletionList : // "textDocument/completion":
695
704
handler .cpp2inoCompletionList (r , uri )
696
705
case * []* lsp.CommandOrCodeAction : // "textDocument/codeAction":
@@ -704,11 +713,6 @@ func (handler *InoHandler) transformClangdResult(method string, uri lsp.Document
704
713
handler .cpp2inoCodeAction (codeAction , uri )
705
714
}
706
715
}
707
- case * lsp.Hover : // "textDocument/hover":
708
- if len (r .Contents .Value ) == 0 {
709
- return nil
710
- }
711
- handler .cpp2inoHover (r , uri )
712
716
// case "textDocument/definition":
713
717
// fallthrough
714
718
// case "textDocument/typeDefinition":
@@ -816,15 +820,6 @@ func (handler *InoHandler) cpp2inoWorkspaceEdit(origEdit *lsp.WorkspaceEdit) *ls
816
820
return & newEdit
817
821
}
818
822
819
- func (handler * InoHandler ) cpp2inoHover (hover * lsp.Hover , uri lsp.DocumentURI ) {
820
- if data , ok := handler .data [uri ]; ok {
821
- r := hover .Range
822
- if r != nil {
823
- _ , * r = data .sourceMap .CppToInoRange (* r )
824
- }
825
- }
826
- }
827
-
828
823
func (handler * InoHandler ) cpp2inoLocation (location * lsp.Location ) {
829
824
if data , ok := handler .data [location .URI ]; ok {
830
825
location .URI = data .sourceURI
0 commit comments