emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/csharp-mode 5ecae8b 099/459: Add support for devenv com


From: ELPA Syncer
Subject: [elpa] externals/csharp-mode 5ecae8b 099/459: Add support for devenv compilation-output.
Date: Sun, 22 Aug 2021 13:59:04 -0400 (EDT)

branch: externals/csharp-mode
commit 5ecae8b91a741bab6ea19d8cc9d1235c01ca5f04
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>

    Add support for devenv compilation-output.
---
 README.org                                |  2 +-
 csharp-mode-tests.el                      | 39 +++++++++++++++++++++----------
 csharp-mode.el                            | 16 +++++++++++--
 test-files/devenv-error.txt               | 25 ++++++++++++++++++++
 test-files/devenv-mixed-error.txt         | 39 +++++++++++++++++++++++++++++++
 test-files/msbuild-concurrent-error.txt   |  2 +-
 test-files/msbuild-concurrent-warning.txt |  2 +-
 test-files/msbuild-error.txt              |  2 +-
 test-files/xbuild-error.txt               |  2 +-
 9 files changed, 110 insertions(+), 19 deletions(-)

diff --git a/README.org b/README.org
index 9d5e112..85d07d9 100644
--- a/README.org
+++ b/README.org
@@ -20,7 +20,7 @@ This is a mode for editing C# in emacs. It's based on 
cc-mode, v5.30.3 and above
 - automagic code-doc generation when you type three slashes.
 - intelligent insertion of matched pairs of curly braces.
 - imenu indexing of C# source, for easy menu-based navigation. 
-- compilation-mode support for msbuild and xbuild.
+- compilation-mode support for msbuild, devenv and xbuild.
 
 ** Usage
 
diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el
index d78a5ae..0d113b4 100644
--- a/csharp-mode-tests.el
+++ b/csharp-mode-tests.el
@@ -79,6 +79,19 @@
              ("./test-files/xbuild-error.txt" 
,csharp-compilation-re-xbuild-error 2
               ,(list-repeat-once
                 
'("/Users/jesseblack/Dropbox/barfapp/ConsoleApplication1/ClassLibrary1/Folder/Class1.cs")))
+             ("./test-files/devenv-error.txt" 
,csharp-compilation-re-xbuild-error 3
+              ,(list-repeat-once
+                
'("c:\\working_chad\\dev_grep\\build_grep_database\\databaseconnection.cpp"
+                  
"c:\\working_chad\\dev_grep\\build_grep_database\\databaseconnection.cpp"
+                  
"c:\\working_chad\\dev_grep\\build_grep_database\\databaseconnection.cpp")))
+             ("./test-files/devenv-error.txt" 
,csharp-compilation-re-xbuild-warning 1
+              ,(list-repeat-once
+                
'("c:\\working_chad\\dev_grep\\build_grep_database\\databaseconnection.cpp")))
+             ("./test-files/devenv-mixed-error.txt" 
,csharp-compilation-re-xbuild-error 3
+              ,(list-repeat-once
+                
'("c:\\inservice\\systemtesting\\operationsproxy\\operationsproxy.cpp"
+                  
"c:\\inservice\\systemtesting\\operationsproxy\\operationsproxy.cpp"
+                  
"c:\\inservice\\systemtesting\\operationsproxy\\operationsproxy.cpp")))
              ))
 
     (let* ((file-name (car test-case))
@@ -87,10 +100,13 @@
            (matched-file-names (cadddr test-case))
            (find-file-hook '()) ;; avoid vc-mode file-hooks when opening!
            (buffer (find-file-read-only file-name)))
+      (message (concat "Testing compilation-log: " file-name)) 
       (dotimes (number times)
-        (re-search-forward regexp)
-        (should
-         (equal (nth number matched-file-names) (match-string 1))))
+        (let* ((expected (nth number matched-file-names)))
+          (message (concat "- Expecting match: " expected))
+          (re-search-forward regexp)
+          (should
+           (equal expected (match-string 1)))))
       (kill-buffer buffer))))
 
 (ert-deftest imenu-parsing-supports-default-values ()
@@ -101,18 +117,17 @@
              ;; should support strings
              ("(string a, string b = \"quoted string\")" "(string, string)")
              ("(string a = \"quoted string\", string b)" "(string, string)")
-            ;; should support chars
+             ;; should support chars
              ("(char a, char b = 'b')"                   "(char, char)")
              ("(char a = 'a', char b)"                   "(char, char)")
-            ;; should support self-object-access
-            ("(object o = Const)"                       "(object)")
-            ;; should support other-object-access
-            ("(object o = ConstObject.Const)"           "(object)")
-            ))
+             ;; should support self-object-access
+             ("(object o = Const)"                       "(object)")
+             ;; should support other-object-access
+             ("(object o = ConstObject.Const)"           "(object)")
+             ))
     (let* ((test-value     (car test-case))
-          (expected-value (cadr test-case))
-          (result         (csharp--imenu-remove-param-names-from-paramlist 
test-value)))
+           (expected-value (cadr test-case))
+           (result         (csharp--imenu-remove-param-names-from-paramlist 
test-value)))
       (should (equal expected-value result)))))
 
 ;;(ert-run-tests-interactively t)
