Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telemetry #381

Merged
merged 13 commits into from
Aug 26, 2015
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Nodejs/.nuget/NuGet.exe
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Nodejs/NodejsTools.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22823.1
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nodejs", "Product\Nodejs\Nodejs.csproj", "{32EC5259-98DA-40CA-9E2D-1B1B2E966F88}"
ProjectSection(ProjectDependencies) = postProject
Expand Down
9 changes: 7 additions & 2 deletions Nodejs/Prerequisites/DisableSkipVerification.reg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Profiling,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.ProjectWizard,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.TestAdapter,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.VsLogger,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.WebRole,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\NodeTests,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Nodejs.AzurePublishing.Tests.UI,B03F5F7F11D50A3A]
Expand All @@ -32,6 +31,10 @@ Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TestUtilities.Nodejs,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TestUtilities.UI,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TestUtilities.UI.Nodejs,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.11.0,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.12.0,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.14.0,B03F5F7F11D50A3A]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\AnalysisDriver,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\DebuggerTests,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\DebuggerUITests,B03F5F7F11D50A3A]
Expand All @@ -46,7 +49,6 @@ Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Profiling,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.ProjectWizard,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.TestAdapter,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.VsLogger,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.WebRole,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\NodeTests,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Nodejs.AzurePublishing.Tests.UI,B03F5F7F11D50A3A]
Expand All @@ -64,3 +66,6 @@ Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\TestUtilities.Nodejs,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\TestUtilities.UI,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\TestUtilities.UI.Nodejs,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.11.0,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.12.0,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.14.0,B03F5F7F11D50A3A]
4 changes: 3 additions & 1 deletion Nodejs/Prerequisites/DisableSkipVerificationX86.reg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Profiling,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.ProjectWizard,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.TestAdapter,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.VsLogger,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.WebRole,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\NodeTests,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Nodejs.AzurePublishing.Tests.UI,B03F5F7F11D50A3A]
Expand All @@ -32,3 +31,6 @@ Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TestUtilities.Nodejs,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TestUtilities.UI,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TestUtilities.UI.Nodejs,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.11.0,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.12.0,B03F5F7F11D50A3A]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.14.0,B03F5F7F11D50A3A]
9 changes: 7 additions & 2 deletions Nodejs/Prerequisites/EnableSkipVerification.reg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Profiling,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.ProjectWizard,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.TestAdapter,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.VsLogger,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.WebRole,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\NodeTests,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Nodejs.AzurePublishing.Tests.UI,B03F5F7F11D50A3A]
Expand All @@ -32,6 +31,10 @@ Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TestUtilities.Nodejs,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TestUtilities.UI,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TestUtilities.UI.Nodejs,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.11.0,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.12.0,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.14.0,B03F5F7F11D50A3A]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\AnalysisDriver,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\DebuggerTests,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\DebuggerUITests,B03F5F7F11D50A3A]
Expand All @@ -46,7 +49,6 @@ Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Profiling,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.ProjectWizard,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.TestAdapter,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.VsLogger,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.WebRole,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\NodeTests,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Nodejs.AzurePublishing.Tests.UI,B03F5F7F11D50A3A]
Expand All @@ -64,3 +66,6 @@ Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\TestUtilities.Nodejs,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\TestUtilities.UI,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\TestUtilities.UI.Nodejs,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.11.0,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.12.0,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.14.0,B03F5F7F11D50A3A]
4 changes: 3 additions & 1 deletion Nodejs/Prerequisites/EnableSkipVerificationX86.reg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Profiling,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.ProjectWizard,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.TestAdapter,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.VsLogger,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.WebRole,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\NodeTests,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Nodejs.AzurePublishing.Tests.UI,B03F5F7F11D50A3A]
Expand All @@ -32,3 +31,6 @@ Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TestUtilities.Nodejs,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TestUtilities.UI,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TestUtilities.UI.Nodejs,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.11.0,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.12.0,B03F5F7F11D50A3A]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\Microsoft.NodejsTools.Telemetry.14.0,B03F5F7F11D50A3A]
4 changes: 3 additions & 1 deletion Nodejs/Prerequisites/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ var assemblies = [
'Microsoft.NodejsTools.WebRole',
'Microsoft.NodejsTools.Npm',
'Microsoft.NodejsTools.PressAnyKey',
'Microsoft.NodejsTools.VsLogger'
'Microsoft.NodejsTools.Telemetry.11.0',
'Microsoft.NodejsTools.Telemetry.12.0',
'Microsoft.NodejsTools.Telemetry.14.0'
].sort();

var files = [
Expand Down
23 changes: 22 additions & 1 deletion Nodejs/Product/Nodejs/Nodejs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
<OutputSubPath>Node.js</OutputSubPath>
</VSTemplate>
</ItemDefinitionGroup>

<Choose>
<When Condition="'$(VSTarget)' != '11.0' And '$(VSTarget)' != '12.0'">
<ItemGroup>
Expand All @@ -105,6 +104,9 @@
<Reference Include="Microsoft.Build.Utilities.$(MicrosoftBuildAssemblyVersionSuffix), Version=$(MicrosoftBuildAssemblyVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.JScript" />
<Reference Include="Microsoft.NodejsTools.Telemetry">
<HintPath>..\..\Common\Telemetry\Microsoft.NodejsTools.Telemetry.$(VSTarget).dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.ComponentModelHost, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Debugger.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
Expand Down Expand Up @@ -613,6 +615,8 @@
<Compile Include="SmartIndent.cs" />
<Compile Include="SmartIndentProvider.cs" />
<Compile Include="SourceMapping\SourceMap.cs" />
<Compile Include="Telemetry\TelemetryEvents.cs" />
<Compile Include="Telemetry\TelemetryProperties.cs" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these files are going to be shared across projects, they should be included alongside the Telemetry dlls in Nodejs/Common, and then linked to from the individual projects.

<Compile Include="TestFrameworks\TestFrameworkDirectories.cs" />
<Compile Include="VsMenus.cs" />
<Compile Include="AzureSolutionListener.cs" />
Expand Down Expand Up @@ -809,6 +813,23 @@
<ZipProject Include="ProjectTemplates\AddWebSiteAzureExpressApp\Preview.png" />
<ZipProject Include="ProjectTemplates\AzureNodejsApp\Preview.png" />
<ZipProject Include="ProjectTemplates\NodejsConsoleApp\Preview.png" />
<Content Include="..\..\Common\Telemetry\Microsoft.NodejsTools.Telemetry.$(VSTarget).dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
<VSIXSubPath>.</VSIXSubPath>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: fix the indentation here and below too (spaces, not tabs)

</Content>
<Content Include="..\..\packages\Microsoft.ApplicationInsights.1.2.0\lib\net45\Microsoft.ApplicationInsights.dll">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No better place to put this - why is .nuget/nuget.exe being checked into the project?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm, as we discussed - didn't realize it was replacing with a new version

<Link>Microsoft.ApplicationInsights.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
<VSIXSubPath>.</VSIXSubPath>
</Content>
<Content Include="..\..\packages\Microsoft.ApplicationInsights.PersistenceChannel.1.2.0\lib\net45\Microsoft.ApplicationInsights.PersistenceChannel.dll">
<Link>Microsoft.ApplicationInsights.PersistenceChannel.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
<VSIXSubPath>.</VSIXSubPath>
</Content>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be conditional for VS versions?

<Content Include="Credits.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
Expand Down
23 changes: 22 additions & 1 deletion Nodejs/Product/Nodejs/NodejsPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
using Microsoft.NodejsTools.Options;
using Microsoft.NodejsTools.Project;
using Microsoft.NodejsTools.Repl;
using Microsoft.NodejsTools.Telemetry;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.ComponentModelHost;
using Microsoft.VisualStudio.Debugger.Interop;
Expand Down Expand Up @@ -106,6 +107,7 @@ internal sealed partial class NodejsPackage : CommonPackage {
private LanguagePreferences _langPrefs;
internal VsProjectAnalyzer _analyzer;
private NodejsToolsLogger _logger;
private ITelemetryLogger _telemetryLogger;

/// <summary>
/// Default constructor of the package.
Expand Down Expand Up @@ -228,7 +230,9 @@ protected override void Initialize() {
IntellisenseOptionsPage.AnalysisLogMaximumChanged += IntellisenseOptionsPage_AnalysisLogMaximumChanged;

InitializeLogging();


InitializeTelemetry();

// The variable is inherited by child processes backing Test Explorer, and is used in
// the NTVS test discoverer and test executor to connect back to VS.
Environment.SetEnvironmentVariable(NodejsConstants.NodeToolsProcessIdEnvironmentVariable, Process.GetCurrentProcess().Id.ToString());
Expand All @@ -248,6 +252,17 @@ private void InitializeLogging() {
_logger.LogEvent(NodejsToolsLogEvent.AnalysisLevel, IntellisenseOptionsPage.AnalysisLevel);
}

private void InitializeTelemetry() {
if (_telemetryLogger == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null check is unnecessary because it's always null here.

var thisAssembly = typeof(NodejsPackage).Assembly;

// Get telemetry logger
_telemetryLogger = TelemetrySetup.Instance.GetLogger(thisAssembly);

TelemetrySetup.Instance.LogPackageLoad(_telemetryLogger, Guid.Parse(Guids.NodejsPackageString), thisAssembly, Application.ProductVersion);
}
}

public new IComponentModel ComponentModel {
get {
return this.GetComponentModel();
Expand All @@ -260,6 +275,12 @@ internal NodejsToolsLogger Logger {
}
}

internal ITelemetryLogger TelemetryLogger {
get {
return _telemetryLogger;
}
}

/// <summary>
/// Makes the debugger context available - this enables our debugger when we're installed into
/// a SKU which doesn't support every installed debugger.
Expand Down
12 changes: 9 additions & 3 deletions Nodejs/Product/Nodejs/Project/ImportWizard/ImportSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using System.Threading.Tasks;
using System.Windows;
using System.Xml;
using Microsoft.NodejsTools.Telemetry;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudioTools;

Expand Down Expand Up @@ -208,10 +209,13 @@ public Task<string> CreateRequestedProjectAsync() {
bool excludeNodeModules = ExcludeNodeModules;
return Task.Factory.StartNew<string>(() => {
bool success = false;
Guid projectGuid;
try {
using (var writer = GetDefaultWriter(projectPath)) {
WriteProjectXml(writer, projectPath, sourcePath, filters, startupFile, excludeNodeModules );
WriteProjectXml(writer, projectPath, sourcePath, filters, startupFile, excludeNodeModules, out projectGuid);
}
// Log telemetry
NodejsPackage.Instance.TelemetryLogger.ReportEvent(TelemetryEvents.ProjectImported, TelemetryProperties.ProjectGuid, projectGuid.ToString("B"));
success = true;
return projectPath;
} finally {
Expand Down Expand Up @@ -248,9 +252,11 @@ internal static void WriteProjectXml(
string sourcePath,
string filters,
string startupFile,
bool excludeNodeModules
bool excludeNodeModules,
out Guid projectGuid
) {
var projectHome = CommonUtils.GetRelativeDirectoryPath(Path.GetDirectoryName(projectPath), sourcePath);
projectGuid = Guid.NewGuid();

writer.WriteStartDocument();
writer.WriteStartElement("Project", "http://schemas.microsoft.com/developer/msbuild/2003");
Expand All @@ -264,7 +270,7 @@ bool excludeNodeModules
writer.WriteEndElement();

writer.WriteElementString("SchemaVersion", "2.0");
writer.WriteElementString("ProjectGuid", Guid.NewGuid().ToString("B"));
writer.WriteElementString("ProjectGuid", projectGuid.ToString("B"));
writer.WriteElementString("ProjectHome", projectHome);
writer.WriteElementString("ProjectView", "ShowAllFiles");

Expand Down
24 changes: 24 additions & 0 deletions Nodejs/Product/Nodejs/Telemetry/TelemetryEvents.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//*********************************************************//
// Copyright (c) Microsoft. All rights reserved.
//
// Apache 2.0 License
//
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied. See the License for the specific language governing
// permissions and limitations under the License.
//
//*********************************************************//

namespace Microsoft.NodejsTools.Telemetry {
/// <summary>
/// Telemetry event names
/// </summary>
public static class TelemetryEvents {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be internal

public const string ProjectImported = "ProjectImported";
}
}
Loading