in Backend/RiderPlugin/JetBrains.TextTemplating/JetBrains/TextTemplatingEngineHost.cs [136:151]
public object GetService(Type serviceType)
{
if (serviceType == typeof(DTE) || serviceType == typeof(DTE2))
{
if (CachedDteImplementation != null) return CachedDteImplementation;
string rawPort = Environment.GetEnvironmentVariable("T4_ENVDTE_CLIENT_PORT");
if (rawPort == null) return null;
if (!int.TryParse(rawPort, out int port)) return null;
var manager = new ConnectionManager(Lifetime, port);
var implementation = new DteImplementation(manager.Model);
CachedDteImplementation = implementation;
return implementation;
}
return null;
}