-
diff --git a/csharp-mode.el b/csharp-mode.el
index dc3101d..d87a4f5 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -4027,16 +4027,28 @@ The return value is meaningless, and is ignored by 
cc-mode.
    "warning [[:alnum:]]+: [^[\r\n]+\\[\\([^]\r\n]+\\)\\]$")
   "Regexp to match compilation warning from msbuild.")
 
+;; Notes on xbuild and devenv commonalities
+;;
+;; These regexes were tailored for xbuild, but apart from the concurrent
+;; build-marker ("1>") they share exactly the same match-markers.
+;;
+;; If we don't exclude the match-markers explicitly, these regexes
+;; will also be used to match for devenv as well, including the build-marker
+;; in the file-name, causing the lookup to fail.
+;;
+;; So if we don't want devenv to fail, we actually need to handle it in our
+;; xbuild-regexes, but then we automatically get devenv-support for free.
+
 (defconst csharp-compilation-re-xbuild-error
   (concat
-   "^[[:blank:]]*"
+   "^[[:blank:]]*\\(?:[[:digit:]]+>\\)?"
    "\\([^(\r\n)]+\\)(\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)?): "
    "error [[:alnum:]]+: .+$")
   "Regexp to match compilation error from xbuild.")
 
 (defconst csharp-compilation-re-xbuild-warning
   (concat
-   "^[[:blank:]]*"
+   "^[[:blank:]]*\\(?:[[:digit:]]+>\\)?"
    "\\([^(\r\n)]+\\)(\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)?): "
    "warning [[:alnum:]]+: .+$")
   "Regexp to match compilation warning from xbuild.")
