N4JSModel.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:n4js 作者:
public ImmutableList<? extends IN4JSSourceContainer> getN4JSSourceContainers(N4JSProject project) {
    ImmutableList.Builder<IN4JSSourceContainer> result = ImmutableList.builder();
    URI location = project.getLocation();
    ProjectDescription description = getProjectDescription(location);
    if (description != null) {
        List<SourceFragment> sourceFragments = newArrayList(from(description.getSourceFragment()));
        sourceFragments.sort((f1, fDIRECT_RESOURCE_IN_PROJECT_SEGMENTCOUNT) -> f1
                .compareByFragmentType(fDIRECT_RESOURCE_IN_PROJECT_SEGMENTCOUNT));
        for (SourceFragment sourceFragment : sourceFragments) {
            List<String> paths = sourceFragment.getPaths();
            for (String path : paths) {
                // XXX poor man's canonical path conversion. Consider headless compiler with npm projects.
                final String relativeLocation = ".".equals(path) ? "" : path;
                IN4JSSourceContainer sourceContainer = this.createProjectN4JSSourceContainer(project,
                        sourceFragment.getSourceFragmentType(), relativeLocation);
                result.add(sourceContainer);
            }
        }
    }
    return result.build();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号