diff --git a/BuildTasks.Tester/Program.cs b/BuildTasks.Tester/Program.cs
index f0667465a..2df672900 100644
--- a/BuildTasks.Tester/Program.cs
+++ b/BuildTasks.Tester/Program.cs
@@ -1,11 +1,8 @@
using System;
using System.Collections;
-using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Microsoft.Build.Framework;
namespace WebEssentials.BuildTasks.Tester
diff --git a/BuildTasks/NodeInstaller.cs b/BuildTasks/NodeInstaller.cs
index fea5c2b04..30405d186 100644
--- a/BuildTasks/NodeInstaller.cs
+++ b/BuildTasks/NodeInstaller.cs
@@ -5,11 +5,7 @@
using System.IO.Compression;
using System.Linq;
using System.Net;
-using System.Reflection;
using System.Runtime.CompilerServices;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading;
using System.Threading.Tasks;
using Microsoft.Build.Framework;
using Newtonsoft.Json;
diff --git a/EditorExtensions/CSS/DragDrop/FontDrop.cs b/EditorExtensions/CSS/DragDrop/FontDrop.cs
index f02f66e1a..696ab268d 100644
--- a/EditorExtensions/CSS/DragDrop/FontDrop.cs
+++ b/EditorExtensions/CSS/DragDrop/FontDrop.cs
@@ -1,12 +1,9 @@
using System;
using System.Collections.Generic;
-using System.Collections.Specialized;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Web;
-using System.Windows.Forms;
-using MadsKristensen.EditorExtensions.Images;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Editor.DragDrop;
using Microsoft.VisualStudio.Utilities;
diff --git a/EditorExtensions/CustomDictionary.xml b/EditorExtensions/CustomDictionary.xml
index 382029fd8..bcf8a2718 100644
--- a/EditorExtensions/CustomDictionary.xml
+++ b/EditorExtensions/CustomDictionary.xml
@@ -90,10 +90,11 @@
- XHTML
+ BOM
+ CSS
JSON
JSONLD
- BOM
+ XHTML
diff --git a/EditorExtensions/HTML/DragDrop/HtmlImageDrop.cs b/EditorExtensions/HTML/DragDrop/HtmlImageDrop.cs
index 65ee30698..b6180ddb7 100644
--- a/EditorExtensions/HTML/DragDrop/HtmlImageDrop.cs
+++ b/EditorExtensions/HTML/DragDrop/HtmlImageDrop.cs
@@ -1,13 +1,8 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
-using System.Diagnostics.CodeAnalysis;
-using System.Globalization;
using System.IO;
-using System.Web;
-using MadsKristensen.EditorExtensions.Css;
using MadsKristensen.EditorExtensions.Images;
-using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Editor.DragDrop;
using Microsoft.VisualStudio.Utilities;
@@ -32,7 +27,7 @@ namespace MadsKristensen.EditorExtensions.Html
// but apparently visual studio get confused by content type inheritance or does not
// handle it correcly.
[Order(Before = "DefaultFileDropHandler")]
- [Order(Before = "HtmlViewFileDropHandlerProvider")]
+ [Order(Before = "HtmlViewFileDropHandlerProvider")]
public class MarkdownImageDropHandlerProvider : IDropHandlerProvider
{
public IDropHandler GetAssociatedDropHandler(IWpfTextView wpfTextView)
diff --git a/EditorExtensions/Handlebars/Compilers/HandlebarsCompiler.cs b/EditorExtensions/Handlebars/Compilers/HandlebarsCompiler.cs
index be36ef06e..6d5d5e87a 100644
--- a/EditorExtensions/Handlebars/Compilers/HandlebarsCompiler.cs
+++ b/EditorExtensions/Handlebars/Compilers/HandlebarsCompiler.cs
@@ -21,14 +21,9 @@ protected override string GetPath(string sourceFileName, string targetFileName)
parameters.Add("service", ServiceName);
parameters.Add("sourceFileName", sourceFileName);
parameters.Add("targetFileName", targetFileName);
- parameters.Add("compiledTemplateName", CleanTemplateNameForJs(Path.GetFileNameWithoutExtension(sourceFileName)));
+ parameters.Add("compiledTemplateName", Path.GetFileNameWithoutExtension(sourceFileName).Replace("-", "_"));
return parameters.FlattenParameters();
}
-
- private string CleanTemplateNameForJs(string templateName)
- {
- return templateName.Replace("-", "_");
- }
}
}
diff --git a/EditorExtensions/Images/Commands/PasteImageCommandTarget.cs b/EditorExtensions/Images/Commands/PasteImageCommandTarget.cs
index 11f61df98..d39a34275 100644
--- a/EditorExtensions/Images/Commands/PasteImageCommandTarget.cs
+++ b/EditorExtensions/Images/Commands/PasteImageCommandTarget.cs
@@ -1,16 +1,10 @@
using System;
using System.Drawing;
using System.Drawing.Imaging;
-using System.Globalization;
using System.IO;
using System.Linq;
-using System.Web;
using System.Windows.Forms;
-using MadsKristensen.EditorExtensions.Markdown;
-using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
-using Microsoft.VisualStudio.Text.Editor.DragDrop;
-using Microsoft.VisualStudio.Text.Projection;
using Microsoft.VisualStudio.TextManager.Interop;
using Microsoft.Web.Editor;
@@ -134,8 +128,6 @@ private static async void SaveClipboardImageToFile(IDataObject data, string file
ProjectHelpers.AddFileToActiveProject(fileName);
}
-
-
protected override bool IsEnabled()
{
return true;
diff --git a/EditorExtensions/Images/ImageExtensions.cs b/EditorExtensions/Images/ImageExtensions.cs
index 4ea74e01c..74bfe3fa7 100644
--- a/EditorExtensions/Images/ImageExtensions.cs
+++ b/EditorExtensions/Images/ImageExtensions.cs
@@ -63,9 +63,9 @@ private static string GetFormat(IWpfTextView textView)
foreach (ITextBuffer buffer in buffers)
{
var point = textView.BufferGraph.MapDownToBuffer(
- snapshotPoint,
- PointTrackingMode.Negative,
- buffer,
+ snapshotPoint,
+ PointTrackingMode.Negative,
+ buffer,
PositionAffinity.Predecessor
);
@@ -86,8 +86,8 @@ private static string GetRelativeEncodedUrl(string fileName)
if (activeDocument == null)
return null;
- var baseFolder = activeDocument.FullName;
-
+ var baseFolder = activeDocument.FullName;
+
var result = FileHelpers.RelativePath(baseFolder, fileName);
if (result.Contains("://"))
@@ -149,7 +149,7 @@ public static bool InsertLinkToImageFile(this IWpfTextView textView, string abso
string format = GetFormat(textView);
int position = textView.Caret.Position.BufferPosition.Position;
-
+
string text = string.Format(CultureInfo.InvariantCulture, format, relative, Path.GetFileName(absoluteImageFilePath));
using (WebEssentialsPackage.UndoContext("Insert Image"))
diff --git a/EditorExtensions/Images/Sprite/SpriteGenerator.cs b/EditorExtensions/Images/Sprite/SpriteGenerator.cs
index 9597b27b6..44bcf375f 100644
--- a/EditorExtensions/Images/Sprite/SpriteGenerator.cs
+++ b/EditorExtensions/Images/Sprite/SpriteGenerator.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
+using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
@@ -89,7 +90,7 @@ private static Dictionary GetImages(SpriteDocument sprite)
{
if (!System.IO.File.Exists(file))
{
- Logger.Log(string.Format("The image file {0} for sprite {1} was not found", file, sprite.FileName));
+ Logger.Log(string.Format(CultureInfo.CurrentCulture, "The image file {0} for sprite {1} was not found", file, sprite.FileName));
return null;
}
diff --git a/EditorExtensions/JavaScript/Completion/GruntTaskCompletionSourceProvider.cs b/EditorExtensions/JavaScript/Completion/GruntTaskCompletionSourceProvider.cs
index b5793434f..e4ec37486 100644
--- a/EditorExtensions/JavaScript/Completion/GruntTaskCompletionSourceProvider.cs
+++ b/EditorExtensions/JavaScript/Completion/GruntTaskCompletionSourceProvider.cs
@@ -1,8 +1,4 @@
-using Microsoft.VisualStudio.Language.Intellisense;
-using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Utilities;
-using Newtonsoft.Json.Linq;
-using System;
+using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
@@ -11,6 +7,10 @@
using System.Threading.Tasks;
using System.Windows.Media;
using System.Windows.Media.Imaging;
+using Microsoft.VisualStudio.Language.Intellisense;
+using Microsoft.VisualStudio.Text;
+using Microsoft.VisualStudio.Utilities;
+using Newtonsoft.Json.Linq;
using Intel = Microsoft.VisualStudio.Language.Intellisense;
namespace MadsKristensen.EditorExtensions.JavaScript
diff --git a/EditorExtensions/JavaScript/Linters/JsHintCompiler.cs b/EditorExtensions/JavaScript/Linters/JsHintCompiler.cs
index 1d1617914..f8aa264fd 100644
--- a/EditorExtensions/JavaScript/Linters/JsHintCompiler.cs
+++ b/EditorExtensions/JavaScript/Linters/JsHintCompiler.cs
@@ -38,10 +38,5 @@ protected override string GetPath(string sourceFileName, string targetFileName)
return parameters.FlattenParameters();
}
-
- protected override string PostProcessResult(string result, string targetFileName, string sourceFileName)
- {
- return result;
- }
}
}
diff --git a/EditorExtensions/Markdown/Margin/MarkdownMargin.cs b/EditorExtensions/Markdown/Margin/MarkdownMargin.cs
index ae1c22c82..5f81acdb7 100644
--- a/EditorExtensions/Markdown/Margin/MarkdownMargin.cs
+++ b/EditorExtensions/Markdown/Margin/MarkdownMargin.cs
@@ -78,12 +78,12 @@ public static IEnumerable GetExistingFilesInFolders(string fileName, par
///
private static string ConvertLocalDirectoryPathToUrl(string absoluteOrRelativePath, bool ensureTrailingSlash = true)
{
- if (ensureTrailingSlash && !absoluteOrRelativePath.EndsWith("\\"))
+ if (ensureTrailingSlash && !absoluteOrRelativePath.EndsWith("\\", StringComparison.Ordinal))
absoluteOrRelativePath = absoluteOrRelativePath + "\\";
-
+
return string.Format(
CultureInfo.InvariantCulture,
- "file:///{0}",
+ "file:///{0}",
absoluteOrRelativePath.Replace("\\", "/")
);
}
@@ -298,7 +298,7 @@ protected override FrameworkElement CreatePreviewControl()
_browser.HorizontalAlignment = HorizontalAlignment.Stretch;
// This can be done only once
- _browser.ObjectForScripting = new JavaScriptToManagedConnector((errorMsg, document, line) =>
+ _browser.ObjectForScripting = new JavaScriptToManagedConnector((errorMsg, document, line) =>
{
// Unfortunatly, when the error is in a file other than the main document the errorMsg
// and line are not available.
@@ -306,7 +306,7 @@ protected override FrameworkElement CreatePreviewControl()
// This is another IE "feature" to "protect" you :).
Log("Error in ({0}:{1}): {2}", document, line, errorMsg);
});
-
+
_browser.Navigated += (sender, ev) =>
{
if (!ShouldHandleNavigationEvent(ev))
@@ -315,16 +315,16 @@ protected override FrameworkElement CreatePreviewControl()
var browser = sender as WebBrowser;
InjectJavascriptErrorsRedirection(browser);
};
-
- _browser.LoadCompleted += (sender,ev) =>
+
+ _browser.LoadCompleted += (sender, ev) =>
{
- if (!ShouldHandleNavigationEvent(ev))
+ if (!ShouldHandleNavigationEvent(ev))
return;
var browser = sender as WebBrowser;
RestoreDocumentVerticalPosition(browser);
};
-
+
return _browser;
}
@@ -376,7 +376,7 @@ private static bool ShouldHandleNavigationEvent(System.Windows.Navigation.Naviga
// If the user click on a link in the preview window, @event.Uri is null.
return @event.Uri == null;
}
-
+
///
/// Hook the the DOM onerror event and redirect it to the managed host that
/// will then write it to the visual studio output pane.
@@ -405,7 +405,7 @@ private static void InjectJavascriptErrorsRedirection(WebBrowser browser)
}
}
}
-
+
private static void Log(string format, params object[] args)
{
Logger.Log(string.Format(CultureInfo.InvariantCulture, "[markdown]: " + format, args));
@@ -428,17 +428,20 @@ public InternetExplorerFeatureControlSecurityException()
{
}
- public InternetExplorerFeatureControlSecurityException(string message) : base(message)
+ public InternetExplorerFeatureControlSecurityException(string message)
+ : base(message)
{
}
- public InternetExplorerFeatureControlSecurityException(string message, Exception inner) : base(message, inner)
+ public InternetExplorerFeatureControlSecurityException(string message, Exception inner)
+ : base(message, inner)
{
}
protected InternetExplorerFeatureControlSecurityException(
SerializationInfo info,
- StreamingContext context) : base(info, context)
+ StreamingContext context)
+ : base(info, context)
{
}
}
@@ -449,7 +452,7 @@ protected InternetExplorerFeatureControlSecurityException(
///
internal class InternetExplorerBrowserFeatureControl
{
-
+
private const string InternetExplorerRootKey = @"Software\Microsoft\Internet Explorer";
private const string BrowserEmulationKey = InternetExplorerRootKey + @"\Main\FeatureControl\FEATURE_BROWSER_EMULATION";
private const string BlockCrossProtocolFileNavigation = InternetExplorerRootKey + @"\MAIN\FeatureControl\FEATURE_BLOCK_CROSS_PROTOCOL_FILE_NAVIGATION";
@@ -482,7 +485,7 @@ private enum BrowserEmulationVersion
/// The RegistryKey instance that can be used to access
/// the registry sub key
///
- private static Microsoft.Win32.RegistryKey OpenOrCreateKey(Microsoft.Win32.RegistryKey key,
+ private static Microsoft.Win32.RegistryKey OpenOrCreateKey(Microsoft.Win32.RegistryKey key,
string subkeyName, bool writable)
{
var subKey = key.OpenSubKey(subkeyName, writable);
@@ -514,7 +517,7 @@ private static Microsoft.Win32.RegistryKey OpenOrCreateKey(Microsoft.Win32.Regis
/// execute this operation.
///
private static T UseRegistryKey(
- Microsoft.Win32.RegistryKey key, string subkeyName,
+ Microsoft.Win32.RegistryKey key, string subkeyName,
bool writable, Func useKey
)
{
@@ -530,11 +533,11 @@ private static T UseRegistryKey(
// The user does not have the permissions required to read from the registry key.
throw new InternetExplorerFeatureControlSecurityException(
string.Format(
- CultureInfo.CurrentCulture,
+ CultureInfo.CurrentCulture,
"The current user does not have the rights to open the registry key: '{0}\\{1}'", key, subkeyName),
se
);
-
+
}
catch (UnauthorizedAccessException uaEx)
{
@@ -562,7 +565,7 @@ private static int GetInternetExplorerMajorVersion()
if (separator != -1)
{
if (!int.TryParse(version.Substring(0, separator), out result))
- {
+ {
// Make CodeAnalisys happy :)
result = 0;
}
@@ -696,7 +699,7 @@ public JavaScriptToManagedConnector()
{
}
- public JavaScriptToManagedConnector(Action