diff --git a/test-files/devenv-error.txt b/test-files/devenv-error.txt
new file mode 100644
index 0000000..8cf2ebb
--- /dev/null
+++ b/test-files/devenv-error.txt
@@ -0,0 +1,25 @@
+-- mode: compilation; default-directory: "~/" --
+Compilation started at Mon Jul 13 14:26:40
+
+"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.com" 
C:\working_chad\dev_grep\build_grep_database\build_grep_database.sln /build 
Debug
+
+Microsoft (R) Microsoft Visual Studio 2012 Version 11.0.61030.0.
+Copyright (C) Microsoft Corp. All rights reserved.
+1>------ Build started: Project: build_grep_database, Configuration: Release 
Win32 ------
+1>Build started 7/13/2015 2:26:41 PM.
+1>InitializeBuildStatus:
+1> Creating "Release\build_grep_database.unsuccessfulbuild" because 
"AlwaysCreate" was specified.
+1>ClCompile:
+1> All outputs are up-to-date.
+1> DatabaseConnection.cpp
+1>c:\working_chad\dev_grep\build_grep_database\databaseconnection.cpp(18): 
error C2059: syntax error : 'bad suffix on number'
+1>c:\working_chad\dev_grep\build_grep_database\databaseconnection.cpp(18): 
error C2146: syntax error : missing ';' before identifier 'dsfsdf'
+1>c:\working_chad\dev_grep\build_grep_database\databaseconnection.cpp(18): 
error C2065: 'dsfsdf' : undeclared identifier
+1>c:\working_chad\dev_grep\build_grep_database\databaseconnection.cpp(97): 
warning C4244: 'return' : conversion from 'my_ulonglong' to 'long', possible 
loss of data
+1>
+1>Build FAILED.
+1>
+1>Time Elapsed 00:00:00.77
+========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
+
+Compilation exited abnormally with code 1 at Mon Jul 13 14:26:42
diff --git a/test-files/devenv-mixed-error.txt 
b/test-files/devenv-mixed-error.txt
new file mode 100644
index 0000000..8e6e4e8
--- /dev/null
+++ b/test-files/devenv-mixed-error.txt
@@ -0,0 +1,39 @@
+-*- mode: compilation; default-directory: "~/" -*-
+Compilation started at Mon Jul 13 16:25:02
+
+"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.com"
+C:\inservice\SystemTesting\SystemTesting.sln /build Debug
+
+Microsoft (R) Microsoft Visual Studio 2012 Version 11.0.61030.0.
+Copyright (C) Microsoft Corp. All rights reserved.
+1>------ Build started: Project: OperateDevice_Proxy, Configuration: Debug x86 
------
+2>------ Build started: Project: OperationsProxy, Configuration: Debug Win32 
------
+2>Build started 7/13/2015 4:25:05 PM.
+2>InitializeBuildStatus:
+2>  Touching ".\Debug\OperationsProxy.unsuccessfulbuild".
+2>ClCompile:
+2>  OperationsProxy.cpp
+1>Build started 7/13/2015 4:25:05 PM.
+1>GenerateTargetFrameworkMonikerAttribute:
+1>Skipping target "GenerateTargetFrameworkMonikerAttribute" because all
+output files are up-to-date with respect to the input files.
+1>CoreCompile:
+1>  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig 
/nowarn:1701,1702,2008 /nostdlib+ /platform:x86 /errorreport:prompt /warn:4 
/define:DEBUG;TRACE /errorendlocation /preferreduilang:en-US /highentropyva+ 
/reference:C:\cad\bin\CADBase.dll /reference:C:\cad\bin\CADCore.dll 
/reference:C:\cad\bin\IPSProvider.dll /reference:C:\cad\bin\IPSUtil.dll 
/reference:"C:\Program Files (x86)\Reference 
Assemblies\Microsoft\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll" 
/reference:"C: [...]
+1>C:\inservice\SystemTesting\OperateDeviceProxy\OperateDevice_Proxy\Program.cs(101,9,101,17):
 error CS0201: Only assignment, call, increment, decrement, await, and new 
object expressions can be used as a statement
+1>C:\inservice\SystemTesting\OperateDeviceProxy\OperateDevice_Proxy\Program.cs(101,9,101,10):
 error CS0012: The type 
'System.Data.Entity.Core.Objects.DataClasses.EntityObject' is defined in an 
assembly that is not referenced. You must add a reference to assembly 
'EntityFramework, Version=6.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089'.
+1>C:\inservice\SystemTesting\OperateDeviceProxy\OperateDevice_Proxy\Program.cs(101,11,101,17):
 error CS1061: 'int' does not contain a definition for 'sfddsf' and no 
extension method 'sfddsf' accepting a first argument of type 'int' could be 
found (are you missing a using directive or an assembly reference?)
+1>C:\inservice\SystemTesting\OperateDeviceProxy\OperateDevice_Proxy\Program.cs(321,30,321,31):
 warning CS0168: The variable 'e' is declared but never used
