Skip to content

Fix master with lsp#139

Merged
sfultong merged 13 commits intoStand-In-Language:masterfrom
hhefesto:fix-master-with-lsp
Dec 19, 2025
Merged

Fix master with lsp#139
sfultong merged 13 commits intoStand-In-Language:masterfrom
hhefesto:fix-master-with-lsp

Conversation

@hhefesto
Copy link
Copy Markdown
Contributor

lsp works with this on your .spacemacs:

(defun dotspacemacs/user-config ()
  ...
  ;; Load telomare mode if it exists
  (let ((telomare-file "~/src/telomare/emacs-telomare-mode/telomare-mode-spacemacs.el"))
    (if (file-exists-p telomare-file)
        (load telomare-file)
      (message "Telomare mode file not found: %s" telomare-file)))
  ...
  )

You also have to set within telomare-mode-spacemacs.el the correct path of the project.

@hhefesto
Copy link
Copy Markdown
Contributor Author

For some reason giving the project directory to a function isn't working adequately.

This code:

(defun telomare-setup (project-path)
  "Set up Telomare major mode and LSP using PROJECT-PATH."

  (message "telomare-setup called")

  ;; --- Major mode ---
  (define-derived-mode telomare-mode prog-mode "Telomare"
    "Major mode for editing Telomare files."
    (setq-local comment-start "-- ")
    (setq-local comment-end ""))

  ;; --- File association ---
  (add-to-list 'auto-mode-alist '("\\.tel\\'" . telomare-mode))

  ;; --- Ensure lsp-mode is loaded ---
  (require 'lsp-mode)

  ;; --- Language ID ---
  (add-to-list 'lsp-language-id-configuration
               '(telomare-mode . "telomare"))

  ;; --- Register LSP client ---
  (lsp-register-client
   (make-lsp-client
    :server-id 'telomare-lsp
    :major-modes '(telomare-mode)
    :command-fn
    (lambda ()
      (message "🚀 Launching Telomare LSP")
      (list "nix" "run" (concat project-path "#lsp") "--"))))

  ;; --- Auto-start LSP ---
  (add-hook 'telomare-mode-hook #'lsp-deferred))

(provide 'telomare-config)

tries to abscract the project file path but seems to not work while a hardcoded project file does work.

Maybe I have to do a macro to have that work correctly.

@sfultong
Copy link
Copy Markdown
Collaborator

Looks good!

I wonder if we could use Megaparsec's lexer for the LSP server and save a bit of code.

Thanks for adopting spacemac's shortcut scheme for the server! That makes things easier for me

@sfultong sfultong merged commit cd0c50c into Stand-In-Language:master Dec 19, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants