From 34b78655c21a3b7902603c3a544f4a7fe469694d Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 28 Jan 2020 22:15:41 -0800 Subject: [PATCH] Enable nxml-mode for .csproj files --- oni-csharp.el | 5 ++++- test/integration/oni-csharp.bats | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/oni-csharp.el b/oni-csharp.el index 927d46a..74d1fb5 100644 --- a/oni-csharp.el +++ b/oni-csharp.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0128.214417 +;; Version: 2020.0128.221359 ;; Package-Requires: (csharp-mode omnisharp oni-company oni-flycheck) ;; This program is free software; you can redistribute it and/or modify @@ -94,6 +94,9 @@ ;;;###autoload (add-to-list 'auto-mode-alist '("\\.xaml\\'" . nxml-mode)) +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.csproj\\'" . nxml-mode)) + ;;;###autoload(with-eval-after-load 'csharp-mode (require 'oni-csharp)) (provide 'oni-csharp) diff --git a/test/integration/oni-csharp.bats b/test/integration/oni-csharp.bats index 241a335..bdfcbd0 100644 --- a/test/integration/oni-csharp.bats +++ b/test/integration/oni-csharp.bats @@ -19,3 +19,13 @@ [[ "$output" == *"nxml-mode" ]] } + +@test "Opening a .csproj file loads nxml-mode" { + run emacs -batch -l package -f package-initialize \ + -visit test.csproj \ + -eval "(prin1 major-mode)" + + echo "$output" + + [[ "$output" == *"nxml-mode" ]] +}