我在postgres 9.3.5中有一个表格,如下所示:
CREATE TABLE customer_area_node
(
id bigserial NOT NULL,
customer_id integer NOT NULL,
parent_id bigint,
name text,
description text,
CONSTRAINT customer_area_node_pkey PRIMARY KEY (id)
)
Run Code Online (Sandbox Code Playgroud)
我查询:
WITH RECURSIVE c AS (
SELECT *, 0 as level, name as path FROM customer_area_node WHERE customer_id = 2 and parent_id is null
UNION ALL
SELECT customer_area_node.*,
c.level + 1 as level,
c.path || '/' || customer_area_node.name as path
FROM customer_area_node
join c ON customer_area_node.parent_id = c.id
)
SELECT * FROM c ORDER …Run Code Online (Sandbox Code Playgroud) 我正在尝试确定一个类,它引用了什么(其他命名空间或外部库命名空间)。对于给定的文档/语法树等似乎是开箱即用的,没有办法做到这一点......还有更多我需要的只是使用符号查找器,遍历整个代码库中的每个文件,然后调用查找,粘贴找到的引用在地图中,然后向后导航地图。
我在这里错了吗?我错过了一些简单的东西吗?我只是想建立一个依赖关系图......如果我从这个类开始,这里是它最终需要递归的所有东西。我不介意做研究,但我觉得我错过了一些东西……任何线索都会有所帮助
简要伪代码概念:
var msWorkspace = MSBuildWorkspace.Create();
var solution = msWorkspace.OpenSolutionAsync(solutionPath).Result;
foreach (var project in solution.Projects)
{
Append(project.Name);
foreach (var document in project.Documents)
{
Append("\t\t\t" + document.Name);
if (document.SupportsSemanticModel)
{
SemanticModel model = await document.GetSemanticModelAsync();
var node = await document.GetSyntaxRootAsync();
//Need to be able to gather dependencies for this current doc
}
}
}
Run Code Online (Sandbox Code Playgroud)