Skip to content

Commit

Permalink
ticket:13814: Visual Studio IntelliSense should ignore the 'urename.h…
Browse files Browse the repository at this point in the history
…' content so that 'Go-to-Definition' (F12) will actually work in the IDE.

git-svn-id: http://source.icu-project.org/repos/icu/trunk@41551 251d0590-4201-4cf1-90de-194747b24ca1
  • Loading branch information
jefgen committed Jun 27, 2018
1 parent 7199953 commit 81d7a49
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
9 changes: 7 additions & 2 deletions icu4c/source/common/unicode/urename.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@

#if !U_DISABLE_RENAMING

// Disable Renaming for Visual Studio's IntelliSense feature, so that 'Go-to-Definition' (F12) will work.
#if defined(_MSC_VER) && defined(__INTELLISENSE__)

/* We need the U_ICU_ENTRY_POINT_RENAME definition. There's a default one in unicode/uvernum.h we can use, but we will give
the platform a chance to define it first.
Normally (if utypes.h or umachine.h was included first) this will not be necessary as it will already be defined.
Expand Down Expand Up @@ -1827,6 +1830,8 @@
#define ztrans_setTime U_ICU_ENTRY_POINT_RENAME(ztrans_setTime)
#define ztrans_setTo U_ICU_ENTRY_POINT_RENAME(ztrans_setTo)

#endif
#endif /* defined(_MSC_VER) && defined(__INTELLISENSE__) */

#endif
#endif /* U_DISABLE_RENAMING */

#endif /* URENAME_H */
14 changes: 12 additions & 2 deletions icu4c/source/tools/genren/genren.pl
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
#if !U_DISABLE_RENAMING
// Disable Renaming for Visual Studio's IntelliSense feature, so that 'Go-to-Definition' (F12) will work.
#if defined(_MSC_VER) && defined(__INTELLISENSE__)
/* We need the U_ICU_ENTRY_POINT_RENAME definition. There's a default one in unicode/uvernum.h we can use, but we will give
the platform a chance to define it first.
Normally (if utypes.h or umachine.h was included first) this will not be necessary as it will already be defined.
Expand Down Expand Up @@ -236,8 +239,15 @@
# print HEADER "#define $_ $_$U_ICU_VERSION_SUFFIX\n";
}

print HEADER "\n#endif\n";
print HEADER "\n#endif\n";

print HEADER <<"EndOfHeaderFooter";
#endif /* defined(_MSC_VER) && defined(__INTELLISENSE__) */
#endif /* U_DISABLE_RENAMING */
#endif /* URENAME_H */
EndOfHeaderFooter


close HEADER;

Expand Down

0 comments on commit 81d7a49

Please sign in to comment.