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

Server can't find module if project not already built #32

Open
cgay opened this issue Feb 29, 2024 · 2 comments
Open

Server can't find module if project not already built #32

cgay opened this issue Feb 29, 2024 · 2 comments

Comments

@cgay
Copy link
Member

cgay commented Feb 29, 2024

Using my time library as a test, LSP in emacs works well when I

  • dylan build -a
  • start a fresh emacs
  • C-x C-f time.dylan
  • M-x lsp
  • move around the file and use M-. or M-? on various things

If I instead change that first (build) step to rm -rf _build to make sure there are no build products, the subsequent steps fail with dylan-lsp-server crashing with:

No module found for /Users/cgay/dylan/workspaces/time/sources/time.dylan
Backtrace:
  invoke-debugger:internal:dylan##1 + 0x29
  default-handler:dylan:dylan##1 + 0x12
  default-last-handler:common-dylan-internals:common-dylan##0 + 0x2a6
  error:dylan:dylan##0 + 0x2a
  error:dylan:dylan##1 + 0x79
  ensure-document-module:lsp-dylan-impl:lsp-dylan##0 + 0x103
  handle-textdocument/hover:lsp-dylan-impl:lsp-dylan + 0x86
  invoke-message-handler:lsp-dylan-impl:lsp-dylan + 0x2cd
  lsp-active-state-loop:lsp-dylan-impl:lsp-dylan + 0x5b
  lsp-server-top-level:lsp-dylan:lsp-dylan + 0xdb
  main:dylan-lsp-server:dylan-lsp-server + 0x360

It requires my dev branch changes that use dylan-tool dev branch changes to choose a reasonable default project to open, to even get this far, at least on macOS. Logging it here in case I get side-tracked before getting it fixed.

@cgay
Copy link
Member Author

cgay commented Feb 29, 2024

In case it's not obvious, it seems fairly natural to get an error if there are no build products. The point is that we need to initiate a build and let the user know it may take some time for the initial build.

@cgay
Copy link
Member Author

cgay commented Mar 12, 2024

Reminder to self... we'll need to run dylan update in the workspace the first time a project is being opened. Or give an appropriate error with a suggestion that the user run it. Or prompt the user to "Run dylan update now?"

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

1 participant