How can I calculate Shannon-Wiener diversity index in caves with different kind of habitats and different sampling methods?
You could account for this in your statistical analysis. I'm assuming that  you will collect terrestrial fauna the same way in every cave, and if there is a stream in a cave aquatic fauna will be collected in some standardized way as well. I'll also assume you'll have some other explanatory variables that you think may explain diversity, richness, or abundance. These could include cave temperature, length, depth, etc. 

Calculate the Shannon-Weiner index for each cave using all species and abundances, whether they came from an aquatic or terrestrial sample. Then for you statistical model include whether a stream was present in a cave or not using a binary variable along with your other explanatory variables. 

index ~ f(temperature, length, depth, stream)

In this example temperature, length, and depth are all continuous variables. Stream will be a binary variable (either 0 or 1, 1 meaning a stream was present). This will give you a measure of how much a stream contributes to diversity.