private ParseOptions GetParseOptions(DocumentationMode documentationMode, [NotNull] string languageName, OperationFeature operationFeature) { // Bug workaround: Setting DocumentationMode to a non-default value resets Features. ParseOptions optionsWithLostFeatures = languageName == LanguageNames.VisualBasic ? (ParseOptions)DefaultBasicParseOptions.WithDocumentationMode(documentationMode) : DefaultCSharpParseOptions.WithDocumentationMode(documentationMode); return(operationFeature == OperationFeature.Enabled ? optionsWithLostFeatures.WithFeatures(OperationFeatureFlag) : optionsWithLostFeatures); }
private ParseOptions GetParseOptions(DocumentationMode documentationMode, [NotNull] string languageName) { #pragma warning disable AV2310 // Code blocks should not contain inline comments // Bug workaround: Setting DocumentationMode to a non-default value resets Features. #pragma warning restore AV2310 // Code blocks should not contain inline comments ParseOptions optionsWithLostFeatures = languageName == LanguageNames.VisualBasic ? (ParseOptions)DefaultBasicParseOptions.WithDocumentationMode(documentationMode) : DefaultCSharpParseOptions.WithDocumentationMode(documentationMode); return(optionsWithLostFeatures.WithFeatures(OperationFeature)); }
private static ParseOptions GetParseOptionsWithFeatures(ParseOptions parseOptions, XAttribute featuresAttribute) { var entries = featuresAttribute.Value.Split(';'); var features = entries.Select(x => { var split = x.Split('='); var key = split[0]; var value = split.Length == 2 ? split[1] : "true"; return(new KeyValuePair <string, string>(key, value)); }); return(parseOptions.WithFeatures(features)); }
private static ParseOptions GetParseOptionsWithFeatures(ParseOptions parseOptions, XAttribute featuresAttribute) { var entries = featuresAttribute.Value.Split(';'); var features = entries.Select(x => { var split = x.Split('='); var key = split[0]; var value = split.Length == 2 ? split[1] : "true"; return new KeyValuePair<string, string>(key, value); }); return parseOptions.WithFeatures(features); }