relative path on filenamelink hover
This commit is contained in:
parent
6cdb1d93da
commit
e0385d3543
1 changed files with 7 additions and 2 deletions
|
|
@ -2,7 +2,7 @@ import { RangeInFile } from "core";
|
|||
import { useContext } from "react";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import FileIcon from "../FileIcon";
|
||||
import { getUriPathBasename } from "core/util/uri";
|
||||
import { findUriInDirs, getUriPathBasename } from "core/util/uri";
|
||||
import { ToolTip } from "../gui/Tooltip";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
|
|
@ -23,6 +23,11 @@ function FilenameLink({ rif }: FilenameLinkProps) {
|
|||
|
||||
const id = uuidv4();
|
||||
|
||||
const { relativePathOrBasename } = findUriInDirs(
|
||||
rif.filepath,
|
||||
window.workspacePaths ?? [],
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<span
|
||||
|
|
@ -36,7 +41,7 @@ function FilenameLink({ rif }: FilenameLinkProps) {
|
|||
</span>
|
||||
</span>
|
||||
<ToolTip id={id} place="top">
|
||||
{rif.filepath}
|
||||
{"/" + relativePathOrBasename}
|
||||
</ToolTip>
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue