Browse Source

vslol: fix a few code quality issues.

legacy
Sam Hocevar sam 12 years ago
parent
commit
5c1389ee2d
2 changed files with 10 additions and 8 deletions
  1. +5
    -5
      tools/vslol/MenuGenerateCompilers.cs
  2. +5
    -3
      tools/vslol/VsLol.cs

+ 5
- 5
tools/vslol/MenuGenerateCompilers.cs View File

@@ -1,7 +1,7 @@
//
// Lol Engine - VsLol add-in for Visual Studio
//
// Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
@@ -90,8 +90,8 @@ internal class MenuGenerateCompilers : OleMenuCommand
foreach (Project project in projects)
foreach (ProjectItem item in ParseProjectItems(project))
{
if (item.Name.EndsWith("-scanner.l")
|| item.Name.EndsWith("-parser.y"))
if (item.Name.EndsWith("-scanner.l", StringComparison.CurrentCultureIgnoreCase)
|| item.Name.EndsWith("-parser.y", StringComparison.CurrentCultureIgnoreCase))
Visible = true;
}
}
@@ -217,9 +217,9 @@ internal class MenuGenerateCompilers : OleMenuCommand
if (p.ExitCode != 0)
{
Logger.Info("Error: " + executable + " exited with code " + p.ExitCode + "\n");
if (arguments != "")
if (!string.IsNullOrEmpty(arguments))
Logger.Info("Error: args: " + arguments + "\n");
if (env != "")
if (!string.IsNullOrEmpty(env))
Logger.Info("Error: env: " + env + "\n");
return false;
}


+ 5
- 3
tools/vslol/VsLol.cs View File

@@ -1,7 +1,7 @@
//
// Lol Engine - VsLol add-in for Visual Studio
//
// Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
@@ -48,14 +48,16 @@ public sealed class PluginPackage : Package
{
public PluginPackage()
{
Trace.WriteLine(String.Format("Entering constructor for: {0}", this.ToString()));
Trace.WriteLine(String.Format(CultureInfo.InvariantCulture,
"Entering constructor for: {0}", this.ToString()));
}

[SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.UnmanagedCode)]
protected override void Initialize()
{
// Trace the beginning of this method and call the base implementation.
Trace.WriteLine(String.Format("Entering Initialize() of: {0}", this.ToString()));
Trace.WriteLine(String.Format(CultureInfo.InvariantCulture,
"Entering Initialize() of: {0}", this.ToString()));
base.Initialize();

Logger.Initialize(GetService(typeof(SVsOutputWindow)) as IVsOutputWindow);


Loading…
Cancel
Save