/// <summary> /// Creates a <see cref="TranslationStrategyBase"/>. /// </summary> /// <param name="configurationSource">Source for the configuration that should be used.</param> /// <param name="templatingEngine">Engine to use for loading templates.</param> /// <param name="documentationSource">Source for looking up documentation comments for members.</param> /// <param name="logger">Logger to use for writing log messages.</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="templatingEngine"/> or <paramref name="documentationSource"/> or <paramref name="logger"/> is null.</exception> protected TranslationStrategyBase(IConfigurationSource configurationSource, ITemplatingEngine templatingEngine, IDocumentationSource documentationSource, ILogger logger) { if (configurationSource == null) { throw new ArgumentNullException(nameof(configurationSource)); } _templatingEngine = templatingEngine ?? throw new ArgumentNullException(nameof(templatingEngine)); _documentationSource = documentationSource ?? throw new ArgumentNullException(nameof(documentationSource)); Logger = logger ?? throw new ArgumentNullException(nameof(logger)); TypeReferenceTranslator = new DefaultTypeReferenceTranslator(configurationSource, logger); DecoratorTranslator = new DecoratorTranslator(configurationSource); Configuration = configurationSource.GetSection <TranspilationConfiguration>() ?? TranspilationConfiguration.Default; }
public CompletionSource(IDocumentationSource docSource, ServerSettings.PythonCompletionOptions completionSettings, IServiceContainer services) { _itemSource = new CompletionItemSource(docSource, completionSettings); _services = services; }
public HoverSource(IDocumentationSource docSource) { _docSource = docSource; }
/// <summary> /// Creates a <see cref="EnumDefinitionTranslator"/>. /// </summary> /// <param name="configurationSource">Source for the configuration that should be used.</param> /// <param name="templatingEngine">Engine to use for loading templates.</param> /// <param name="documentationSource">Source for looking up documentation comments for members.</param> /// <param name="logger">Logger to use for writing log messages.</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="templatingEngine"/> or <paramref name="documentationSource"/> or <paramref name="logger"/> is null.</exception> public EnumDefinitionTranslationStrategy(IConfigurationSource configurationSource, ITemplatingEngine templatingEngine, IDocumentationSource documentationSource, ILogger logger) : base(configurationSource, templatingEngine, documentationSource, logger) { }
/// <summary> /// Creates a <see cref="DefaultTypeDefinitionTranslator"/>. /// </summary> /// <param name="configurationSource">Source for the configuration that should be used.</param> /// <param name="templatingEngine">Engine to use for loading templates.</param> /// <param name="documentationSource">Source for looking up documentation comments for members.</param> /// <param name="logger">Logger to use for writing log messages.</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="templatingEngine"/> or <paramref name="documentationSource"/> or <paramref name="logger"/> is null.</exception> public DefaultTypeDefinitionTranslator(IConfigurationSource configurationSource, ITemplatingEngine templatingEngine, IDocumentationSource documentationSource, ILogger logger) { if (configurationSource == null) { throw new ArgumentNullException(nameof(configurationSource)); } if (templatingEngine == null) { throw new ArgumentNullException(nameof(templatingEngine)); } if (documentationSource == null) { throw new ArgumentNullException(nameof(documentationSource)); } _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _strategies = new ITypeDefinitionTranslationStrategy[] { new ClassDefinitionTranslationStrategy(configurationSource, templatingEngine, documentationSource, logger), new InterfaceDefinitionTranslationStrategy(configurationSource, templatingEngine, documentationSource, logger), new EnumDefinitionTranslationStrategy(configurationSource, templatingEngine, documentationSource, logger) }; }
/// <summary> /// Creates a <see cref="ClassDefinitionTranslationStrategy"/>. /// </summary> /// <param name="configurationSource">Source for the configuration that should be used.</param> /// <param name="templatingEngine">Engine to use for loading templates.</param> /// <param name="documentationSource">Source for looking up documentation comments for members.</param> /// <param name="logger">Logger to use for writing log messages.</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="templatingEngine"/> or <paramref name="documentationSource"/> or <paramref name="logger"/> is null.</exception> public ClassDefinitionTranslationStrategy(IConfigurationSource configurationSource, ITemplatingEngine templatingEngine, IDocumentationSource documentationSource, ILogger logger) : base(configurationSource, templatingEngine, documentationSource, logger) { _defaultValueProvider = new DefaultValueProvider(configurationSource, logger, TypeReferenceTranslator); }
public CompletionSource(IDocumentationSource docSource, ServerSettings.PythonCompletionOptions completionSettings) { _itemSource = new CompletionItemSource(docSource, completionSettings); }
public CompletionItemSource(IDocumentationSource docSource, ServerSettings.PythonCompletionOptions options) { _docSource = docSource; Options = options; }
public SignatureSource(IDocumentationSource docSource, bool labelOffsetSupport = true) { _docSource = docSource; // TODO: deprecate eventually. _labelOffsetSupport = labelOffsetSupport; // LSP 3.14.0+ }
/// <summary> /// Initializes a new <see cref="ModelDocumentationUpdater"/>. /// </summary> /// <param name="documentationSource">The documentation source</param> public ModelDocumentationUpdater(IDocumentationSource documentationSource) { _documentationSource = documentationSource; }
public SignatureSource(IDocumentationSource docSource) { _docSource = docSource; }