Skip to content

Commit 1b44714

Browse files
author
Paul van Brenk
committed
Fix telemetry in Repl Window and PR feedback
1 parent b7ced9e commit 1b44714

File tree

16 files changed

+46
-104
lines changed

16 files changed

+46
-104
lines changed

Common/Product/ReplWindow/Repl/ReplWindow.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using Microsoft.VisualStudio.OLE.Interop;
2222
using Microsoft.VisualStudio.Shell;
2323
using Microsoft.VisualStudio.Shell.Interop;
24+
using Microsoft.VisualStudio.Telemetry;
2425
using Microsoft.VisualStudio.Text;
2526
using Microsoft.VisualStudio.Text.Classification;
2627
using Microsoft.VisualStudio.Text.Editor;
@@ -181,6 +182,15 @@ public ReplWindow(IComponentModel/*!*/ model, IReplEvaluator/*!*/ evaluator, ICo
181182

182183
#region Initialization
183184

185+
protected override void Initialize()
186+
{
187+
ThreadHelper.ThrowIfNotOnUIThread();
188+
base.Initialize();
189+
190+
//ensure Telemetry is initialized
191+
var defaultSession = TelemetryService.DefaultSession;
192+
}
193+
184194
protected override void OnCreate()
185195
{
186196
CreateTextViewHost();

Nodejs/Product/InteractiveWindow/InteractiveWindow.csproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,27 @@
4242
<Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
4343
<EmbedInteropTypes>True</EmbedInteropTypes>
4444
</Reference>
45+
<Reference Include="Microsoft.Diagnostics.Tracing.EventSource, Version=1.1.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
46+
<HintPath>..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.28\lib\net46\Microsoft.Diagnostics.Tracing.EventSource.dll</HintPath>
47+
<Private>True</Private>
48+
</Reference>
49+
<Reference Include="Microsoft.VisualStudio.RemoteControl, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
50+
<HintPath>..\..\packages\Microsoft.VisualStudio.RemoteControl.14.0.262-masterA5CACE98\lib\net45\Microsoft.VisualStudio.RemoteControl.dll</HintPath>
51+
<Private>True</Private>
52+
</Reference>
53+
<Reference Include="Microsoft.VisualStudio.Telemetry, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
54+
<HintPath>..\..\packages\Microsoft.VisualStudio.Telemetry.15.3.795-master67D3E818\lib\net45\Microsoft.VisualStudio.Telemetry.dll</HintPath>
55+
<Private>True</Private>
56+
</Reference>
4557
<Reference Include="Microsoft.VisualStudio.Utilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
58+
<Reference Include="Microsoft.VisualStudio.Utilities.Internal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
59+
<HintPath>..\..\packages\Microsoft.VisualStudio.Utilities.Internal.14.0.73-master6E8F6515\lib\net45\Microsoft.VisualStudio.Utilities.Internal.dll</HintPath>
60+
<Private>True</Private>
61+
</Reference>
62+
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
63+
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
64+
<Private>True</Private>
65+
</Reference>
4666
<Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
4767
<EmbedInteropTypes>True</EmbedInteropTypes>
4868
</Reference>

Nodejs/Product/InteractiveWindow/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
[assembly: AssemblyConfiguration("")]
1111

1212
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.InteractiveWindow", CodeBase = "Microsoft.NodejsTools.InteractiveWindow.dll", Version = "1.0.0.0")]
13-
[assembly: NeutralResourcesLanguage("en", UltimateResourceFallbackLocation.Satellite)]
1413
[assembly: InternalsVisibleTo("TestUtilities.UI, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
1514
[assembly: InternalsVisibleTo("ReplWindowUITests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
1615
[assembly: InternalsVisibleTo("Nodejs.Tests.UI, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="MicroBuild.Core" version="0.2.0" targetFramework="net46" developmentDependency="true" />
4+
<package id="Microsoft.Diagnostics.Tracing.EventSource.Redist" version="1.1.28" targetFramework="net46" />
5+
<package id="Microsoft.VisualStudio.RemoteControl" version="14.0.262-masterA5CACE98" targetFramework="net46" />
6+
<package id="Microsoft.VisualStudio.Telemetry" version="15.3.795-master67D3E818" targetFramework="net46" />
7+
<package id="Microsoft.VisualStudio.Utilities.Internal" version="14.0.73-master6E8F6515" targetFramework="net46" />
8+
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net46" />
49
</packages>

Nodejs/Product/Nodejs/Nodejs.csproj

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
<Language>JavaScript</Language>
5050
<VSIXSubpath>ItemTemplates</VSIXSubpath>
5151
</ZipItem>
52-
<VSTemplate>
52+
<!--<VSTemplate>
5353
<Language>JavaScript</Language>
5454
<Culture>1033</Culture>
5555
<OutputSubPath>Node.js</OutputSubPath>
56-
</VSTemplate>
56+
</VSTemplate>-->
5757
</ItemDefinitionGroup>
5858
<ItemGroup>
5959
<Reference Include="Microsoft.ApplicationInsights, Version=2.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -648,7 +648,6 @@
648648
<ZipItem Include="Templates\Files\TypeScriptTapeUnitTest\UnitTest.ts" />
649649
<ZipItem Include="Templates\Files\TypeScriptTsConfig\tsconfig.json" />
650650
<ZipItem Include="Templates\Files\TypeScriptTsConfig\tsconfig.vstemplate" />
651-
<None Include="app.config" />
652651
<TypeScriptProject Include="ProjectTemplates\TypeScriptExpressApp\express-serve-static-core.typings.json" />
653652
<TypeScriptProject Include="ProjectTemplates\TypeScriptExpressApp\express.typings.json" />
654653
<TypeScriptProject Include="ProjectTemplates\TypeScriptExpressApp\serve-static.typings.json" />
@@ -808,7 +807,6 @@
808807
<ZipItem Include="Templates\Files\TypeScriptUnitTest\UnitTest.vstemplate">
809808
<SubType>Designer</SubType>
810809
</ZipItem>
811-
<None Include="Theme\Microsoft.NodejsTools.theme.v14.0.pkgdef" />
812810
<None Include="Theme\Microsoft.NodejsTools.theme.v15.0.pkgdef" />
813811
<Resource Include="version.txt" />
814812
<Content Include="VSTemplateStore.pkgdef">
@@ -1042,9 +1040,6 @@
10421040
<RegisterWithCodebase>true</RegisterWithCodebase>
10431041
</PropertyGroup>
10441042
<PropertyGroup>
1045-
<!--<IsProductComponent>true</IsProductComponent>
1046-
<ExtensionInstallationRoot>Extensions</ExtensionInstallationRoot>
1047-
<ExtensionInstallationFolder>Microsoft\NodeJsTools\NodeJsTools</ExtensionInstallationFolder>-->
10481043
<CreateVsixContainer>false</CreateVsixContainer>
10491044
<CopyVsixExtensionFiles>false</CopyVsixExtensionFiles>
10501045
</PropertyGroup>

Nodejs/Product/Nodejs/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
[assembly: ComVisible(false)]
1818
[assembly: CLSCompliant(false)]
19-
[assembly: NeutralResourcesLanguage("en", UltimateResourceFallbackLocation.Satellite)]
2019
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools", CodeBase = "Microsoft.NodejsTools.dll", Version = "1.0.0.0")]
2120
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.Npm", CodeBase = "Microsoft.NodejsTools.Npm.dll", Version = "1.0.0.0")]
2221
[assembly: ProvideCodeBase(AssemblyName = "Microsoft.NodejsTools.PressAnyKey", CodeBase = "Microsoft.NodejsTools.PressAnyKey.exe", Version = "1.0.0.0")]

Nodejs/Product/Nodejs/Telemetry/TelemetryHelper.cs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,25 @@
22

33
using Microsoft.VisualStudio.Shell;
44
using Microsoft.VisualStudio.Telemetry;
5+
using static Microsoft.NodejsTools.Telemetry.TelemetryEvents;
6+
using static Microsoft.NodejsTools.Telemetry.TelemetryProperties;
57

68
namespace Microsoft.NodejsTools.Telemetry
79
{
8-
using System;
9-
using static TelemetryEvents;
10-
using static TelemetryProperties;
11-
1210
/// <summary>
1311
/// Extensions for logging telemetry events.
1412
/// </summary>
1513
internal static class TelemetryHelper
1614
{
17-
private static TelemetrySession defaultSession;
18-
1915
public static void Initialize()
2016
{
2117
ThreadHelper.ThrowIfNotOnUIThread();
22-
defaultSession = TelemetryService.DefaultSession;
18+
var defaultSession = TelemetryService.DefaultSession;
2319
}
2420

2521
public static void LogProjectImported()
2622
{
27-
defaultSession.PostUserTask(ProjectImported, TelemetryResult.Success);
23+
TelemetryService.DefaultSession.PostUserTask(ProjectImported, TelemetryResult.Success);
2824
}
2925

3026
public static void LogDebuggingStarted(string debuggerName, string nodeVersion, bool isProject = true)
@@ -34,27 +30,27 @@ public static void LogDebuggingStarted(string debuggerName, string nodeVersion,
3430
userTask.Properties[NodeVersion] = nodeVersion;
3531
userTask.Properties[IsProject] = isProject;
3632

37-
defaultSession.PostEvent(userTask);
33+
TelemetryService.DefaultSession.PostEvent(userTask);
3834
}
3935

4036
public static void LogSearchNpm()
4137
{
42-
defaultSession.PostUserTask(SearchNpm, TelemetryResult.Success);
38+
TelemetryService.DefaultSession.PostUserTask(SearchNpm, TelemetryResult.Success);
4339
}
4440

4541
public static void LogInstallNpmPackage()
4642
{
47-
defaultSession.PostUserTask(InstallNpm, TelemetryResult.Success);
43+
TelemetryService.DefaultSession.PostUserTask(InstallNpm, TelemetryResult.Success);
4844
}
4945

5046
public static void LogUnInstallNpmPackage()
5147
{
52-
defaultSession.PostUserTask(UnInstallNpm, TelemetryResult.Success);
48+
TelemetryService.DefaultSession.PostUserTask(UnInstallNpm, TelemetryResult.Success);
5349
}
5450

5551
public static void LogReplUse()
5652
{
57-
defaultSession.PostUserTask(UsedRepl, TelemetryResult.Success);
53+
TelemetryService.DefaultSession.PostUserTask(UsedRepl, TelemetryResult.Success);
5854
}
5955
}
6056
}

Nodejs/Product/Nodejs/Theme/Microsoft.NodejsTools.theme.v14.0.pkgdef

Lines changed: 0 additions & 6 deletions
This file was deleted.

Nodejs/Product/Nodejs/app.config

Lines changed: 0 additions & 31 deletions
This file was deleted.

Nodejs/Product/Npm/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
// to COM components. If you need to access a type in this assembly from
1717
// COM, set the ComVisible attribute to true on that type.
1818
[assembly: ComVisible(false)]
19-
[assembly: NeutralResourcesLanguage("en", UltimateResourceFallbackLocation.Satellite)]
2019
// The following GUID is for the ID of the typelib if this project is exposed to COM
2120
[assembly: Guid("38de5856-defe-4dac-ab7b-43e5a733cfe5")]
2221

0 commit comments

Comments
 (0)