-
Notifications
You must be signed in to change notification settings - Fork 24
Allow detection of snap installs on linux systems #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -118,6 +118,14 @@ Order is important." | |||
(append list (list value)) | |||
list)) | |||
|
|||
(defun lsp-dart-flutter-snap-install-p () | |||
;; Detecting whether this is a Linux system with a Snap style install | |||
(and (string= system-type "gnu/linux") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can' t snap be used on other OSs like apple?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly don't know. I restricted the function as much as possible as not to cause problems for others. I'll look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So reading the snap installer docs[1] and the flutter install docs[2], I can't seem to find any references to anything but Linux regarding snaps. The only references I could find for macs is the build tools[4] and the code also makes a lot of references to Linux specific things[3] which would be hard to make run in any other system.
I guess you can make a setup using Virtual Machines (or WSL2) but should this functionality cover such a scenario?
[1] https://snapcraft.io/docs/installing-snapd
[2] https://docs.flutter.dev/get-started/install
[3] https://github.com/snapcore/snapd
[4] https://snapcraft.io/docs/release-notes-snapcraft-3-0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, I'm ok with that for now
(let ((first-dir (-some-> (executable-find lsp-dart-flutter-executable) f-split cdr car))) | ||
(and first-dir | ||
(string= first-dir "snap") | ||
(file-exists-p "~/snap/flutter/common/flutter/bin/flutter"))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds a little bit dangerous rely on this path, if snap changes anything we 'd need to update this
Thank you! |
Reading issue #107 which has hit me a couple of times now, it seems like treating snap as an edge-case was the best possible solution. This patch implements that edge-case.