Code Monkey home page Code Monkey logo

Comments (2)

rish987 avatar rish987 commented on May 28, 2024

Attempted fix of this and #77 at rish987/lean.nvim@c38dae8 (will add new unit tests soon). However, it doesn't work because the returned cancellation function from vim.lsp.buf_request() seemingly does nothing. You can even try this in lsp.lua (rish987/lean.nvim@3e2e21d):,

  -- Fetch goal state information from the server.                                                                                                                                                                                             
  function lsp.plain_goal(bufnr, handler)                                                                                                                                                                                                      
    -- Shift forward by 1, since in vim it's easier to reach word                                                                                                                                                                              
    -- boundaries in normal mode.                                                                                                                                                                                                              
    local params = vim.lsp.util.make_position_params()                                                                                                                                                                                         
    params.position.character = params.position.character + 1                                                                                                                                                                                  
    local id_map, cancel = vim.lsp.buf_request(bufnr, "$/lean/plainGoal", params, handler)                                                                                                         
    cancel()                                                                                                                                                                                                                                   
    -- This doesn't work either:                                                                                                                                                                                                               
    --                                                                                                                                                                                                                                         
    --for client_id, req_id in pairs(id_map) do                                                                                                                                                                                                
    --  vim.lsp.get_client_by_id(client_id).cancel_request(req_id)                                                                                                                                                                             
    --end                                                                                                                                                                                                                                      
  end 

and everything still passes.

Any ideas? Could this be a neovim bug? Will try to put together an MWE tomorrow.

from lean.nvim.

rish987 avatar rish987 commented on May 28, 2024

(^ This seems to have something to do with the cancel function sending a cancelRequest to the server, rather than just cancelling the callback, which is what I assumed it does. And it looks like the Lean servers don't do anything on cancelRequest? Investigating...)

from lean.nvim.

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.