~ruther/emacs.d

d8ed3c99bea9ef3e16bcb674f6c401f21b31f53c — Rutherther 10 days ago 520ed2e
fix: Properly find namespace in root directory with csproj
1 files changed, 8 insertions(+), 7 deletions(-)

M init.el
M init.el => init.el +8 -7
@@ 1303,15 1303,16 @@ minibuffer, even without explicitly focusing it."

  (defun file-path-to-namespace ()
    (interactive)
    (let ((root (file-name-directory (find-current-csproj)))
          (base (file-name-nondirectory buffer-file-name))
          (project-name (extract-project-name)))
    (let* ((root (file-name-directory (find-current-csproj)))
           (base (file-name-nondirectory buffer-file-name))
           (project-name (extract-project-name))
           (subdirectory
            (replace-regexp-in-string "/" "\." (substring buffer-file-name (length root) (* -1 (length base))) t t)))
      (concat
       project-name
       "."
       (substring
        (replace-regexp-in-string "/" "\." (substring buffer-file-name (length root) (* -1 (length base))) t t)
        0 -1)))))
       (if (string= "" subdirectory)
           ""
         (concat "." (substring subdirectory 0 -1)))))))

;; Sh, Bash


Do not follow this link