Comments (5)
I've never had a problem with using the latter (though I recall that there was a bug with poetry in the past where poetry env info --path
fails occasionally, so simply putting export PATH="$(poetry env info --path)/bin:${PATH}"
in .envrc will occasionally not work). The good thing about using the direnv solution is that it sorts out the path for other tools too, e.g. black.
from emacs.d.
All you need to do is to make sure that the language server is launched in the correct virtualenv (in your case, the virtualenv created by poetry). Personally, I use direnv; see the comment on the top of init-python.el
.
from emacs.d.
Hey! I've been playing with LSPs and this sort of setup recently.
A simple thing you can do is to install your LSP server, e.g. pyright
, as a dev dependency inside the poetry project. Then you can use poetry run pyright
as the LSP command for eglot
.
There's a further trick you can use to make direnv (and therefore Emacs, assuming you use my envrc
package, or the direnv
package) "see" the inside of the virtual environment built by poetry
: you can change your .envrc
to
use_nix
direnv_load poetry run direnv dump
I have the impression this second trick sometimes confuses poetry, though, so I probably would recommend the first approach instead.
from emacs.d.
Thanks for the suggestions! I am sorry that I reply so late. It took me a long time to figure things out. Asking eglot
to use poetry run pyright
helps me out!
from emacs.d.
Nice, thanks for confirming.
from emacs.d.
Related Issues (20)
- About flymake-flycheck HOT 10
- Got error message, about function of sanityinc/make-read-only, pp-display-expression in .el file in emacs 29.0.60 HOT 3
- Won't load after init-local.el is created and/or removed HOT 2
- Using wdired to change file name, got error message. HOT 6
- projectile configuration make projectile's candidate display error in emacs 29 HOT 3
- support for copilot HOT 2
- keybinding issues with paredit HOT 4
- Disable Parenthese and quote autocompletion when the cursor is just before a word or characters HOT 8
- Multiple Python flymake checkers HOT 4
- treesit config not load on startup HOT 1
- treesit-extra-load-path error when start emacs HOT 14
- Emacs says Symbol's function definition is void: setopt after updated to the latest version HOT 3
- Warning (treesit): Cannot activate tree-sitter, because language grammar for nix is unavailable (not-found) HOT 1
- symbol flymake-ruff-program is not bound
- M-X sly hits Error running timer: (void-function set-up-sly-hippie-expand) HOT 1
- Tidying up code HOT 1
- emacs Got Assertion failed: (derived-mode-p 'ibuffer-mode) HOT 5
- About the major-mode-remap-alist variable HOT 1
- org-mode cannot swap lists HOT 7
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 emacs.d.