bugfix: correctly open ctx item url
This commit is contained in:
parent
5563b77024
commit
ce495d94ce
3 changed files with 9 additions and 5 deletions
|
|
@ -91,7 +91,7 @@ class DocsContextProvider extends BaseContextProvider {
|
|||
await docsService.isJetBrainsAndPreIndexedDocsProvider();
|
||||
|
||||
if (isJetBrainsAndPreIndexedDocsProvider) {
|
||||
extras.ide.showToast(
|
||||
await extras.ide.showToast(
|
||||
"error",
|
||||
`${DocsService.preIndexedDocsEmbeddingsProvider.id} is configured as ` +
|
||||
"the embeddings provider, but it cannot be used with JetBrains. " +
|
||||
|
|
@ -105,7 +105,7 @@ class DocsContextProvider extends BaseContextProvider {
|
|||
const preIndexedDoc = preIndexedDocs[query];
|
||||
|
||||
if (!!preIndexedDoc) {
|
||||
Telemetry.capture("docs_pre_indexed_doc_used", {
|
||||
void Telemetry.capture("docs_pre_indexed_doc_used", {
|
||||
doc: preIndexedDoc["title"],
|
||||
});
|
||||
}
|
||||
|
|
@ -147,6 +147,10 @@ class DocsContextProvider extends BaseContextProvider {
|
|||
: chunk.otherMetadata?.title || chunk.filepath,
|
||||
description: chunk.filepath,
|
||||
content: chunk.content,
|
||||
uri: {
|
||||
type: "url" as const,
|
||||
value: chunk.filepath,
|
||||
},
|
||||
}))
|
||||
.reverse(),
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class URLContextProvider extends BaseContextProvider {
|
|||
return [
|
||||
{
|
||||
icon,
|
||||
description: title,
|
||||
description: url.toString(),
|
||||
content: markdown,
|
||||
name: title,
|
||||
uri: {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ function ContextItemsPeekItem({ contextItem }: ContextItemsPeekItemProps) {
|
|||
const { uri, name, description, content } = contextItem;
|
||||
|
||||
if (uri?.type === "url") {
|
||||
window.open(description, "_blank");
|
||||
ideMessenger.post("openUrl", uri.value);
|
||||
} else if (uri) {
|
||||
const isRangeInFile = name.includes(" (") && name.endsWith(")");
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ function ContextItemsPeekItem({ contextItem }: ContextItemsPeekItemProps) {
|
|||
if (contextItem.icon) {
|
||||
return (
|
||||
<SafeImg
|
||||
className="flex-shrink-0 mr-2 rounded p-1"
|
||||
className="flex-shrink-0 mr-2 rounded-md p-1"
|
||||
src={contextItem.icon}
|
||||
height={dimensions}
|
||||
width={dimensions}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue