Comments (5)
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.
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.
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.
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.
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)
- Replace the internal elsa sequence functions with implementations of seq- methods
- Build fails because it installs some old version of Elsa from melpa? HOT 2
- Implement cl object methods for Emacs interop
- Is it safe to expand macros? HOT 7
- Add rudimentary support for parsing basic defcustom types
- Elsa crashes with `Unknown specializer elsa-explainer` HOT 2
- Move analysis of annotations to analyser instead of reader
- Add rule to warn about ' or #' quoting lambdas => you shouldn't
- Refactor checks and messages to be centered around code
- Create some system of checks for defgeneric before defmethod
- Error on `(require 'elsa)`: `(void-variable elsa-type)` HOT 11
- Fix lexical variables and setq
- Using fewer dependencies HOT 1
- eask lint elsa issues HOT 7
- Use without Eask or Cask ? HOT 1
- LSP instructions fail HOT 2
- `elsa--get-requires` fails to process "cl-macs.el.gz" due to `syntax-ppss` HOT 1
- Bool-vector type not supported by elsa-reader HOT 3
- Was Elsa abandoned as a project? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elsa.