+1>
+1>Build FAILED.
+1>
+1>Time Elapsed 00:00:00.28
+2>c:\inservice\systemtesting\operationsproxy\operationsproxy.cpp(54): error 
C2059: syntax error : 'bad suffix on number'
+2>c:\inservice\systemtesting\operationsproxy\operationsproxy.cpp(54): error 
C2146: syntax error : missing ';' before identifier 'sdfsdf'
+2>c:\inservice\systemtesting\operationsproxy\operationsproxy.cpp(54): error 
C2065: 'sdfsdf' : undeclared identifier
+2>
+2>Build FAILED.
+2>
+2>Time Elapsed 00:00:02.49
+========== Build: 0 succeeded, 2 failed, 15 up-to-date, 0 skipped ==========
+
+Compilation exited abnormally with code 1 at Mon Jul 13 16:25:08
diff --git a/test-files/msbuild-concurrent-error.txt 
b/test-files/msbuild-concurrent-error.txt
index 7c160c2..3f863b1 100644
--- a/test-files/msbuild-concurrent-error.txt
+++ b/test-files/msbuild-concurrent-error.txt
@@ -1,4 +1,4 @@
--*- mode: compilation; default-directory: "~/Documents/Visual Studio 
2015/Projects/ConsoleApplication3/ConsoleApplication3/" -*-
+-*- mode: compilation; default-directory: "~/" -*-
 Compilation started at Mon Apr 20 01:44:35
 
 bash -c "for m in *akefile; do break; done; if [[ ${m} != \"*akefile\" ]]; 
then PATH=\"${PATH}:/c/Program Files (x86)/MSBuild/14.0/Bin:/c/Program 
Files/Emacs/bin\" make; else set -o pipefail; 'c:/Program Files 
(x86)/MSBuild/14.0/Bin/MSBuild.exe' //m; fi"
diff --git a/test-files/msbuild-concurrent-warning.txt 
b/test-files/msbuild-concurrent-warning.txt
index 4f702f4..a20ac63 100644
--- a/test-files/msbuild-concurrent-warning.txt
+++ b/test-files/msbuild-concurrent-warning.txt
@@ -1,4 +1,4 @@
--*- mode: compilation; default-directory: "~/Documents/Visual Studio 
2015/Projects/ConsoleApplication3/ConsoleApplication3/" -*-
+-*- mode: compilation; default-directory: "~/" -*-
 Compilation started at Mon Apr 20 01:44:21
 
 bash -c "for m in *akefile; do break; done; if [[ ${m} != \"*akefile\" ]]; 
then PATH=\"${PATH}:/c/Program Files (x86)/MSBuild/14.0/Bin:/c/Program 
Files/Emacs/bin\" make; else set -o pipefail; 'c:/Program Files 
(x86)/MSBuild/14.0/Bin/MSBuild.exe' //m; fi"
diff --git a/test-files/msbuild-error.txt b/test-files/msbuild-error.txt
index db60400..d9555e5 100644
--- a/test-files/msbuild-error.txt
+++ b/test-files/msbuild-error.txt
@@ -1,4 +1,4 @@
--*- xmode: compilation; default-directory: 
"~/Dropbox/barfapp/ConsoleApplication1/ConsoleApplication1/" -*-
+-*- xmode: compilation; default-directory: "~" -*-
 Compilation started at Sat Feb 21 10:26:47
 
 "C:\Program Files (x86)\MSBuild\12.0\Bin\Msbuild.exe"
diff --git a/test-files/xbuild-error.txt b/test-files/xbuild-error.txt
index 77a366e..78e3858 100644
--- a/test-files/xbuild-error.txt
+++ b/test-files/xbuild-error.txt
@@ -1,4 +1,4 @@
--*- xmode: compilation; default-directory: 
"~/Dropbox/barfapp/ConsoleApplication1/ConsoleApplication1/" -*-
+-*- xmode: compilation; default-directory: "~/" -*-
 Compilation started at Fri Feb 20 22:52:43
 
 xbuild /p:GenerateFullPaths=true



reply via email to

[Prev in Thread] Current Thread [Next in Thread]