emacs-csharp / csharp-mode

A major-mode for editing C# in emacs
GNU General Public License v3.0
154 stars 47 forks source link

Getting "Cannot load (package name)" when attempting to utilize the 'use-package' statement from README #225

Closed RennisDitchie closed 3 years ago

RennisDitchie commented 3 years ago

Hello,

I tried to utilize the following suggested config idea within my 'configuration.org' file I have setup for my work based Emacs config:

(use-package tree-sitter)
(use-package tree-sitter-langs)

(use-package csharp-mode
  :config
  (add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-tree-sitter-mode)))

I have a literate config for my Emacs config to make it a bit more readable, so the 'configuration.org' file works in conjunction with 'init.el'.

Whenever I recompile my configuration file, it gives me the following error messages: Error (use-package): Cannot load tree-sitter Error (use-package): Cannot load tree-langs Error (use-package): Cannot load csharp-mode

I made sure I did 'M-x refresh packages' to make sure it wasn't some kind of weird MELPA issue either.

I'm using the latest Emacs 27.1 on Debian Sid (Testing) in a work based Virtualbox VM.

Please let me know if this is something I need to pursue further in terms of my config file itself, or if its an issue with tree-sitter or csharp-mode itself.

I have created this issue because I was really looking forward to some nice syntax highlighting for Emacs on either Linux at first, but maybe Windoze later to compete with VSCodium, but am worried I might actually have to revert to an IDE for this kind of thing. Please prove me wrong :)

theothornhill commented 3 years ago

Maybe you are missing :ensure t inside their bodies?

I forgot I use (setq use-package-always-ensure t)

Either add :ensure t or that setq, and the packages should be installed. You can see https://github.com/jwiegley/use-package for more ideas :)

RennisDitchie commented 3 years ago

That did it, thanks theothornhill!

Can you please update the README accordingly in that case?

Or at least make a note regarding the option for the "(setq use-package-always-ensure t)".

By the way, great idea, as I have that "ensure: t" all over the place as I learned how to utilize "use-package" and how to tweak Emacs through Uncle Dave's Emacs videos, and didn't know you could set this as a global variable.

You learn something new every day :)

Thanks again.

theothornhill commented 3 years ago

Im glad:)

And yes, I will update the readme, thanks for letting me know I missed it!