//		List<string> GetUsedNamespaces ()
        //		{
        //			var scope = CSharpUnresolvedFile.GetUsingScope (document.Editor.Caret.Location);
        //			var result = new List<string> ();
        //			while (scope != null) {
        //				result.Add (scope.NamespaceName);
        //				var ctx = CSharpUnresolvedFile.GetResolver (Document.Compilation, scope.Region.Begin);
        //				foreach (var u in scope.Usings) {
        //					var ns = u.ResolveNamespace (ctx);
        //					if (ns == null)
        //						continue;
        //					result.Add (ns.FullName);
        //				}
        //				scope = scope.Parent;
        //			}
        //			return result;
        //		}
        public override async Task <int> GetCurrentParameterIndex(int startOffset, CancellationToken token)
        {
            var analysisDocument = DocumentContext.AnalysisDocument;
            var caretOffset      = Editor.CaretOffset;

            if (analysisDocument == null || startOffset > caretOffset)
            {
                return(-1);
            }
            var partialDoc = analysisDocument.WithFrozenPartialSemantics(token);
            var result     = await ParameterUtil.GetCurrentParameterIndex(partialDoc, startOffset, caretOffset, token).ConfigureAwait(false);

            return(result.ParameterIndex);
        }