Giter Site home page Giter Site logo

Comments (5)

Fuco1 avatar Fuco1 commented on June 13, 2024

Hi @mooseyboots thanks for the report. It is still a bit rough to run this thing :/

Elsa does not run in your Emacs session, it always runs as a separate Emacs process. Your personal config is therefore never used or loaded by Elsa. You can only run Elsa over a project (you can turn your config in a project if you want though).

First, make sure you have latest version of all the dependencies, I've been submitting a lot of patches to ansi, async and trinary. Easiest way is to delete .cask and reinstall everything (or try cask update but it never works for me)

Your Cask file should look something like this:

(source melpa)
(source gnu)

...

(development
 (depends-on "elsa")  <-
 ...)

Run cask exec-path and make sure that the elsa directory is there, something like

/home/matus/.emacs.d/projects/Elsa/.cask/28.2/elpa/elsa-0.1.0/bin

(the part after .cask is important).

Then from the root directory (where Cask file is) you should be able to use cask exec elsa file.el.

To use it as LSP, you need to run the elsa-lsp-register as you did. After this, lsp-mode should start elsa lsp in the scope of the Cask project. That project must use Cask and have elsa as a dependency. So you can't run it anywhere. Once the lsp server is started, it will also only analyze the files in the project where it was started.

You need cask (or eask, or something else) to provide this process separation. Elsa never runs in your Emacs session because it could get its environment polluted by the "current session". It runs in its own process to be sandboxed.

from elsa.

mooseyboots avatar mooseyboots commented on June 13, 2024

thanks a lot for explaining all the steps!

i did understand that i had to use cask, i was just calling it from emacs using (shell-command).

removing .cask and reinstalling all the dependencies helped. i got it running.

i'm a bit wigged out though, it returns hundreds of false positives. it seems like it doesn't handle autoload declarations, so any functions called from other files in the same package aren't recognised. it thinks (y-or-n-p) calls always return nil, or (when my-pkg-var checks also.

anyway, interesting for me to have a first try with lsp. baby steps.

from elsa.

Fuco1 avatar Fuco1 commented on June 13, 2024

In package code you can't really use autoloads. Each file must require all its dependencies. Elsa scans the requires and follows the entire tree up to the point where there's no more requires left (even many levels nested).

Many built-in functions are not annotated yet so those just return some generic types, see #22, #147. Macros don't work yet, see #205, #196.

At version 0.1.0 I'm expecting it to be generally usable, you can track this in the corresponding milestone. Thanks for trying it out. Out of curiosity, are you a package developer or are you trying to analyse your .emacs.d?

from elsa.

mooseyboots avatar mooseyboots commented on June 13, 2024

thanks for the further details.

i'm the maintainer of mastodon.el (https://codeberg.org/martianh/mastodon.el). it's my only cask project i think. i was curious to try it out to see if it might alert me to some bad coding habits, which it did. i found that all the info level issues were real, and all the error/warning ones were false (or rather there were too many for me to tell).

from elsa.

Fuco1 avatar Fuco1 commented on June 13, 2024

Thanks for the project reference. I'm always interested in trying this out on real projects out there. I'm very biased towards implementing features useful for analysis of my projects, mostly Elsa itself 😁

Currently I'm working on adding support for macros which should resolve a ton of the false positives as macros very often introduce unknown variables to the scope which Elsa just ignores currently.

from elsa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.