After writing comments for my function in TypeScript, I wanted to see those comments displayed wherever the function was used. However, in the following code snippet:
/** Checks localStorage for "lang".
* Returns "fa" if not specified.
*/
export const getAppLanguages = () => {
const value = window.localStorage.getItem("lang");
if (value === "fa") return "fa";
if (value === "en") return "en";
window.localStorage.setItem("lang", "fa");
return "fa";
};
When hovering over the function within the same file it was declared in, the tooltip includes the comment: tooltip with comment
However, in other files where I have used this function, the comments don't show up. For example, in the following code:
const initialState: initialLanguageStateType = {
appLanguage:
(getAppLanguages() as AppLanguageEnum.fa | AppLanguageEnum.en) ||
AppLanguageEnum.fa,
};
I encountered:
I attempted to add some configuration in VSCode settings.