Coder Social home page Coder Social logo

Comments (13)

vspinu avatar vspinu commented on July 3, 2024

There is a half backed lsp integration in polymode since recently but I got interrupted and it's not yet fully tested. That might be an issue.

With the most recent polymode you should be able to set polymode-lsp-integration to nil in order to disable it.

I will have a closer look at this issue some time later. Do I understand correctly that R lsp server does understand markdown documents, thus no special integration is needed on polymode side?

from poly-r.

vspinu avatar vspinu commented on July 3, 2024

polymode-lsp-integration should be set before polymode is loaded though

from poly-r.

bryce-carson avatar bryce-carson commented on July 3, 2024

I experience the same issue, so it's reproducible. 😞

For now I'll disable it as @vspinu suggests.

from poly-r.

shirdekel avatar shirdekel commented on July 3, 2024

Thanks @vspinu! I'm not sure how to answer your question about the R lsp server understanding markdown documents unfortunately.

Also, can you clarify how I should set polymode-lsp-integration before polymode is loaded? At the moment I'm loading poly-r in my dotspacemacs-additional-packages list and then using (setq polymode-lsp-integration nil) in my user config.

from poly-r.

bryce-carson avatar bryce-carson commented on July 3, 2024

Thanks @vspinu! I'm not sure how to answer your question about the R lsp server understanding markdown documents unfortunately.

Also, can you clarify how I should set polymode-lsp-integration before polymode is loaded? At the moment I'm loading poly-r in my dotspacemacs-additional-packages list and then using (setq polymode-lsp-integration nil) in my user config.

As far as I am aware, if you're not using the ESS layer (you're specifying polymode [not poly-r; you need to configure this for polymode - poly-r is dependent on Polymode's configuration]), then the way to set the variable's value before the package is loaded is with the :init property.

You should double-check the documentation, but the way I am doing it is with this line in my user-config; I am not sure it is working, however, because I am using the ESS layer. The layer does not include Polymode, however, so it should be working.

I do still have the lsp layer enabled, and an LSP server is not being started when I enter an R code block in an Rmd document just now, so I can at least say that it is disabled, yes.

  (use-package eglot)

  (use-package polymode
    :init (setq polymode-lsp-integration nil))

I changed the backend to eglot two days ago, and that may have had a fuller effect. I'm not sure. Spacemacs is going through a period of change right now and many layers and core functionality needs code review and refactoring. I'll be contributing to that this summer.

For clarity, this is what I have in my dotspacemacs/layers:

     (;; TODO: configure `lsp', `company', `company-box', etc.
      ess :variables
          ess-r-backend 'eglot
          ess-use-company 't
          markdown-code-block-braces t
          polymode-lsp-integration nil
          :config (add-to-list 'auto-mode-alist '("\\.[rR]md\\'" . poly-markdown+r-mode)))

and this is what I have in my additional-packages list:

                                      ;; Language server
                                      eglot

                                      ;;; Multi-language buffers, incl. Rmd
                                      (polymode :location (recipe :fetcher github :repo "polymode/polymode"))
                                      poly-R
                                      poly-markdown
                                      poly-noweb
                                      poly-org

from poly-r.

shirdekel avatar shirdekel commented on July 3, 2024

Thanks! Unfortunately it's still not selectively disabling it in Rmd code chunks even after I load polymode in addition to poly-R as you have, and set polymode-lsp-integration to nil in both the ess variables and using use-package in user-config.

from poly-r.

bryce-carson avatar bryce-carson commented on July 3, 2024

Thanks! Unfortunately it's still not selectively disabling it in Rmd code chunks even after I load polymode in addition to poly-R as you have, and set polymode-lsp-integration to nil in both the ess variables and using use-package in user-config.

If I recall, you said you're using Spacemacs. In that case, the best place to put the setting of that variable is in dotspacemacs/user-init, which will execute before layers and packages are loaded and initialized, so the variable will have the proper setting at the proper time with this location.

from poly-r.

shirdekel avatar shirdekel commented on July 3, 2024

That doesn't seem to work for me either :(
I added the below to dotspacemacs/user-init:

  (require 'use-package)
  (use-package polymode
    :init (setq polymode-lsp-integration nil))

And got (Spacemacs) Error in dotspacemacs/user-init: Cannot open load file: No such file or directory, use-package. I had to require use-pacakge because otherwise I get (Spacemacs) Error in dotspacemacs/user-init: Symbol’s function definition is void: use-package.

from poly-r.

shirdekel avatar shirdekel commented on July 3, 2024

Update: I successfully disabled polymode-lsp-integration.

The solution: updating my packages.

I didn't take the "recent" part of what @vspinu said earlier seriously enough:

With the most recent polymode you should be able to set polymode-lsp-integration to nil in order to disable it.

Now for everything to work as expected (and still use LSP within Rmd R code chunks) I just need to do the following:

  1. Disable polymode-lsp-integration in the ess layer config:
     (ess :variables
          ess-r-backend 'lsp
          polymode-lsp-integration nil)
  1. Add poly-R to dotspacemacs-additional-packages

No need to load polymode separately or to use dotspacemacs/user-init.

from poly-r.

maikol-solis avatar maikol-solis commented on July 3, 2024

I wasn't aware of this issue when I opened this polymode/polymode#316

Setting (setq polymode-lsp-integration nil) solves the issue for me.

from poly-r.

atanasj avatar atanasj commented on July 3, 2024

I am getting this too using doomemacs. Setting (setq polymode-lsp-integration nil) worked for me too.

from poly-r.

milanglacier avatar milanglacier commented on July 3, 2024

It seems that polymode-lsp-integration only works with lsp-mode? I am using eglot, and editing rmarkdown file is extremely slow, when typing in the code block, emacs frequently hangs for 2-3 seconds to respond to input characters.

from poly-r.

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.