closeGoFileWithGopls closes the corresponding .go file with gopls CRITICAL FIX D1: Clean up when .dingo file is closed
(ctx context.Context, dingoPath string)
| 814 | // closeGoFileWithGopls closes the corresponding .go file with gopls |
| 815 | // CRITICAL FIX D1: Clean up when .dingo file is closed |
| 816 | func (s *Server) closeGoFileWithGopls(ctx context.Context, dingoPath string) error { |
| 817 | // Convert .dingo path to .go path using config-aware calculation |
| 818 | goPath := s.dingoToGoPath(dingoPath) |
| 819 | |
| 820 | s.config.Logger.Debugf("[Diagnostic Fix] Closing .go file with gopls: %s", goPath) |
| 821 | |
| 822 | // Create didClose params for gopls |
| 823 | params := protocol.DidCloseTextDocumentParams{ |
| 824 | TextDocument: protocol.TextDocumentIdentifier{ |
| 825 | URI: protocol.DocumentURI(lspuri.File(goPath)), |
| 826 | }, |
| 827 | } |
| 828 | |
| 829 | // Close with gopls |
| 830 | if err := s.gopls.DidClose(ctx, params); err != nil { |
| 831 | return fmt.Errorf("gopls didClose failed: %w", err) |
| 832 | } |
| 833 | |
| 834 | s.config.Logger.Debugf("[Diagnostic Fix] Successfully closed .go file with gopls: %s", goPath) |
| 835 | return nil |
| 836 | } |
| 837 | |
| 838 | // publishDingoDiagnostics publishes Dingo-specific diagnostics (e.g., transpilation errors) |
| 839 | // This is separate from gopls diagnostics (which are translated and forwarded) |
no test coverage detected