In a nutshell, philosophy deals with those subjects that cannot be completely formalized. The sciences are about areas of knowledge for which complete formal theories are possible. Scientism includes the belief that what is formalizable and what is real is the same, i.e. everything can be described in terms of formal theories. Analytical philosophy is trying to turn philosophy into a science, but if everything can be formalized, philosophy is (as some scientists state) unnecessary, so analytical philosophy is making itself obsolete.
However, if, as I think, reality cannot be completely formalized, science is inherently incomplete and philosophy is not going away. Especially, human cognitive processes cannot be completely formalized in principle. Each formal description of such processes is incomplete and partial. Cognition develops historically (something formalizable systems don’t do). Cognitive science then turns out not to be a science but a historical discipline. Human thinking does not follow fixed laws.
As a result, there is no complete and at the same time exact formal description of cognition and of its products, like society, culture, and even science itself, cannot be described completely in terms of a single formal theory. Philosophy is not going away. As long as you do “normal science” in the Kuhnian sense, you don’t need philosophy, but if you are working in any field of the humanities, or psychology or “social sciences”, you permanently need philosophy. Here, you do not have a fixed methodology. You have to be reflexive and look at what you are doing from a meta- (and meta-meta-…level) all of the time. You have to look at what you are doing critically all of the time. In the sciences, you also have to do that, but only occasionally, if you bump into anomalies and you have to shift your paradigm.
In mathematics, there are entities for which we can prove that a complete formal description is impossible. If such entities exist in mathematics, there is no a-priory reason why they should not also exist in physical reality. Human beings and their societies and cultures seem to be such entities for which a complete formalization is impossible. If that is so, philosophy is not going to go away.