sourcegraph / srclib

srclib is a polyglot code analysis library, built for hackability. It consists of language analysis toolchains (currently for Go and Java, with Python, JavaScript, and Ruby in beta) with a common output format, and a CLI tool for running the analysis.
https://srclib.org
Other
942 stars 62 forks source link

Adding srclib-basic toolchain #228

Closed alexsaveliev closed 8 years ago

alexsaveliev commented 8 years ago

This pull request adds srclib-basic toolchain and provides temporary workaround for tools/godep#359

beyang commented 8 years ago

Here are some PHP issues we should address before merging and deploying this.

On github.com/PHPMailer/PHPMailer: image

image

Is this because the language-independent syntax highlighting lumps the reference tokens together when they should be separate? Would adding PHP support to syntaxhighlight fix this?

alexsaveliev commented 8 years ago

definition highlighting and reference highlighting misaligned

Claimed fixed (https://src.sourcegraph.com/syntaxhighlight/.changes/1)

page load takes 8.6 seconds

Performance improved. PHP lexer have no more RE-based rules, all of them were replaced with functions

reference highlighting is incorrect

Claimed fixed (https://src.sourcegraph.com/syntaxhighlight/.changes/1). The problem was that PHP lexer expected full PHP source and was unable to highlight properly PHP fragments

beyang commented 8 years ago

Thanks for fixing these. An additional bug I discovered using it some more:

beyang commented 8 years ago

What happens in the case where a reference's definition is ambiguous/uncertain? Do we just pick and choose one definition in that case?

Sourcegraph supports having multiple overlapping tokens (useful for some language features, when a token can reference simultaneously a field and a type like in Go). We could use that here to let the user choose between possible choices when the definition choice is uncertain.