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

feat(lsp-mojo): add LSP support for Mojo 🔥 #4207

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

adamliter
Copy link
Contributor

Not super familiar with elisp or the lsp-mode code base, but here is an attempt to add support for Mojo 🔥 (closes #4206). Very much open to feedback on this PR! 😄 Do I need to do anything to update the documentation or anything? I think I saw somewhere that the docs are autogenerated.

Also, let me know if there's any testing that should be added to this PR (would appreciate a pointer in how to do that). I've tested this out locally by doing the following, and it seems to be working for me.

cd /tmp
git clone https://github.com/modularml/mojo.git
cat << EOF > init.el
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 6))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)

(use-package lsp-mode
  ;; my local copy of this repo with the changes in this PR
  :load-path "/Users/adamliter/git/lsp-mode" 
  :straight (:local-repo "/Users/adamliter/git/lsp-mode"))

(use-package company)
EOF
emacs -q --load init.el &

Then, I did C-x C-f mojo/examples/matmul.mojo, then M-x lsp-mode, then you can see I'm getting completion from the LSP with lsp-mode and company like so:

image

@github-actions github-actions bot added documentation client One or more of lsp-mode language clients labels Oct 28, 2023
@yyoncho
Copy link
Member

yyoncho commented Oct 31, 2023

Thank you for contributing to lsp-mode!

@yyoncho yyoncho merged commit 3abe0e2 into emacs-lsp:master Oct 31, 2023
11 of 14 checks passed
@adamliter adamliter deleted the feat/mojo-lsp-mode branch October 31, 2023 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client One or more of lsp-mode language clients documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lsp-mode for Mojo?
2 participants