Sourcegraph does use language servers (same as your editor would use) to get precise definitions and references.
For example ("find references" on some open-source code):
Go: https://sourcegraph.com/github.com/theupdateframework/notary...
TypeScript: https://sourcegraph.com/github.com/ReactiveX/rxjs/-/blob/src...
It understands many build tools, but not all. Go, JavaScript, TypeScript, Java, Python, and PHP support is all pretty solid. If you use the most common build tools for your language, it usually works well. It degrades un-gracefully if you use custom build tools or scripts, unfortunately, but we're working on making it support more build tools and customization. Sourcegraph development is open source; if you notice any problems, let us know in the issue tracker at https://github.com/sourcegraph/sourcegraph.