(_ context.Context, uri lsp.DocumentURI)
| 19 | } |
| 20 | |
| 21 | func (h *Handler) readFile(_ context.Context, uri lsp.DocumentURI) ([]byte, error) { |
| 22 | if !IsURI(uri) { |
| 23 | return nil, &os.PathError{Op: "Open", Path: string(uri), Err: errors.New("unable to read out-of-workspace resource from virtual file system")} |
| 24 | } |
| 25 | fs := h.GetFS() |
| 26 | content, found := fs.get(uri) |
| 27 | if !found { |
| 28 | return nil, &os.PathError{Op: "Open", Path: string(uri), Err: os.ErrNotExist} |
| 29 | } |
| 30 | return content, nil |
| 31 | } |
| 32 | |
| 33 | // handleFileSystemRequest handles textDocument/did* requests. |
| 34 | func (h *Handler) handleFileSystemRequest(ctx context.Context, conn *jsonrpc2.Conn, req *jsonrpc2.Request) (lsp.DocumentURI, bool, error) { |
no test coverage detected