nodeHandleFrom creates an index-based node handle (index.kind.path), building a node index table for the file on-demand if needed.
(node *ast.Node)
| 97 | // nodeHandleFrom creates an index-based node handle (index.kind.path), building a node index table |
| 98 | // for the file on-demand if needed. |
| 99 | func (sd *snapshotData) nodeHandleFrom(node *ast.Node) NodeHandle { |
| 100 | sourceFile := ast.GetSourceFileOfNode(node) |
| 101 | path := sourceFile.Path() |
| 102 | table := encoder.GetNodeIndexTable(sourceFile) |
| 103 | idx := table.GetIndex(node) |
| 104 | return NodeHandle(fmt.Sprintf("%d.%d.%s", idx, node.Kind, path)) |
| 105 | } |
| 106 | |
| 107 | // getOrCreateProjectRegistry returns the registry for the given project, creating it if needed. |
| 108 | func (sd *snapshotData) getOrCreateProjectRegistry(projectID ProjectID) *projectRegistryData { |
no test coverage detected