2 Star 0 Fork 0

mirrors_sourcegraph/srclib-typescript

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

srclib-typescript

srclib-typescript is a srclib toolchain that performs TypeScript code analysis: type inference, documentation generation, jump-to-definition, dependency resolution, etc. It enables this functionality in any client application whose code analysis is powered by srclib, including Sourcegraph.

Installation

This toolchain is not a standalone program; it provides additional functionality to applications that use srclib. First, install the srclib program (see srclib installation instructions). Then run:

git clone https://github.com/sourcegraph/srclib-typescript.git
cd srclib-typescript
srclib toolchain install typescript

To verify that installation succeeded, run:

srclib toolchain list

You should see this srclib-typescript toolchain in the list. Now that this toolchain is installed, any program that relies on srclib will support TypeScript. (TODO(sqs): add a tutorial link)

Current limitations

  • Support only for projects which have tsconfig.json file in the root directory, other package systems are not supported.

  • To be fully analysed file need to be included in the Files section of tsconfig.json file or to be referenced via reference path.

  • Production of more than one ref for reference is currently switched off if multiple declarations are provided by AST tree. Reasons - src tool produces bugs in this case, for some references AST tree gives just the same declarations and it leads to duplicate ref error. Need to go back to this issue after a while.

Tests and known issues

srclib-typescript is alpha-quality software. It powers code analysis on Sourcegraph.com and additionally has been tested on the next typescript repositories:

Successfully:

Testing in progress:

Next issues were found:

  • Unsupported builtins for interfaces.
  • Partially supported shorthand property assignments.
  • ExportSpecifiers can work better.
  • Import clause is not fully supported (syntax tree kind = 226, reproduced on doppio project).

Run procedure

Testing this toolchain requires that you have installed srclib from srclib and that you have this toolchain set up. See srclib documentation for more information. To test this toolchain's output against the expected output, run:

# run the tests
srclib test

Contributing

Patches are welcomed via GitHub pull request! See CONTRIBUTING.md for more information. srclib-typescript's toolchain solution is based on Typescript AST compiler api.

空文件

简介

Sourcegraph support for typescript toolchain 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_sourcegraph/srclib-typescript.git
git@gitee.com:mirrors_sourcegraph/srclib-typescript.git
mirrors_sourcegraph
srclib-typescript
srclib-typescript
master

搜索帮助