Sourcetrail icon indicating copy to clipboard operation
Sourcetrail copied to clipboard

Support JavaScript/ECMAScript

Open matthewadams opened this issue 9 years ago • 19 comments

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.

matthewadams avatar Jan 13 '17 15:01 matthewadams

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

egraether avatar Jan 13 '17 15:01 egraether

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.

maxmarkus avatar Jan 16 '17 23:01 maxmarkus

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

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

nlieb avatar Jun 23 '17 16:06 nlieb

+1 for JavaScript by mail

egraether avatar Jul 10 '17 12:07 egraether

+1 for JavaScript by mail

egraether avatar Jul 11 '17 09:07 egraether

+1 for JavaScript by mail

egraether avatar Jul 17 '17 15:07 egraether

+1 for JavaScript by mail

egraether avatar Sep 11 '17 10:09 egraether

+1 via mail

egraether avatar Nov 29 '17 20:11 egraether

any news on this?

egoarka avatar Dec 10 '18 20:12 egoarka

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 avatar Dec 11 '18 10:12 egraether

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!

egraether avatar Dec 19 '18 16:12 egraether

I'm interested in writing an indexer for JavaScript

hisergiorojas avatar Nov 19 '19 16:11 hisergiorojas

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)

mlangkabel avatar Nov 19 '19 16:11 mlangkabel

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

LouisStAmour avatar Nov 19 '19 19:11 LouisStAmour

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

XVilka avatar Nov 20 '19 04:11 XVilka

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.

Aberrantfox avatar Feb 13 '20 14:02 Aberrantfox

I think its also will help to trace frontend framework

Fashaun avatar Sep 01 '20 05:09 Fashaun

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.)

JFQueralt avatar Nov 13 '20 16:11 JFQueralt

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).

k4b7 avatar Feb 16 '21 01:02 k4b7