Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bhsubra committed May 21, 2021
1 parent 9172600 commit cca253d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Bicep.LangServer.IntegrationTests/TelemetryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task ValidateDeclarationSnippetCompletionItemContainsCommandWithTel
TelemetryEvent? telemetryEvent = command?.Arguments?.First().ToObject<TelemetryEvent>();

command?.Name.Should().Be(TelemetryConstants.CommandName);
telemetryEvent?.EventName.Should().Be(TelemetryConstants.EventNames.DeclarationSnippetCompletion);
telemetryEvent?.EventName.Should().Be(TelemetryConstants.EventNames.TopLevelDeclarationSnippetInsertion);
telemetryEvent?.Properties?.ContainsKey("label");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private IEnumerable<CompletionItem> GetDeclarationCompletions(BicepCompletionCon
{
{ "label", resourceSnippet.Prefix }
};
TelemetryEvent telemetryEvent = new(TelemetryConstants.EventNames.DeclarationSnippetCompletion, properties);
TelemetryEvent telemetryEvent = new(TelemetryConstants.EventNames.TopLevelDeclarationSnippetInsertion, properties);
Command command = Command.Create(TelemetryConstants.CommandName, telemetryEvent);

yield return CreateContextualSnippetCompletion(resourceSnippet.Prefix,
Expand Down
2 changes: 1 addition & 1 deletion src/Bicep.LangServer/Handlers/BicepTelemetryHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public BicepTelemetryHandler(ITelemetryProvider telemetryProvider)
private static ExecuteCommandRegistrationOptions GetExecuteCommandRegistrationOptions()
=> new ExecuteCommandRegistrationOptions()
{
Commands = new Container<string>("bicep.telemetry")
Commands = new Container<string>(TelemetryConstants.CommandName)
};

public override Task<Unit> Handle(ExecuteCommandParams request, CancellationToken cancellationToken)
Expand Down
3 changes: 1 addition & 2 deletions src/Bicep.LangServer/Telemetry/TelemetryConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ namespace Bicep.LanguageServer.Telemetry
{
public class TelemetryConstants
{
public const string Prefix = "bicep/";
public const string CommandName = "bicep.Telemetry";

public class EventNames
{
public const string DeclarationSnippetCompletion = Prefix + nameof(DeclarationSnippetCompletion);
public const string TopLevelDeclarationSnippetInsertion = nameof(TopLevelDeclarationSnippetInsertion);
}
}
}
3 changes: 1 addition & 2 deletions src/vscode-bicep/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"outFiles": ["${workspaceRoot}/out/src/**/*.js"],
"preLaunchTask": "${defaultBuildTask}",
"env": {
"BICEP_LANGUAGE_SERVER_PATH": "${workspaceRoot}/../Bicep.LangServer/bin/Debug/net5.0/Bicep.LangServer.dll",
"DEBUGTELEMETRY": "verbose"
"BICEP_LANGUAGE_SERVER_PATH": "${workspaceRoot}/../Bicep.LangServer/bin/Debug/net5.0/Bicep.LangServer.dll"
}
},
{
Expand Down

0 comments on commit cca253d

Please sign in to comment.