Skip to content

Commit

Permalink
update libsass + more
Browse files Browse the repository at this point in the history
fix source map comment generation
update to latest libsass
  • Loading branch information
darrenkopp committed Dec 8, 2014
1 parent afaf5ec commit 6fb9913
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 21 deletions.
16 changes: 1 addition & 15 deletions SassyStudio.2012/Integration/LibSass/NSassDocumentCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ public void Compile(FileInfo source, FileInfo output)
if (!string.IsNullOrWhiteSpace(Options.CompilationIncludePaths) && Directory.Exists(Options.CompilationIncludePaths))
includePaths = includePaths.Concat(Options.CompilationIncludePaths.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries));

// make paths relative and with href style slashes
var currentDirectory = Directory.GetCurrentDirectory();
var sourceRelative = source.FullName.Replace(currentDirectory, "").Replace(Path.DirectorySeparatorChar.ToString(), "/");
var mapRelative = (output.FullName + ".map").Replace(currentDirectory, "").Replace(Path.DirectorySeparatorChar.ToString(), "/");

var result = Compiler.CompileFile(sourceRelative, sourceMapPath: mapRelative, sourceComments: DetermineSourceCommentsMode(Options), precision: Options.Precision, additionalIncludePaths: includePaths);
var result = Compiler.CompileFile(source.FullName, sourceMapPath: Options.GenerateSourceMaps ? output.FullName + ".map" : null, includeSourceComments: Options.IncludeSourceComments, precision: Options.Precision, additionalIncludePaths: includePaths);
var css = result.CSS;
var sourceMap = result.SourceMap;
InteropHelper.CheckOut(output.FullName);
Expand All @@ -65,15 +60,6 @@ public void Compile(FileInfo source, FileInfo output)
}
}

private static SourceCommentsMode DetermineSourceCommentsMode(ScssOptions options)
{
return options.GenerateSourceMaps
? SourceCommentsMode.SourceMaps
: options.IncludeSourceComments
? SourceCommentsMode.Default
: SourceCommentsMode.None;
}

private DirectoryInfo DetermineSaveDirectory(FileInfo source)
{
if (string.IsNullOrWhiteSpace(Options.CssGenerationOutputDirectory))
Expand Down
4 changes: 2 additions & 2 deletions SassyStudio.2012/SassyStudio.2012.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@
</Reference>
<Reference Include="LibSass.x86, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\libsassnet.3.0\lib\net40\LibSass.x86.dll</HintPath>
<HintPath>..\packages\libsassnet.3.0.1.1\lib\net40\LibSass.x86.dll</HintPath>
</Reference>
<Reference Include="libsassnet, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\libsassnet.3.0\lib\net40\libsassnet.dll</HintPath>
<HintPath>..\packages\libsassnet.3.0.1.1\lib\net40\libsassnet.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.ComponentModelHost, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
Expand Down
4 changes: 2 additions & 2 deletions SassyStudio.2012/SassyStudioPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
namespace SassyStudio
{
[PackageRegistration(UseManagedResourcesOnly = true)]
[InstalledProductRegistration("#110", "#112", "0.8.9.0", IconResourceID = 400)]
[InstalledProductRegistration("#110", "#112", "0.8.9.1", IconResourceID = 400)]
[GuidAttribute(Guids.guidSassyStudioPkgString)]
[ProvideAutoLoad(UIContextGuids80.SolutionExists)]
[ProvideOptionPage(typeof(ScssOptions), "Sassy Studio", "General", 101, 102, true, new[] { "CSS", "SCSS" })]
[ProvideLanguageService(typeof(ScssLanguageService), "SCSS", 100)]
[ProvideLanguageExtension(typeof(ScssLanguageService), ".scss")]
//[ProvideLanguageExtension(typeof(ScssLanguageService), ".scss")]
public sealed class SassyStudioPackage : Package
{
readonly CancellationTokenSource CancellationTokens = new CancellationTokenSource();
Expand Down
2 changes: 1 addition & 1 deletion SassyStudio.2012/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EcmaScript.Net" version="1.0.1.0" targetFramework="net45" />
<package id="libsassnet" version="3.0" targetFramework="net45" />
<package id="libsassnet" version="3.0.1.1" targetFramework="net45" />
<package id="YUICompressor.NET" version="2.7.0.0" targetFramework="net45" />
</packages>
2 changes: 1 addition & 1 deletion SassyStudio.2012/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="SassyStudio..141b7a26-b79d-4ca0-9102-77e7cc7e0ec8" Version="0.8.9.0" Language="en-US" Publisher="Darren Kopp" />
<Identity Id="SassyStudio..141b7a26-b79d-4ca0-9102-77e7cc7e0ec8" Version="0.8.9.1" Language="en-US" Publisher="Darren Kopp" />
<DisplayName>SassyStudio</DisplayName>
<Description xml:space="preserve">Provides support for sass files in Visual Studio</Description>
<MoreInfo>https://github.com/darrenkopp/SassyStudio</MoreInfo>
Expand Down

0 comments on commit 6fb9913

Please sign in to comment.