From d4095cfc0d255422ff732b9ab1666a830776cdf8 Mon Sep 17 00:00:00 2001 From: Clément Pit--Claudel Date: Thu, 8 Oct 2015 00:56:33 -0400 Subject: Add vsix to releases and fix invalid path separators in packaging script --- package.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) mode change 100644 => 100755 package.py diff --git a/package.py b/package.py old mode 100644 new mode 100755 index 33e83d73..32192822 --- a/package.py +++ b/package.py @@ -1,12 +1,14 @@ +#!/usr/bin/env python3 + from fnmatch import fnmatch from os import path import argparse import json import os import re -import shutil import subprocess import sys +import time import urllib.request import zipfile @@ -53,7 +55,7 @@ DLLs = ["AbsInt", "VCExpr", "VCGeneration"] EXEs = ["Dafny", "DafnyServer"] -ETCs = ["dafny", "DafnyPrelude.bpl", "DafnyRuntime.cs"] +ETCs = ["dafny", "DafnyPrelude.bpl", "DafnyRuntime.cs", "DafnyLanguageService.vsix"] # Constants @@ -112,6 +114,11 @@ class Release: writer.write(reader.read()) flush("done!") + @staticmethod + def zipify_path(fpath): + """Zip entries always use '/' as the path separator.""" + return fpath.replace(os.path.sep, '/') + def pack(self): try: os.remove(self.dafny_zip) @@ -126,16 +133,19 @@ class Release: if any(fnmatch(fname, pattern) for pattern in Z3_INTERESTING_FILES): z3_files_count += 1 contents = Z3_archive.read(fileinfo) - fileinfo.filename = path.join(DAFNY_PACKAGE_PREFIX, Z3_PACKAGE_PREFIX, fname) + fileinfo.filename = Release.zipify_path(path.join(DAFNY_PACKAGE_PREFIX, Z3_PACKAGE_PREFIX, fname)) archive.writestr(fileinfo, contents) for fname in ARCHIVE_FNAMES: fpath = path.join(BINARIES_DIRECTORY, fname) if path.exists(fpath): - fileinfo = zipfile.ZipInfo(fname) + fileinfo = zipfile.ZipInfo(fname, time.localtime(os.stat(fpath).st_mtime)[:6]) if any(fnmatch(fname, pattern) for pattern in UNIX_EXECUTABLES): # http://stackoverflow.com/questions/434641/ fileinfo.external_attr = 0o777 << 16 - archive.write(fpath, path.join(DAFNY_PACKAGE_PREFIX, fname)) + contents = open(fpath, mode='rb').read() + fileinfo.compress_type = zipfile.ZIP_DEFLATED + fileinfo.filename = Release.zipify_path(path.join(DAFNY_PACKAGE_PREFIX, fname)) + archive.writestr(fileinfo, contents) else: missing.append(fname) flush("done! (imported {} files from z3's sources)".format(z3_files_count)) -- cgit v1.2.3 From 7d37934cae1f9372acfa994750616e4ecc21854d Mon Sep 17 00:00:00 2001 From: wuestholz Date: Thu, 8 Oct 2015 12:23:54 -0500 Subject: Make the Dafny extension compile on VS 2015 without any old versions. --- Source/DafnyExtension/DafnyExtension.csproj | 80 ++++++++++++++++------ Source/DafnyExtension/packages.config | 29 ++++++++ .../DafnyExtension/source.extension.vsixmanifest | 3 +- Source/DafnyMenu/DafnyMenu.csproj | 59 ++++++++++++---- Source/DafnyMenu/packages.config | 29 ++++++++ Source/DafnyMenu/source.extension.vsixmanifest | 3 +- 6 files changed, 166 insertions(+), 37 deletions(-) create mode 100644 Source/DafnyExtension/packages.config create mode 100644 Source/DafnyMenu/packages.config diff --git a/Source/DafnyExtension/DafnyExtension.csproj b/Source/DafnyExtension/DafnyExtension.csproj index 3dc67098..f7c7c650 100644 --- a/Source/DafnyExtension/DafnyExtension.csproj +++ b/Source/DafnyExtension/DafnyExtension.csproj @@ -1,4 +1,4 @@ - + 11.0 @@ -106,7 +106,9 @@ ..\..\..\boogie\Binaries\Houdini.dll - + + ..\packages\VSSDK.Language.11.0.4\lib\net45\Microsoft.VisualStudio.Language.Intellisense.dll + ..\..\..\boogie\Binaries\Model.dll @@ -124,23 +126,57 @@ - - - - - - - - - - - - - - - - - + + ..\packages\VSSDK.Shell.Interop.7.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.dll + + + ..\packages\VSSDK.Editor.11.0.4\lib\net45\Microsoft.VisualStudio.Editor.dll + + + ..\packages\VSSDK.ComponentModelHost.11.0.4\lib\net45\Microsoft.VisualStudio.ComponentModelHost.dll + + + ..\packages\VSSDK.Shell.11.11.0.4\lib\net45\Microsoft.VisualStudio.Shell.11.0.dll + + + ..\packages\VSSDK.Shell.Immutable.10.10.0.4\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll + + + ..\packages\VSSDK.OLE.Interop.7.0.4\lib\net20\Microsoft.VisualStudio.OLE.Interop.dll + + + ..\packages\VSSDK.Shell.Interop.11.11.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll + + + ..\packages\VSSDK.Shell.Interop.10.10.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.10.0.dll + + + ..\packages\VSSDK.Shell.Interop.8.8.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.8.0.dll + + + ..\packages\VSSDK.Shell.Interop.9.9.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.9.0.dll + + + ..\packages\VSSDK.CoreUtility.11.0.4\lib\net45\Microsoft.VisualStudio.CoreUtility.dll + + + ..\packages\VSSDK.TextManager.Interop.7.0.4\lib\net20\Microsoft.VisualStudio.TextManager.Interop.dll + + + ..\packages\VSSDK.Text.11.0.4\lib\net45\Microsoft.VisualStudio.Text.Data.dll + + + ..\packages\VSSDK.Text.11.0.4\lib\net45\Microsoft.VisualStudio.Text.Logic.dll + + + ..\packages\VSSDK.Text.11.0.4\lib\net45\Microsoft.VisualStudio.Text.UI.dll + + + ..\packages\VSSDK.Text.11.0.4\lib\net45\Microsoft.VisualStudio.Text.UI.Wpf.dll + + + ..\packages\VSSDK.Language.11.0.4\lib\net45\Microsoft.VisualStudio.Language.StandardClassification.dll + @@ -148,7 +184,6 @@ - @@ -200,6 +235,9 @@ + + Designer + Designer @@ -250,4 +288,4 @@ copy /y "..\Binaries\z3.exe" "$(ProjectDir)" --> - \ No newline at end of file + diff --git a/Source/DafnyExtension/packages.config b/Source/DafnyExtension/packages.config new file mode 100644 index 00000000..60f856c5 --- /dev/null +++ b/Source/DafnyExtension/packages.config @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/DafnyExtension/source.extension.vsixmanifest b/Source/DafnyExtension/source.extension.vsixmanifest index b87e2452..66e4deda 100644 --- a/Source/DafnyExtension/source.extension.vsixmanifest +++ b/Source/DafnyExtension/source.extension.vsixmanifest @@ -7,7 +7,8 @@ Z3-LICENSE.txt - + + diff --git a/Source/DafnyMenu/DafnyMenu.csproj b/Source/DafnyMenu/DafnyMenu.csproj index 503b3d0c..2a222038 100644 --- a/Source/DafnyMenu/DafnyMenu.csproj +++ b/Source/DafnyMenu/DafnyMenu.csproj @@ -62,22 +62,50 @@ - - - + + ..\packages\VSSDK.Editor.11.0.4\lib\net45\Microsoft.VisualStudio.Editor.dll + + + ..\packages\VSSDK.ComponentModelHost.11.0.4\lib\net45\Microsoft.VisualStudio.ComponentModelHost.dll + + + ..\packages\VSSDK.Shell.11.11.0.4\lib\net45\Microsoft.VisualStudio.Shell.11.0.dll + - - - - - - + + ..\packages\VSSDK.OLE.Interop.7.0.4\lib\net20\Microsoft.VisualStudio.OLE.Interop.dll + + + ..\packages\VSSDK.Shell.Interop.11.11.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll + + + ..\packages\VSSDK.Shell.Interop.10.10.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.10.0.dll + + + ..\packages\VSSDK.Shell.Interop.8.8.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.8.0.dll + + + ..\packages\VSSDK.Shell.Interop.9.9.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.9.0.dll + + + ..\packages\VSSDK.CoreUtility.11.0.4\lib\net45\Microsoft.VisualStudio.CoreUtility.dll + - - - - - + + ..\packages\VSSDK.Text.11.0.4\lib\net45\Microsoft.VisualStudio.Text.Data.dll + + + ..\packages\VSSDK.Text.11.0.4\lib\net45\Microsoft.VisualStudio.Text.Logic.dll + + + ..\packages\VSSDK.Text.11.0.4\lib\net45\Microsoft.VisualStudio.Text.UI.dll + + + ..\packages\VSSDK.Text.11.0.4\lib\net45\Microsoft.VisualStudio.Text.UI.Wpf.dll + + + ..\packages\VSSDK.Language.11.0.4\lib\net45\Microsoft.VisualStudio.Language.StandardClassification.dll + @@ -127,6 +155,9 @@ + + Designer + Designer diff --git a/Source/DafnyMenu/packages.config b/Source/DafnyMenu/packages.config new file mode 100644 index 00000000..60f856c5 --- /dev/null +++ b/Source/DafnyMenu/packages.config @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/DafnyMenu/source.extension.vsixmanifest b/Source/DafnyMenu/source.extension.vsixmanifest index 7beeb69e..814374ee 100644 --- a/Source/DafnyMenu/source.extension.vsixmanifest +++ b/Source/DafnyMenu/source.extension.vsixmanifest @@ -6,7 +6,8 @@ This is a menu for interacting with Dafny. - + + -- cgit v1.2.3 From c5094e85c027730aa0ef6466766a8e5c99d83c11 Mon Sep 17 00:00:00 2001 From: wuestholz Date: Thu, 8 Oct 2015 12:26:37 -0500 Subject: DafnyExtension: Fix concurrency issue. --- Source/DafnyExtension/ResolverTagger.cs | 79 ++++++++++++++++----------------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/Source/DafnyExtension/ResolverTagger.cs b/Source/DafnyExtension/ResolverTagger.cs index 22706338..b348e7d6 100644 --- a/Source/DafnyExtension/ResolverTagger.cs +++ b/Source/DafnyExtension/ResolverTagger.cs @@ -189,7 +189,7 @@ namespace DafnyLanguage { get { - return _verificationErrors.Values.Where(ec => ec.RequestId == MostRecentRequestId).SelectMany(ec => ec.Errors.Reverse()); + return _verificationErrors.Values.Where(ec => ec.RequestId == MostRecentRequestId).SelectMany(ec => ec.Errors.Reverse()).ToList(); } } @@ -354,49 +354,46 @@ namespace DafnyLanguage public void UpdateErrorList(ITextSnapshot snapshot) { - lock (this) + if (_errorProvider != null && !m_disposed) { - if (_errorProvider != null && !m_disposed) - { - _errorProvider.SuspendRefresh(); // reduce flickering - _errorProvider.Tasks.Clear(); - foreach (var err in AllErrors) - { - var lineNum = 0; - var columnNum = 0; - if (err.Span != null) { - var span = err.Span.GetSpan(snapshot); - lineNum = snapshot.GetLineNumberFromPosition(span.Start.Position); - var line = snapshot.GetLineFromPosition(span.Start.Position); - columnNum = span.Start - line.Start; - } else { - lineNum = err.Line; - columnNum = err.Column; - } - - ErrorTask task = new ErrorTask() - { - Category = TaskCategory.BuildCompile, - ErrorCategory = CategoryConversion(err.Category), - Text = err.Message, - Line = lineNum, - Column = columnNum - }; - if (err.Filename != null) { - task.Document = err.Filename; - } - else if (_document != null) - { - task.Document = _document.FilePath; - } - if (err.Category != ErrorCategory.ProcessError && err.Category != ErrorCategory.InternalError) - { - task.Navigate += new EventHandler(NavigateHandler); - } - _errorProvider.Tasks.Add(task); + _errorProvider.SuspendRefresh(); // reduce flickering + _errorProvider.Tasks.Clear(); + foreach (var err in AllErrors) + { + var lineNum = 0; + var columnNum = 0; + if (err.Span != null) { + var span = err.Span.GetSpan(snapshot); + lineNum = snapshot.GetLineNumberFromPosition(span.Start.Position); + var line = snapshot.GetLineFromPosition(span.Start.Position); + columnNum = span.Start - line.Start; + } else { + lineNum = err.Line; + columnNum = err.Column; + } + + ErrorTask task = new ErrorTask() + { + Category = TaskCategory.BuildCompile, + ErrorCategory = CategoryConversion(err.Category), + Text = err.Message, + Line = lineNum, + Column = columnNum + }; + if (err.Filename != null) { + task.Document = err.Filename; + } + else if (_document != null) + { + task.Document = _document.FilePath; + } + if (err.Category != ErrorCategory.ProcessError && err.Category != ErrorCategory.InternalError) + { + task.Navigate += new EventHandler(NavigateHandler); } - _errorProvider.ResumeRefresh(); + _errorProvider.Tasks.Add(task); } + _errorProvider.ResumeRefresh(); } var chng = TagsChanged; if (chng != null) -- cgit v1.2.3 From eaf726c56d304e3a9e969112b5f403269a244234 Mon Sep 17 00:00:00 2001 From: wuestholz Date: Thu, 8 Oct 2015 19:42:49 +0200 Subject: DafnyExtension: Re-added assembly reference. --- Source/DafnyExtension/DafnyExtension.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/DafnyExtension/DafnyExtension.csproj b/Source/DafnyExtension/DafnyExtension.csproj index f7c7c650..08040853 100644 --- a/Source/DafnyExtension/DafnyExtension.csproj +++ b/Source/DafnyExtension/DafnyExtension.csproj @@ -184,6 +184,7 @@ + -- cgit v1.2.3