public GotoDefinitionResponse GetGotoDefinitionResponse(GotoDefinitionRequest request) { var res = _bufferParser.ParsedContent(request.Buffer, request.FileName); var loc = new TextLocation(request.Line, request.Column); ResolveResult resolveResult = ResolveAtLocation.Resolve(res.Compilation, res.UnresolvedFile, res.SyntaxTree, loc); var response = new GotoDefinitionResponse(); if (resolveResult != null) { var region = resolveResult.GetDefinitionRegion(); response.FileName = region.FileName == null ? null : region.FileName.LowerCaseDriveLetter().ApplyPathReplacementsForClient(); response.Line = region.BeginLine; response.Column = region.BeginColumn; } return response; }
public GotoDefinitionResponse GetGotoDefinitionResponse(GotoDefinitionRequest request) { var res = _bufferParser.ParsedContent(request.Buffer, request.FileName); var loc = new TextLocation(request.Line, request.Column); ResolveResult resolveResult = ResolveAtLocation.Resolve(res.Compilation, res.UnresolvedFile, res.SyntaxTree, loc); var response = new GotoDefinitionResponse(); if (resolveResult != null) { var region = resolveResult.GetDefinitionRegion(); response.FileName = region.FileName == null ? null : region.FileName.ApplyPathReplacementsForClient(); response.Line = region.BeginLine; response.Column = region.BeginColumn; } return(response); }