int GetDisplayPosition() { var pos = Expr.Position; switch (CompilerService) { case HaxeCompilerService.COMPLETION: // locate a . or ( while (pos > 1 && Sci.CharAt(pos - 1) != '.' && Sci.CharAt(pos - 1) != '(') { pos--; } break; case HaxeCompilerService.POSITION: case HaxeCompilerService.USAGE: pos = Sci.WordEndPosition(Sci.CurrentPos, true); // necessary to get results with older versions due to a compiler bug if (haxeVersion.IsOlderThan(new SemVer("3.3.0"))) { pos++; } break; } // account for BOM characters pos += FileHelper.GetEncodingFileInfo(FileName).BomLength; return(pos); }