private static bool TryFixUpNearestVisibleSpan( TextManager.Interop.IVsContainedLanguageHost containedLanguageHost, TextManager.Interop.IVsTextBufferCoordinator bufferCoordinator, int originalLine, int originalColumn, out LinePosition adjustedPosition) { // GetNearestVisibleToken gives us the position right at the end of visible span. // Move the position one position to the left so that squiggle can show up on last token. if (originalColumn > 1) { adjustedPosition = new LinePosition(originalLine, originalColumn - 1); return true; } if (originalLine > 1) { TextManager.Interop.IVsTextLines secondaryBuffer; int length; if (VSConstants.S_OK == bufferCoordinator.GetSecondaryBuffer(out secondaryBuffer) && VSConstants.S_OK == secondaryBuffer.GetLengthOfLine(originalLine - 1, out length)) { adjustedPosition = new LinePosition(originalLine - 1, length); return true; } } adjustedPosition = LinePosition.Zero; return false; }