Skip to content
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

Can't run lsp-dart in a dart file #195

Open
softode-code opened this issue Apr 25, 2023 · 12 comments
Open

Can't run lsp-dart in a dart file #195

softode-code opened this issue Apr 25, 2023 · 12 comments

Comments

@softode-code
Copy link

softode-code commented Apr 25, 2023

I can not run dart-mode in doom-emacs. I have defined it in lang: as

(dart +flutter +lsp)

I have copied the config from https://emacs-lsp.github.io/lsp-dart/ exmaple:

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(package-initialize)

(setq package-selected-packages
  '(dart-mode lsp-mode lsp-dart lsp-treemacs flycheck company
    ;; Optional packages
    lsp-ui company hover))

(when (cl-find-if-not #'package-installed-p package-selected-packages)
  (package-refresh-contents)
  (mapc #'package-install package-selected-packages))

(add-hook 'dart-mode-hook 'lsp)

(setq gc-cons-threshold (* 100 1024 1024)
      read-process-output-max (* 1024 1024))

Screenshots
image

@ericdallo
Copy link
Member

Do you have flutter / dart available in your $PATH? if so, try starting emacs from terminal which has that available

@softode-code
Copy link
Author

Yes, I have flutter in my PATH and I started emacs from that terminal. Still the same result.

@ericdallo
Copy link
Member

Alright, could you follow the issue template and include here the result of: M-x lsp-dart-version?

@ericdallo ericdallo changed the title Can run dart-mode in a dart file Can run lsp-dart in a dart file Apr 25, 2023
@softode-code
Copy link
Author

I get the following result when I run lsp-dart-version:

[LSP Dart] 1.24.1 at 2023.04.26 @ Emacs 28.2
[Dart SDK]
�[33m ▄ �[31m ▄▄ �[32m ▄▄ �[34m ▄▄ �[35m ▄▄ �[36m ▄▄
�[33m ███▄▄ �[31m ██▬██▬██ �[32m ██▬██▬██ �[34m ██▬██▬██ �[35m ██▬██▬██ �[36m ██▬██▬██
�[33m █████▀▀�[31m ████ �[32m ████ �[34m ████ �[35m ████ �[36m ████
�[33m █▀▀ �[31m ▄██ ██▄ �[32m ▄██ ██▄ �[34m ▄██ ██▄ �[35m ▄██ ██▄ �[36m ▄██ ██▄
�[33m █ �[31m ▄▄▄▀█ █▀▄▄▄ �[32m ▄▄▄▀█ █▀▄▄▄ �[34m ▄▄▄▀█ █▀▄▄▄ �[35m ▄▄▄▀█ █▀▄▄▄ �[36m ▄▄▄▀█ █▀▄▄▄
�[33m▄█▄ �[31m ███▀████▀███ �[32m ███▀████▀███ �[34m ███▀████▀███ �[35m ███▀████▀███ �[36m ███▀████▀███
�[31m ▀ ▀ �[32m ▀ ▀ �[34m ▀ ▀ �[35m ▀ ▀ �[36m ▀ ▀
�[1m
�[93m ▄ �[91m ▄▄ �[92m ▄▄ �[94m ▄▄ �[95m ▄▄ �[96m ▄▄
�[93m ███▄▄ �[91m ██▬██▬██ �[92m ██▬██▬██ �[94m ██▬██▬██ �[95m ██▬██▬██ �[96m ██▬██▬██
�[93m █████▀▀�[91m ████ �[92m ████ �[94m ████ �[95m ████ �[96m ████
�[93m █▀▀ �[91m ▄██ ██▄ �[92m ▄██ ██▄ �[94m ▄██ ██▄ �[95m ▄██ ██▄ �[96m ▄██ ██▄
�[93m █ �[91m ▄▄▄▀█ █▀▄▄▄ �[92m ▄▄▄▀█ █▀▄▄▄ �[94m ▄▄▄▀█ █▀▄▄▄ �[95m ▄▄▄▀█ █▀▄▄▄ �[96m ▄▄▄▀█ █▀▄▄▄
�[93m▄█▄ �[91m ███▀████▀███ �[92m ███▀████▀███ �[94m ███▀████▀███ �[95m ███▀████▀███ �[96m ███▀████▀███
�[91m ▀ ▀ �[92m ▀ ▀ �[94m ▀ ▀ �[95m ▀ ▀ �[96m ▀ ▀
�[0m
Dart SDK version: 2.19.6 (stable) (Tue Mar 28 13:41:04 2023 +0000) on "linux_x64"

[Flutter SDK] /home/umer/Development/flutter/
[Flutter project] true
[Project entrypoint] /home/umer/Development/quizapp/lib/main.dart

@softode-code softode-code changed the title Can run lsp-dart in a dart file Can't run lsp-dart in a dart file Apr 26, 2023
@softode-code
Copy link
Author

@ericdallo please support on this.

@ericdallo
Copy link
Member

ericdallo commented May 6, 2023

@softode-code sorry for the delay.

The output looks correct (besides the weird dart sdk chars), and I noticed you are using doom-emacs, so no extra config from https://emacs-lsp.github.io/lsp-dart/ is necessary, you can check my dotfiles for my doom-emacs as example. Make sure you run doom sync after each init.el change

could you try on this sample project?

@softode-code
Copy link
Author

Still the same result.

@ericdallo
Copy link
Member

Could you try lsp-start-pain.el ?

@softode-code
Copy link
Author

I ran "lsp-start-plain", a new emacs window opened with the below messages:

image

@softode-code
Copy link
Author

Here is the logs from "lsp-log":

Command "/home/umer/Development/flutter/bin/cache/dart-sdk/bin/dart language-server --client-id emacs.lsp-dart --client-version 1.24.1" is present on the path.

@ericdallo
Copy link
Member

That was probably an instability in melpa for downloading packages, trying again should work

@softode-code
Copy link
Author

I again ran "lsp-start-plain", a new emacs window opened. I opened a dart file in it but same results:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants