Skip to content

Commit

Permalink
Repository finder & context parsing improvements (#20296)
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptronicek authored Oct 14, 2024
1 parent 3e62b4e commit 6f87a7a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,14 @@ export const Combobox: FunctionComponent<ComboboxProps> = ({

const setActiveElement = useCallback(
(element: string) => {
if (!filteredOptions.find((el) => element === el.id)?.isSelectable) {
return;
}
setSelectedElementTemp(element);
const el = document.getElementById(element);
el?.scrollIntoView({ block: "nearest" });
},
[setSelectedElementTemp],
[filteredOptions],
);

const handleOpenChange = useCallback(
Expand Down
6 changes: 5 additions & 1 deletion components/server/src/workspace/context-parser-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { IPrefixContextParser, IContextParser } from "./context-parser";
import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing";
import { ConfigProvider } from "./config-provider";
import { InvalidGitpodYMLError } from "@gitpod/public-api-common/lib/public-api-errors";
import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error";

@injectable()
export class ContextParser {
Expand Down Expand Up @@ -83,7 +84,10 @@ export class ContextParser {
}
}
if (!result) {
throw new Error(`Couldn't parse context '${nonPrefixedContextURL}'.`);
throw new ApplicationError(
ErrorCodes.BAD_REQUEST,
`Couldn't parse context '${nonPrefixedContextURL}'.`,
);
}

// TODO: Make the parsers return the context with normalizedContextURL set
Expand Down

0 comments on commit 6f87a7a

Please sign in to comment.