Пример #1
0
        public Task <RangeOrPlaceholderRange> Handle(PrepareRenameParams request, CancellationToken cancellationToken) => Task.Run(() => {
            var link = GetLink(_languageServer, request.TextDocument.Uri.ToUri(), request.Position);
            if (link == null)
            {
                return(new RangeOrPlaceholderRange(new PlaceholderRange()));
            }

            return(new RangeOrPlaceholderRange(new PlaceholderRange()
            {
                Range = link.SourceRange,
                Placeholder = link.Name
            }));
        });
        // IPrepareRename
        public async Task <RangeOrPlaceholderRange> Handle(PrepareRenameParams request, CancellationToken cancellationToken)
        {
            var link = RenameInfo.GetLink(_languageServer, request.TextDocument.Uri, request.Position);

            if (link == null)
            {
                return(new RangeOrPlaceholderRange(new PlaceholderRange()));
            }

            return(new RangeOrPlaceholderRange(new PlaceholderRange()
            {
                Range = link.Range.ToLsRange(),
                Placeholder = link.Name
            }));
        }
Пример #3
0
 public override Task<RangeOrPlaceholderRange> Handle(PrepareRenameParams request, CancellationToken cancellationToken) => _handler.Invoke(request, cancellationToken);
Пример #4
0
 public abstract Task<RangeOrPlaceholderRange> Handle(PrepareRenameParams request, CancellationToken cancellationToken);