internal static NameScope GetNameScope([NotNull] this MethodDeclarationSyntax methodDeclaration, [NotNull] SemanticModel semanticModel,
											   bool includeLocals)
		{
			var parameters = methodDeclaration.ParameterList.Parameters.Select(parameter => parameter.Identifier.ValueText);
			var locals = methodDeclaration.Descendants<VariableDeclaratorSyntax>().Select(local => local.Identifier.ValueText);
			var baseSymbols = semanticModel.LookupBaseMembers(methodDeclaration.Body.SpanStart);
			var selfSymbols = semanticModel.LookupSymbols(methodDeclaration.SpanStart);

			var nameScope = new NameScope();
			nameScope.AddRange(parameters);
			nameScope.AddRange(baseSymbols.Select(symbol => symbol.Name));
			nameScope.AddRange(selfSymbols.Select(symbol => symbol.Name));

			if (includeLocals)
				nameScope.AddRange(locals);

			return nameScope;
		}