diff --git a/PRIVACY.md b/PRIVACY.md
index c80e06d156..33cdcdd6c7 100644
--- a/PRIVACY.md
+++ b/PRIVACY.md
@@ -1,7 +1,6 @@
# Privacy
-The code in this repository contains features that may enable you and Microsoft to collect data from users of the applications.
-The data collection is disabled by default but can be enabled by setting the corresponding flag upon compilation.
+The code in this repository contains features that may enable you and Microsoft to collect data from users of the applications. Data collection is disabled by default but can be enabled by setting the corresponding flag upon compilation.
## Data Collection
diff --git a/build/Set-VersionNumbers.ps1 b/build/Set-VersionNumbers.ps1
new file mode 100644
index 0000000000..597a120cf5
--- /dev/null
+++ b/build/Set-VersionNumbers.ps1
@@ -0,0 +1,55 @@
+param(
+ [string]
+ $AssemblyVersion = $Env:ASSEMBLY_VERSION,
+
+ [string]
+ $SemverVersion = $Env:SEMVER_VERSION,
+
+ [string]
+ $NuGetVersion = $Env:NUGET_VERSION,
+
+ [string]
+ $VsixVersion = $Env:VSIX_VERSION,
+
+ [switch]
+ $EnableTelemetry
+);
+
+if ("$AssemblyVersion".Trim().Length -eq 0) {
+ $Date = Get-Date;
+ $Year = $Date.Year.ToString().Substring(2);
+ $Month = $Date.Month.ToString().PadLeft(2, "0");
+ $Hour = (Get-Date).Hour.ToString().PadLeft(2, "0");
+ $Minute = (Get-Date).Minute.ToString().PadLeft(2, "0");
+ $AssemblyVersion = "0.0.$Year$Month.$Hour$Minute";
+}
+
+if ("$SemverVersion".Trim().Length -eq 0) {
+ $pieces = "$AssemblyVersion".split(".");
+ $SemverVersion = "$($pieces[0]).$($pieces[1]).$($pieces[2])$($pieces[3])";
+}
+
+if ("$NuGetVersion".Trim().Length -eq 0) {
+ $NuGetVersion = "$AssemblyVersion-alpha";
+}
+
+if ("$VsixVersion".Trim().Length -eq 0) {
+ $VsixVersion = "$AssemblyVersion";
+}
+
+Get-ChildItem -Recurse *.v.template `
+ | ForEach-Object {
+ $Source = $_.FullName;
+ $Target = $Source.Substring(0, $Source.Length - 11);
+ Write-Verbose "Replacing ASSEMBLY_VERSION with $AssemblyVersion in $Source and writing to $Target.";
+ Get-Content $Source `
+ | ForEach-Object {
+ $_.
+ Replace("#ASSEMBLY_VERSION#", $AssemblyVersion).
+ Replace("#NUGET_VERSION#", $NuGetVersion).
+ Replace("#VSIX_VERSION#", $VsixVersion).
+ Replace("#SEMVER_VERSION#", $SemverVersion).
+ Replace("#ENABLE_TELEMETRY#", $EnableTelemetry.IsPresent.ToString().ToLower())
+ } `
+ | Set-Content $Target -NoNewline
+ }
\ No newline at end of file
diff --git a/build/bootstrap.cmd b/build/bootstrap.cmd
index e6eca1385a..1859e70843 100644
--- a/build/bootstrap.cmd
+++ b/build/bootstrap.cmd
@@ -6,7 +6,7 @@ dotnet --info || GOTO missingDotnet
git --version || GOTO missingGit
:: Set Build number on all files that uses it
-CALL build\setVersionNumber.cmd
+call powershell -NoProfile build\Set-VersionNumbers.ps1
:: Initialize the compiler's nuspec file
CALL :nuspecBootstrap
diff --git a/build/setVersionNumber.cmd b/build/setVersionNumber.cmd
deleted file mode 100644
index 96041b66f8..0000000000
--- a/build/setVersionNumber.cmd
+++ /dev/null
@@ -1,29 +0,0 @@
-::
-:: This script finds all *.v.template files and replaces
-:: their build tokens (e.g: #NUGET_VERSION#) with a valid value
-:: based on the MAJOR.MINOR.BUILDNUMBER
-::
-SET DATE=%date:~12,2%%date:~4,2%
-SET TIME=%time:~0,2%%time:~3,2%
-IF "%BUILD_MAJOR%" == "" SET BUILD_MAJOR=0
-IF "%BUILD_MINOR%" == "" SET BUILD_MINOR=0
-IF "%BUILD_BUILDNUMBER%" == "" SET BUILD_BUILDNUMBER=%BUILD_MAJOR%.%BUILD_MINOR%.%DATE%.%TIME%
-
-SET REVISION=%BUILD_BUILDNUMBER:~-9%
-IF "%REVISION:~0,1%" == "." SET REVISION=%REVISION:~1%
-
-IF "%ASSEMBLY_VERSION%" == "" SET ASSEMBLY_VERSION=%BUILD_MAJOR%.%BUILD_MINOR%.%REVISION%
-IF "%VSIX_VERSION%" == "" SET VSIX_VERSION=%ASSEMBLY_VERSION%
-IF "%PYTHON_VERSION%" == "" SET PYTHON_VERSION=%ASSEMBLY_VERSION%a1
-IF "%SEMVER_VERSION%" == "" SET SEMVER_VERSION=%BUILD_MAJOR%.%BUILD_MINOR%.%REVISION:.=%
-IF "%NUGET_VERSION%" == "" SET NUGET_VERSION=%VSIX_VERSION%-alpha
-
-FOR /R %%F IN (*.v.template) DO CALL :updateOne %%F
-GOTO :done
-
-:updateOne
-set original=%1
-SET target=%original:~0,-11%
-powershell -NoProfile -Command "(Get-Content %original% -Raw) | ForEach-Object { $_.replace('#ASSEMBLY_VERSION#', '%ASSEMBLY_VERSION%').replace('#NUGET_VERSION#', '%NUGET_VERSION%').replace('#VSIX_VERSION#', '%VSIX_VERSION%').replace('#SEMVER_VERSION#', '%SEMVER_VERSION%') } | Set-Content %target% -NoNewline"
-
-:done
diff --git a/src/ProjectTemplates/.gitignore b/src/ProjectTemplates/.gitignore
new file mode 100644
index 0000000000..ac85e53be1
--- /dev/null
+++ b/src/ProjectTemplates/.gitignore
@@ -0,0 +1,3 @@
+Quantum.App1/Quantum.App1.csproj
+Quantum.Library1/Quantum.Library1.csproj
+Quantum.Test1/Quantum.Test1.csproj
\ No newline at end of file
diff --git a/src/QsCompiler/CommandLineTool/QsCommandLineTool.csproj b/src/QsCompiler/CommandLineTool/QsCommandLineTool.csproj
index c8b9cb6e0f..70b9484144 100644
--- a/src/QsCompiler/CommandLineTool/QsCommandLineTool.csproj
+++ b/src/QsCompiler/CommandLineTool/QsCommandLineTool.csproj
@@ -4,7 +4,7 @@
qsc
Microsoft Q# compiler command line tool.
- netcoreapp2.2
+ netcoreapp2.1
Exe
diff --git a/src/QsCompiler/LanguageServer/QsLanguageServer.csproj b/src/QsCompiler/LanguageServer/QsLanguageServer.csproj
index 1874d19fc2..9e9b88c808 100644
--- a/src/QsCompiler/LanguageServer/QsLanguageServer.csproj
+++ b/src/QsCompiler/LanguageServer/QsLanguageServer.csproj
@@ -3,7 +3,7 @@
Microsoft.Quantum.QsLanguageServer
- netcoreapp2.2
+ netcoreapp2.1
Exe
diff --git a/src/QsCompiler/Tests.Compiler/Tests.Compiler.fsproj b/src/QsCompiler/Tests.Compiler/Tests.Compiler.fsproj
index d7216c5ef2..f81328128a 100644
--- a/src/QsCompiler/Tests.Compiler/Tests.Compiler.fsproj
+++ b/src/QsCompiler/Tests.Compiler/Tests.Compiler.fsproj
@@ -1,7 +1,7 @@
- netcoreapp2.2
+ netcoreapp2.1
false
Tests.Microsoft.Quantum.QsCompiler
Library
diff --git a/src/QsCompiler/Tests.DocGenerator/Tests.DocGenerator.csproj b/src/QsCompiler/Tests.DocGenerator/Tests.DocGenerator.csproj
index fe5bf88a38..c08adf6c0c 100644
--- a/src/QsCompiler/Tests.DocGenerator/Tests.DocGenerator.csproj
+++ b/src/QsCompiler/Tests.DocGenerator/Tests.DocGenerator.csproj
@@ -1,7 +1,7 @@
- netcoreapp2.2
+ netcoreapp2.1
false
Microsoft.Quantum.QsCompiler.Documentation.Testing
Tests.Microsoft.Quantum.QsDocumentationParser
diff --git a/src/QsCompiler/Tests.LanguageServer/Tests.LanguageServer.csproj b/src/QsCompiler/Tests.LanguageServer/Tests.LanguageServer.csproj
index ddb6cf37bc..9457a6c960 100644
--- a/src/QsCompiler/Tests.LanguageServer/Tests.LanguageServer.csproj
+++ b/src/QsCompiler/Tests.LanguageServer/Tests.LanguageServer.csproj
@@ -1,7 +1,7 @@
- netcoreapp2.2
+ netcoreapp2.1
false
Tests.Microsoft.Quantum.QsLanguageServer
Library
diff --git a/src/VSCodeExtension/BUILDING.md b/src/VSCodeExtension/BUILDING.md
index 175ca4f679..0343d23120 100644
--- a/src/VSCodeExtension/BUILDING.md
+++ b/src/VSCodeExtension/BUILDING.md
@@ -20,17 +20,16 @@ After doing so, `vsce` can be used from the command line.
## Steps ##
-Building the VS Code extension follows in a few main steps:
+Building the VS Code extension requires the following steps:
-- Setting up the Solid build itself.
+- Setting up the build pre-requisites (see below for details).
- Installing all Node.js dependencies required by the extension.
- Compiling the language server and copying its assemblies into `bin/`.
- Compiling the TypeScript for the extension itself.
This step is automatically invoked when debugging the extension from within VS Code.
-To set up the Solid build, we require at a minimum that `package.json` was successfully created from `package.json.v.template`.
-This is necessary as `package.json` specifies all of the dependencies which must be installed in order for the TypeScript comprising the VS Code extension to successfully compile and run.
-Typically, `package.json` is created from `package.json.v.template` by running `setVersionNumber.cmd` from the root folder of the Solid repository.
+To set up the build pre-requisites, we require to run `build/bootstrap.cmd` from the root folder of the repository.
+This in particular creates `package.json` from `package.json.v.template`, which specifies all of the dependencies that must be installed in order for the TypeScript comprising the VS Code extension to successfully compile and run.
Once `package.json` exists, Node.js dependencies can be installed:
@@ -48,7 +47,7 @@ vsce package
## Debugging ##
-As an alternative to using `vsce package` to produce an installable VSIX, the VS Code extension can be run in an experimental instance of VS Code.
+As an alternative to using `vsce package` to produce an installable VSIX, the VS Code extension can be run in an experimental instance of VS Code.
To do so, make sure that you have run the build procedure above through to calling `Build-Dependencies.ps1`.
Then, from the Debug tab in VS Code, ensure that "Extension" is selected in the Debug target menu and press the green ‣.
@@ -67,8 +66,8 @@ Change back to the "Extension" debugger and resume.
## Common Problems ##
-### semver Issues ###
+### Semver Issues ###
You may see an error when packaging or debugging the VS Code extension indicating that the package is not semver compatible.
-This indicates that `setVersionNumber.cmd` did not produce a SemVer 2.0–compatible version number when writing `package.json` from `package.json.v.template`, typically due to a mis-set environment variable.
-If this happens, correct the environment variables used by `setVersionNumber.cmd` or manually edit the `version` property of `package.json` (note that any such manual edits **will** be overwritten by calls to `setVersionNumber.cmd` and will not be saved in the repo).
\ No newline at end of file
+This indicates that the build script `Set-VersionNumbers.ps1` did not produce a SemVer 2.0–compatible version number when writing `package.json` from `package.json.v.template`, typically due to a mis-set environment variable.
+If this happens, correct the environment variables used by `Set-VersionNumbers.ps1` or manually edit the `version` property of `package.json` (note that any such manual edits **will** be overwritten by calls to `Set-VersionNumbers.ps1` and will not be saved in the repo).
\ No newline at end of file
diff --git a/src/VSCodeExtension/Build-Dependencies.ps1 b/src/VSCodeExtension/Build-Dependencies.ps1
index ba38b3cbdc..3e82bba363 100644
--- a/src/VSCodeExtension/Build-Dependencies.ps1
+++ b/src/VSCodeExtension/Build-Dependencies.ps1
@@ -1,3 +1,6 @@
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License.
+
param(
[string]
$Configuration = $null,
@@ -6,7 +9,7 @@ param(
$Force
)
-$TargetMoniker = "netcoreapp2.2";
+$TargetMoniker = "netcoreapp2.1";
$LanguageServerRoot = Resolve-Path "../QsCompiler/LanguageServer/";
# If we're not given a configuration, try to populate from an enviromnent variable.
diff --git a/src/VSCodeExtension/CHANGELOG.md b/src/VSCodeExtension/CHANGELOG.md
deleted file mode 100644
index e680ccbefd..0000000000
--- a/src/VSCodeExtension/CHANGELOG.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# Change Log
-
-## 0.3.1810.2508-preview
-
-- Language server integration, including problem highlighting and hover information
-- Updated syntax highlighting and snippets to Q# 0.3
-- Warning raised when .NET Core SDK is missing
-
-## 0.2.18022202
-- Initial release
diff --git a/src/VSCodeExtension/language-configuration.json b/src/VSCodeExtension/language-configuration.json
index 3e703a5507..8498d242eb 100644
--- a/src/VSCodeExtension/language-configuration.json
+++ b/src/VSCodeExtension/language-configuration.json
@@ -6,16 +6,19 @@
// symbols used as brackets
"brackets": [
["[", "]"],
- ["(", ")"]
+ ["(", ")"],
+ ["{", "}"]
],
// symbols that are auto closed when typing
"autoClosingPairs": [
["[", "]"],
- ["(", ")"]
+ ["(", ")"],
+ ["{", "}"]
],
// symbols that that can be used to surround a selection
"surroundingPairs": [
["[", "]"],
- ["(", ")"]
+ ["(", ")"],
+ ["{", "}"]
]
}
\ No newline at end of file
diff --git a/src/VSCodeExtension/package.json.v.template b/src/VSCodeExtension/package.json.v.template
index de07c8aec6..a8cad49587 100644
--- a/src/VSCodeExtension/package.json.v.template
+++ b/src/VSCodeExtension/package.json.v.template
@@ -98,5 +98,6 @@
},
"repository": {},
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
- "requiredDotNetCoreSDK": "2.1.0"
+ "requiredDotNetCoreSDK": "2.1.0",
+ "enableTelemetry" : #ENABLE_TELEMETRY#
}
\ No newline at end of file
diff --git a/src/VSCodeExtension/src/dotnet.ts b/src/VSCodeExtension/src/dotnet.ts
index 12f47c5044..9ba0c11f21 100644
--- a/src/VSCodeExtension/src/dotnet.ts
+++ b/src/VSCodeExtension/src/dotnet.ts
@@ -1,3 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
'use strict';
// IMPORTS /////////////////////////////////////////////////////////////////////
diff --git a/src/VSCodeExtension/src/extension.ts b/src/VSCodeExtension/src/extension.ts
index c1b64d9715..357ef56db0 100644
--- a/src/VSCodeExtension/src/extension.ts
+++ b/src/VSCodeExtension/src/extension.ts
@@ -1,3 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
'use strict';
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
diff --git a/src/VSCodeExtension/src/packageInfo.ts b/src/VSCodeExtension/src/packageInfo.ts
index 188602a0a3..36dee748e7 100644
--- a/src/VSCodeExtension/src/packageInfo.ts
+++ b/src/VSCodeExtension/src/packageInfo.ts
@@ -1,3 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
'use strict';
// IMPORTS /////////////////////////////////////////////////////////////////////
@@ -11,6 +14,7 @@ export interface IPackageInfo {
version: string;
aiKey: string;
requiredDotNetCoreSDK: string;
+ enableTelemetry: string;
}
export function getPackageInfo(context: vscode.ExtensionContext): IPackageInfo | undefined {
@@ -20,7 +24,8 @@ export function getPackageInfo(context: vscode.ExtensionContext): IPackageInfo |
name: extensionPackage.name,
version: extensionPackage.version,
aiKey: extensionPackage.aiKey,
- requiredDotNetCoreSDK: extensionPackage.requiredDotNetCoreSDK
+ requiredDotNetCoreSDK: extensionPackage.requiredDotNetCoreSDK,
+ enableTelemetry: extensionPackage.enableTelemetry
};
}
return;
diff --git a/src/VSCodeExtension/src/telemetry.ts b/src/VSCodeExtension/src/telemetry.ts
index 95e61b2e7e..a65170be72 100644
--- a/src/VSCodeExtension/src/telemetry.ts
+++ b/src/VSCodeExtension/src/telemetry.ts
@@ -1,3 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
import * as vscode from 'vscode';
import { getPackageInfo } from './packageInfo';
import TelemetryReporter from 'vscode-extension-telemetry';
@@ -10,7 +13,7 @@ export class Reporter extends vscode.Disposable {
constructor(ctx: vscode.ExtensionContext) {
super(() => reporter.dispose());
let packageInfo = getPackageInfo(ctx);
- if (packageInfo !== undefined) {
+ if (packageInfo !== undefined && packageInfo.enableTelemetry) {
reporter = new TelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey);
}
}
@@ -38,7 +41,7 @@ export function startTelemetry(context: vscode.ExtensionContext) {
context.subscriptions.push(new Reporter(context));
// Send initial events.
- reporter.sendTelemetryEvent(EventNames.activate, {}, {});
+ if (reporter) reporter.sendTelemetryEvent(EventNames.activate, {}, {});
}
export function sendTelemetryTiming(
@@ -57,7 +60,7 @@ export function sendTelemetryTiming(
measurements["elapsedTime"] = elapsedTime;
- reporter.sendTelemetryEvent(eventName, properties, measurements);
+ if (reporter) reporter.sendTelemetryEvent(eventName, properties, measurements);
return returnValue;
@@ -154,5 +157,5 @@ export function forwardServerTelemetry(telemetryRequest : any) {
}
// TODO: pass more than just the event name.
- sendTelemetryEvent(name, properties, measurements);
+ sendTelemetryEvent(name, properties, measurements);
}
diff --git a/src/VSCodeExtension/src/tests/extension.test.ts b/src/VSCodeExtension/src/tests/extension.test.ts
index a7a297f7c9..006c6b10cf 100644
--- a/src/VSCodeExtension/src/tests/extension.test.ts
+++ b/src/VSCodeExtension/src/tests/extension.test.ts
@@ -1,7 +1,8 @@
-//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
// Note: This example test is leveraging the Mocha test framework.
// Please refer to their documentation on https://mochajs.org/ for help.
-//
// The module 'assert' provides assertion methods from node
import * as assert from 'assert';
diff --git a/src/VSCodeExtension/src/tests/index.ts b/src/VSCodeExtension/src/tests/index.ts
index 9fa2ea0d14..8c84fa0c56 100644
--- a/src/VSCodeExtension/src/tests/index.ts
+++ b/src/VSCodeExtension/src/tests/index.ts
@@ -1,6 +1,6 @@
-//
-// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
-//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
// This file is providing the test runner to use when running extension tests.
// By default the test runner in use is Mocha based.
//
diff --git a/src/VSCodeExtension/vsc-extension-quickstart.md b/src/VSCodeExtension/vsc-extension-quickstart.md
deleted file mode 100644
index 68a618aa0d..0000000000
--- a/src/VSCodeExtension/vsc-extension-quickstart.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Welcome to your VS Code Extension
-
-## What's in the folder
-* This folder contains all of the files necessary for your extension
-* `package.json` - this is the manifest file in which you declare your language support and define
-the location of the grammar file that has been copied into you extension.
-* `syntaxes/qsharp.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization
-* `language-configuration.json` - this the language configuration, defining the tokens that are used for
-comments and brackets.
-
-## Get up and running straight away
-* Make sure the language configuration settings in `language-configuration.json` are accurate
-* press `F5` to open a new window with your extension loaded
-* create a new file with a file name suffix matching your language
-* verify that syntax highlight works and that the language configuration settings are working
-
-## Make changes
-* you can relaunch the extension from the debug toolbar after making changes to the files listed above
-* you can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes
-
-## Add more language features
-* To add features such as intellisense, hovers and validators check out the VS Code extenders documentation at
-https://code.visualstudio.com/docs
-
-## Install your extension
-* To start using your extension with Visual Studio Code copy it into the `/.vscode/extensions` folder and restart Code.
-* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.
\ No newline at end of file
diff --git a/src/VisualStudioExtension/QsharpAppTemplate/Driver.cs b/src/VisualStudioExtension/QsharpAppTemplate/Driver.cs
index 0e6be4f8b0..fb29945fe9 100644
--- a/src/VisualStudioExtension/QsharpAppTemplate/Driver.cs
+++ b/src/VisualStudioExtension/QsharpAppTemplate/Driver.cs
@@ -1,5 +1,4 @@
using System;
-
using Microsoft.Quantum.Simulation.Core;
using Microsoft.Quantum.Simulation.Simulators;
diff --git a/src/VisualStudioExtension/QsharpLanguageClient/QsContentTypeDefinition.cs b/src/VisualStudioExtension/QsharpLanguageClient/QsContentTypeDefinition.cs
index 4d5558bf49..b7bfa3faee 100644
--- a/src/VisualStudioExtension/QsharpLanguageClient/QsContentTypeDefinition.cs
+++ b/src/VisualStudioExtension/QsharpLanguageClient/QsContentTypeDefinition.cs
@@ -1,4 +1,7 @@
-using Microsoft.VisualStudio.LanguageServer.Client;
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using Microsoft.VisualStudio.LanguageServer.Client;
using Microsoft.VisualStudio.Utilities;
using System.ComponentModel.Composition;
diff --git a/src/VisualStudioExtension/QsharpLanguageClient/QsLanguageClient.cs b/src/VisualStudioExtension/QsharpLanguageClient/QsLanguageClient.cs
index 5834789bac..af3d7b3dd3 100644
--- a/src/VisualStudioExtension/QsharpLanguageClient/QsLanguageClient.cs
+++ b/src/VisualStudioExtension/QsharpLanguageClient/QsLanguageClient.cs
@@ -1,4 +1,7 @@
-using System;
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Diagnostics;
diff --git a/src/VisualStudioExtension/QsharpLanguageClient/Telemetry.cs b/src/VisualStudioExtension/QsharpLanguageClient/Telemetry.cs
index 9423fc0d1c..c9eedd88b6 100644
--- a/src/VisualStudioExtension/QsharpLanguageClient/Telemetry.cs
+++ b/src/VisualStudioExtension/QsharpLanguageClient/Telemetry.cs
@@ -1,4 +1,7 @@
-using System;
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
@@ -36,11 +39,14 @@ public static string PrefixProperty(string propName)
return $"{PUBLISHER}.{EXTENSION}.{propName?.ToLowerInvariant()}";
}
- /// Sends the telemetry event for the event with the given name and properties.
+ /// Does nothing unless the corresponding flag is defined upon compilation.
+ /// If the telemetry flag is defined upon compilation,
+ /// sends the telemetry event for the event with the given name and properties.
/// Ignores any properties where the key is null or "version" (case insensitive).
/// Adds the version of the extension assembly as version.
public static void SendEvent(string name, IEnumerable> props = null)
{
+#if TELEMETRY
props = props ?? Enumerable.Empty>();
var evt = new TelemetryEvent(PrefixEventName(name));
foreach (var entry in props.Where(p => !string.IsNullOrEmpty(p.Key)))
@@ -52,6 +58,7 @@ public static void SendEvent(string name, IEnumerable
diff --git a/src/VisualStudioExtension/QsharpVSIX/QsharpVSIX.csproj b/src/VisualStudioExtension/QsharpVSIX/QsharpVSIX.csproj
index def14f0c47..b29802b242 100644
--- a/src/VisualStudioExtension/QsharpVSIX/QsharpVSIX.csproj
+++ b/src/VisualStudioExtension/QsharpVSIX/QsharpVSIX.csproj
@@ -19,8 +19,8 @@
Microsoft.Quantum.VisualStudio
Microsoft.Quantum.VisualStudio.Extension
Microsoft.Quantum.Development.Kit-$(AssemblyVersion).vsix
- ..\..\QsCompiler\LanguageServer\bin\$(Configuration)\netcoreapp2.2\publish\
- ..\..\QsCompiler\LanguageServer\bin\$(Configuration)\netcoreapp2.2\
+ ..\..\QsCompiler\LanguageServer\bin\$(Configuration)\netcoreapp2.1\publish\
+ ..\..\QsCompiler\LanguageServer\bin\$(Configuration)\netcoreapp2.1\
v3
true