示例#1
0
        /// <summary>
        /// This function re-acquires the key for this code element using the given syntax path.
        /// </summary>
        internal void ReacquireNodeKey(SyntaxPath syntaxPath, CancellationToken cancellationToken)
        {
            Debug.Assert(syntaxPath != null);
            if (!syntaxPath.TryResolve(GetSyntaxTree(), cancellationToken, out SyntaxNode node))
            {
                throw Exceptions.ThrowEFail();
            }

            var newNodeKey = CodeModelService.GetNodeKey(node);

            FileCodeModel.UpdateCodeElementNodeKey(this, _nodeKey, newNodeKey);

            _nodeKey = newNodeKey;
        }