Skip to content

Commit bd6c302

Browse files
committed
Add tooltip to classifications container
1 parent 1272ddd commit bd6c302

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

extensions/ql-vscode/src/view/data-extensions-editor/MethodClassifications.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,25 @@ export const MethodClassifications = ({ externalApiUsage }: Props) => {
3636
const inTest = allUsageClassifications.has(CallClassification.Test);
3737
const inGenerated = allUsageClassifications.has(CallClassification.Generated);
3838

39+
const tooltip = useMemo(() => {
40+
if (inTest && inGenerated) {
41+
return "This method is only used from test and generated code";
42+
}
43+
if (inTest) {
44+
return "This method is only used from test code";
45+
}
46+
if (inGenerated) {
47+
return "This method is only used from generated code";
48+
}
49+
return "";
50+
}, [inTest, inGenerated]);
51+
3952
if (inSource) {
4053
return null;
4154
}
4255

4356
return (
44-
<ClassificationsContainer>
57+
<ClassificationsContainer title={tooltip}>
4558
{inTest && <ClassificationTag>Test</ClassificationTag>}
4659
{inGenerated && <ClassificationTag>Generated</ClassificationTag>}
4760
</ClassificationsContainer>

0 commit comments

Comments
 (0)