From ec84418d9367f12bbfdd144d873e1e10e93ac55f Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 20 May 2024 01:02:32 -0700 Subject: [PATCH] fix: Compile warnings --- lsp-dart-flutter-fringe-colors.el | 8 ++++---- lsp-dart-utils.el | 4 ++-- lsp-dart.el | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lsp-dart-flutter-fringe-colors.el b/lsp-dart-flutter-fringe-colors.el index 02ab662..9708179 100644 --- a/lsp-dart-flutter-fringe-colors.el +++ b/lsp-dart-flutter-fringe-colors.el @@ -75,23 +75,23 @@ (if-let ((color (-> (match-string 1) (assoc lsp-dart-flutter-colors) cdr))) - (lsp-dart-flutter-fringe--add-color (concat "#" color) buffer (point-at-bol)))) + (lsp-dart-flutter-fringe--add-color (concat "#" color) buffer (line-beginning-position)))) (goto-char (point-min)) (while (re-search-forward lsp-dart-flutter-fringe-color-hex-pattern nil t) (let ((color (concat "#" (substring (match-string 1) 2)))) - (lsp-dart-flutter-fringe--add-color color buffer (point-at-bol)))) + (lsp-dart-flutter-fringe--add-color color buffer (line-beginning-position)))) (goto-char (point-min)) (while (re-search-forward lsp-dart-flutter-fringe-color-argb-pattern nil t) (let ((color (lsp-dart-flutter-fringe--rgb-to-hex (match-string 2) (match-string 3) (match-string 4)))) - (lsp-dart-flutter-fringe--add-color color buffer (point-at-bol)))) + (lsp-dart-flutter-fringe--add-color color buffer (line-beginning-position)))) (goto-char (point-min)) (while (re-search-forward lsp-dart-flutter-fringe-color-rgbo-pattern nil t) (let ((color (lsp-dart-flutter-fringe--rgb-to-hex (match-string 1) (match-string 2) (match-string 3)))) - (lsp-dart-flutter-fringe--add-color color buffer (point-at-bol))))))) + (lsp-dart-flutter-fringe--add-color color buffer (line-beginning-position))))))) (define-minor-mode lsp-dart-flutter-fringe-colors-mode "Mode for displaying colors in fringe." diff --git a/lsp-dart-utils.el b/lsp-dart-utils.el index 2039701..46e0846 100644 --- a/lsp-dart-utils.el +++ b/lsp-dart-utils.el @@ -206,8 +206,8 @@ FLUTTER_ROOT environment variable." (-some (lambda (strategy) (cl-case strategy - ('lsp-root (lsp-workspace-root)) - ('closest-pubspec (-some-> default-directory + (`lsp-root (lsp-workspace-root)) + (`closest-pubspec (-some-> default-directory (locate-dominating-file "pubspec.yaml") file-truename)))) lsp-dart-project-root-discovery-strategies)) diff --git a/lsp-dart.el b/lsp-dart.el index b1f86ae..34fa701 100644 --- a/lsp-dart.el +++ b/lsp-dart.el @@ -44,6 +44,8 @@ (require 'lsp-dart-flutter-widget-guide) (require 'lsp-dart-commands) +(declare-function yas-minor-mode "ext:yasnippet.el") + (defgroup lsp-dart nil "LSP support for Dart, using dart analysis server." :prefix "lsp-dart-"