@@ -112,94 +112,96 @@ contains |
| 112 | tooltip%active_parameter = param_index | 112 | tooltip%active_parameter = param_index |
| 113 | end subroutine set_active_parameter | 113 | end subroutine set_active_parameter |
| 114 | | 114 | |
| 115 | - subroutine render_signature_tooltip(tooltip) | 115 | + ! UNUSED: Render signature tooltip with parameter highlighting |
| 116 | - type(signature_tooltip_t), intent(in) :: tooltip | 116 | + ! Kept for potential future use |
| 117 | - integer :: display_row, sig_idx | 117 | + ! subroutine render_signature_tooltip(tooltip) |
| 118 | - character(len=512) :: line | 118 | + ! type(signature_tooltip_t), intent(in) :: tooltip |
| 119 | - character(len=256) :: label | 119 | + ! integer :: display_row, sig_idx |
| 120 | - integer :: param_start, param_end, i | 120 | + ! character(len=512) :: line |
| 121 | - | 121 | + ! character(len=256) :: label |
| 122 | - if (.not. tooltip%visible .or. tooltip%num_signatures == 0) return | 122 | + ! integer :: param_start, param_end, i |
| 123 | - | 123 | + ! |
| 124 | - sig_idx = tooltip%active_signature | 124 | + ! if (.not. tooltip%visible .or. tooltip%num_signatures == 0) return |
| 125 | - if (sig_idx < 1 .or. sig_idx > tooltip%num_signatures) return | 125 | + ! |
| 126 | - | 126 | + ! sig_idx = tooltip%active_signature |
| 127 | - display_row = tooltip%row | 127 | + ! if (sig_idx < 1 .or. sig_idx > tooltip%num_signatures) return |
| 128 | - | 128 | + ! |
| 129 | - ! Draw background | 129 | + ! display_row = tooltip%row |
| 130 | - call terminal_move_cursor(display_row, tooltip%col) | 130 | + ! |
| 131 | - call terminal_write(char(27) // '[48;5;238m') ! Dark background | 131 | + ! ! Draw background |
| 132 | - | 132 | + ! call terminal_move_cursor(display_row, tooltip%col) |
| 133 | - ! Build signature line with parameter highlighting | 133 | + ! call terminal_write(char(27) // '[48;5;238m') ! Dark background |
| 134 | - if (allocated(tooltip%signatures(sig_idx)%label)) then | 134 | + ! |
| 135 | - label = tooltip%signatures(sig_idx)%label | 135 | + ! ! Build signature line with parameter highlighting |
| 136 | - | 136 | + ! if (allocated(tooltip%signatures(sig_idx)%label)) then |
| 137 | - ! If we have parameters, try to highlight the active one | 137 | + ! label = tooltip%signatures(sig_idx)%label |
| 138 | - if (tooltip%signatures(sig_idx)%num_parameters > 0 .and. & | 138 | + ! |
| 139 | - tooltip%active_parameter > 0 .and. & | 139 | + ! ! If we have parameters, try to highlight the active one |
| 140 | - tooltip%active_parameter <= tooltip%signatures(sig_idx)%num_parameters) then | 140 | + ! if (tooltip%signatures(sig_idx)%num_parameters > 0 .and. & |
| 141 | - | 141 | + ! tooltip%active_parameter > 0 .and. & |
| 142 | - ! Get the parameter label to highlight | 142 | + ! tooltip%active_parameter <= tooltip%signatures(sig_idx)%num_parameters) then |
| 143 | - if (allocated(tooltip%signatures(sig_idx)%parameters(tooltip%active_parameter)%label)) then | 143 | + ! |
| 144 | - block | 144 | + ! ! Get the parameter label to highlight |
| 145 | - character(len=:), allocatable :: param_label | 145 | + ! if (allocated(tooltip%signatures(sig_idx)%parameters(tooltip%active_parameter)%label)) then |
| 146 | - param_label = tooltip%signatures(sig_idx)%parameters(tooltip%active_parameter)%label | 146 | + ! block |
| 147 | - | 147 | + ! character(len=:), allocatable :: param_label |
| 148 | - ! Find parameter in signature | 148 | + ! param_label = tooltip%signatures(sig_idx)%parameters(tooltip%active_parameter)%label |
| 149 | - param_start = index(label, trim(param_label)) | 149 | + ! |
| 150 | - if (param_start > 0) then | 150 | + ! ! Find parameter in signature |
| 151 | - param_end = param_start + len_trim(param_label) - 1 | 151 | + ! param_start = index(label, trim(param_label)) |
| 152 | - | 152 | + ! if (param_start > 0) then |
| 153 | - ! Build highlighted line | 153 | + ! param_end = param_start + len_trim(param_label) - 1 |
| 154 | - line = " " | 154 | + ! |
| 155 | - if (param_start > 1) then | 155 | + ! ! Build highlighted line |
| 156 | - line = trim(line) // label(1:param_start-1) | 156 | + ! line = " " |
| 157 | - end if | 157 | + ! if (param_start > 1) then |
| 158 | - | 158 | + ! line = trim(line) // label(1:param_start-1) |
| 159 | - ! Highlight the active parameter | 159 | + ! end if |
| 160 | - line = trim(line) // char(27) // '[1;33m' ! Bold yellow | 160 | + ! |
| 161 | - line = trim(line) // label(param_start:param_end) | 161 | + ! ! Highlight the active parameter |
| 162 | - line = trim(line) // char(27) // '[0;48;5;238m' ! Reset to dark bg | 162 | + ! line = trim(line) // char(27) // '[1;33m' ! Bold yellow |
| 163 | - | 163 | + ! line = trim(line) // label(param_start:param_end) |
| 164 | - if (param_end < len_trim(label)) then | 164 | + ! line = trim(line) // char(27) // '[0;48;5;238m' ! Reset to dark bg |
| 165 | - line = trim(line) // label(param_end+1:len_trim(label)) | 165 | + ! |
| 166 | - end if | 166 | + ! if (param_end < len_trim(label)) then |
| 167 | - line = trim(line) // " " | 167 | + ! line = trim(line) // label(param_end+1:len_trim(label)) |
| 168 | - else | 168 | + ! end if |
| 169 | - ! Couldn't find parameter, show plain | 169 | + ! line = trim(line) // " " |
| 170 | - line = " " // trim(label) // " " | 170 | + ! else |
| 171 | - end if | 171 | + ! ! Couldn't find parameter, show plain |
| 172 | - end block | 172 | + ! line = " " // trim(label) // " " |
| 173 | - else | 173 | + ! end if |
| 174 | - line = " " // trim(label) // " " | 174 | + ! end block |
| 175 | - end if | 175 | + ! else |
| 176 | - else | 176 | + ! line = " " // trim(label) // " " |
| 177 | - line = " " // trim(label) // " " | 177 | + ! end if |
| 178 | - end if | 178 | + ! else |
| 179 | - else | 179 | + ! line = " " // trim(label) // " " |
| 180 | - line = " (no signature) " | 180 | + ! end if |
| 181 | - end if | 181 | + ! else |
| 182 | - | 182 | + ! line = " (no signature) " |
| 183 | - ! Truncate if too long | 183 | + ! end if |
| 184 | - if (len_trim(line) > tooltip%max_width) then | 184 | + ! |
| 185 | - line = line(1:tooltip%max_width-3) // "..." | 185 | + ! ! Truncate if too long |
| 186 | - end if | 186 | + ! if (len_trim(line) > tooltip%max_width) then |
| 187 | - | 187 | + ! line = line(1:tooltip%max_width-3) // "..." |
| 188 | - call terminal_write(trim(line)) | 188 | + ! end if |
| 189 | - | 189 | + ! |
| 190 | - ! Show which signature if multiple | 190 | + ! call terminal_write(trim(line)) |
| 191 | - if (tooltip%num_signatures > 1) then | 191 | + ! |
| 192 | - block | 192 | + ! ! Show which signature if multiple |
| 193 | - character(len=20) :: sig_indicator | 193 | + ! if (tooltip%num_signatures > 1) then |
| 194 | - write(sig_indicator, '(A,I0,A,I0,A)') " (", sig_idx, "/", tooltip%num_signatures, ")" | 194 | + ! block |
| 195 | - call terminal_write(char(27) // '[90m') ! Gray | 195 | + ! character(len=20) :: sig_indicator |
| 196 | - call terminal_write(trim(sig_indicator)) | 196 | + ! write(sig_indicator, '(A,I0,A,I0,A)') " (", sig_idx, "/", tooltip%num_signatures, ")" |
| 197 | - end block | 197 | + ! call terminal_write(char(27) // '[90m') ! Gray |
| 198 | - end if | 198 | + ! call terminal_write(trim(sig_indicator)) |
| 199 | - | 199 | + ! end block |
| 200 | - ! Reset colors | 200 | + ! end if |
| 201 | - call terminal_write(char(27) // '[0m') | 201 | + ! |
| 202 | - end subroutine render_signature_tooltip | 202 | + ! ! Reset colors |
| | 203 | + ! call terminal_write(char(27) // '[0m') |
| | 204 | + ! end subroutine render_signature_tooltip |
| 203 | | 205 | |
| 204 | subroutine handle_signature_response(tooltip, response) | 206 | subroutine handle_signature_response(tooltip, response) |
| 205 | use lsp_protocol_module, only: lsp_message_t | 207 | use lsp_protocol_module, only: lsp_message_t |