CoatiSoftware / Sourcetrail

Sourcetrail - free and open-source interactive source explorer
https://www.sourcetrail.com/
GNU General Public License v3.0
14.86k stars 1.4k forks source link

Support JavaScript/ECMAScript #294

Open matthewadams opened 7 years ago

matthewadams commented 7 years ago

As of the writing of this issue, only Java & C/C++ are supported languages. Please add support for JavaScript/ECMAScript, including support for Node.js. I imagine TypeScript could be in this conversation as well.

egraether commented 7 years ago

That's gonna be a tough one though. JavaScript is a dynamic language, and as such pretty hard to statically analyze. Any starting points?

maxmarkus commented 7 years ago

There are couple static code analysis tools like plato, scrlib, tern, checkmarx,.. but I am not sure if they work in a way thy could help you.

nlieb commented 7 years ago

+1 for Typescript. Support for this would make me a customer.

There is also Flowtype, but it has a smaller following.

egraether commented 7 years ago

+1 for JavaScript by mail

egraether commented 7 years ago

+1 for JavaScript by mail

egraether commented 7 years ago

+1 for JavaScript by mail

egraether commented 7 years ago

+1 for JavaScript by mail

egraether commented 6 years ago

+1 via mail

egoarka commented 5 years ago

any news on this?

egraether commented 5 years ago

We are currently working on a little project to make it easier to add new language support to Sourcetrail. I will let you know when it's ready.

egraether commented 5 years ago

Since we cannot keep up with language requests, we created the SourcetrailDB library to allow anyone to write custom indexers and extend language support for Sourcetrail.

If you are interested in writing an indexer for JavaScript, please let us know!

hisergiorojas commented 4 years ago

I'm interested in writing an indexer for JavaScript

mlangkabel commented 4 years ago

Awesome, please take a look at our Language Extension Guide! @LouisStAmour is already heavily working on Typescript support (see https://github.com/CoatiSoftware/SourcetrailDB/issues/2)

LouisStAmour commented 4 years ago

Just like how VS Code uses TypeScript to provide type checking and completions for JavaScript, it's possible once we get TypeScript support up and running, we'll have JavaScript support for free. https://code.visualstudio.com/docs/nodejs/working-with-javascript

XVilka commented 4 years ago

https://github.com/CoatiSoftware/Sourcetrail/issues/750 might be the way to go

Aberrantfox commented 4 years ago

Any forward on this? I gave this app a zip around in a supported language and it was quite nice, but unfortunately my work involves C# and JavaScript... so it's sad to see there is no support for it.

Fashaun commented 4 years ago

I think its also will help to trace frontend framework

JFQueralt commented 3 years ago

Has there been any advances in this area? Really much looking forward to work with Sourcetrail in our project https://github.com/TheIOFoundation/ProjectLockdown

(I wish I could help with this feature; I lack the necessary skills.)

kevinbarabash commented 3 years ago

Reading though the language extension guide, writing an AST visitor doesn't sound too difficult. There are lots of parsers out and related traversal functions. I'd probably start with @babel/parser and @babel/traverse.

The hard part (as mentioned in the guide) is determining which method definition is to reference for a particular method call. This is where supporting TypeScript should be easier since it already has all that info when things are properly typed (not using any).