Code Monkey home page Code Monkey logo

lsp-timeout.nvim's Introduction

Gmail LinkedIn Twitter PayPal HH

👋 Hello!

WHO AM I?

  • I'm a Russian🇷🇺 self-taught Software Engineer with a broad skillset in software engineering; I'm also a college dropout (2013)
  • Since my college times I'm pursuing my career in Electronics & Software Design & Engineering
  • I'm bilingual:
    • I'm native and fluent in Russian
    • I can read (2015), write (2017), and understand vocal American English (2019) 🇺🇸
  • I'm Wikipedian (mostly English one)
    • I've been tinkering around chemistry, biology, math, politics, etc. a lot of stuff
    • While on wikipedia, I made a side project: HistoryHelper , a plugin for Wikipedia that helps to link history entries to the talk pages to speed up creation of disputes

HOW BECOME?

  • In 2013, in my college years I used to use PHP for several small side-projects; no commercial experience
  • In 2014 I started to look forward to Link label, JavaScript, HTML5, CSS3
    • By this time JetBrains editors like WebStorm were thriving, but ultimately I've switched to Visual Studio Code
  • In 2015 I've started to learn & use GIT, TypeScript (TypeDoc), and Webpack
  • On the way I have learned a lot about web-related technologies (i.e.software), just to name a few:
    • Old shool ones: VanillaJS, Backbone.js, JQuery
    • By 2017
      • I started to use GNU/Linux OS (Kubuntu: KDE Plasma etc.) in my everyday work
      • Backend:
        • Node.js APIs, Socket.io, Express, MongoDB (Mongoose)
      • Frontend: Angular, React, React Components, React Router etc.
      • Basic frameworks for testing, bundling, styling (e.g.Bootstrap , SCSS etc.)
      • Sideproject: Stigma, a schema validator
    • Graphics, a lot of math, trigonometry, WebGL
      • A side project: Globular, a small TS/JS Geometry library
      • As of today I'm still continuing my journey toward OpenGL/Vulkan
      • Sideproject: a modified fork of game
        a competitor game for JS13k competition1
    • 🛠️ I've mastered Node.js more, became accustomed to a range of different everyday tools like
      • NPM, Yarn, pnpm, NVM, different VSCode extensions etc.
  • By 2018: Docker
  • In 2019 I've digged a lot into a C-language world and desktop/cross-platform applications:
    • C/C++, LLVM/Clang/GCC, ccache, Make, CMake (Ninja!), build automation systems
    • I also played a bit with CADs (like KiCad FreeCAD, AutoCAD, SolveSpace, and KiCAD)
    • Played around with Blender
  • By August 2021 up to 2022, I'v been mastering Bash/Zsh zsh (completion, general functionality, docs etc.)
  • By 2022 I've mastered CMake (see contribs), gnu learned a lot about
    • LLVM tooling (clang-tidy etc.)
    • GNU Core Utilities, like Bash and Make (AWK a bit) scripting languages etc.
    • Zsh, a versatile, though not backwards compatible, bash replacement
  • December 2022 - Researching Organosilicon chemistry, Photoresists (Electronics)
  • November 2022 - January 2023 - Learning neovimlink.neovim editor heavily
    • When Microsoft killed atom editor, I decided to move away from VS Code.
    • This took me a while to setup a lot of things
    • During this time I've learned alot about Lua & Vimscript languages, their environment. I'm now very confident in writing Lua code. Not a big deal.
    • Familirized myself with GNU Make gnu

WHAT DO I DO NOW?

  • April 2023 - Contributing to Neovim plugins,e.g.:
  • May 2023
    • I've learned in-depth idea dependency injection, modularity concept in programming languages, and an experimental Newspeak languages developed by Cadence Design Systems. Newspeak was dropped in 2009, but still serves a good example of enforced dependency injection: you can't get lost and know for sure where a certain symbol (class) comes from.
    • Contributing into nvim-lspconfig project: PR#2609
  • June 1-9, 2023
    • Learned how to use Inkscape vector editor (I already know how to use BoxySVG for instance): basic editing tasks, import/export etc.
    • PostgresSql: basic authentication, cluster management, Ubuntu SystemD service management (pg_createcluster,initdb etc.), some most common commands
    • pgadmin4-web (data modelling & ERD tool)
    • PGModeller (ERD tool) - a part on Model-Driven Engineering (MDE) methodology
  • June 27-28, 2023
  • July - August 2023
    • July 10-13, 2023: I deepened my knowledge in Quantum Physics and Quantum Chemistry (all of this is related to the chemistry, a broader approach to micro electronics engineering)
    • July 7-17, 2023: I've read book on UML by Grady Booch «The Unified Modeling Language User Guide, (1998)» as part of MDE
    • July 25, 2023: Model-driven architecture & Round-trip engineering
    • August 20-23 - Learned about GNU stow command
  • Semptember - October 2023
    • September 28 - Contributed plugins for Neovim: lsp-timeout.nvim and duplicate.nvim
    • September 30 - It took me full year to fathom Neovim ecosystem; Insanity!; now I know Neovim Lua API and Lua well
  • October 2023
  • November 2023
    • Wasted a week on improvements of some deeply flawed neovim plugin, but sadly, it got rejected on frivioulous grounds: 1 2 3
  • December 2023
    • December 19 - Made std.sh - a minimal standard library to detect operating system & package managers; easy to install
  • February 5, 2024 - ? - Hired as part of a team to work on PVC extrusion lines as an operator; thanks to my English knowledge it was my side-job; my duties included setting up extrusion lines for pipes production; the pipes we made were used for securing the boreholess left after well-drilling;

WHAT I WILL CERTAINLY DO

  • Spring - Autumn 2022/2023 I'm still looking foward to learn more about the following topics:
    • Pending
      • Zsh/Bash comand completion - Since August 2021!
    • More about
      • Hostings
      • Continuous Integration/Continuous Development (CI/CD) tools
    • Data Bases:
      • SQL/ PostgresSQL
      • ORMs for C/C++ & JS integration
    • Electronics
      • Electrical Engineering
      • Microelectronics Engineering & Fabrication
      • VLSI IC Design
      • Electronics Design/MCUs
      • EDAs
    • Chemistry
      • Organic silicon chemistry
    • Misc
      • Bison/Lex
    • Driving license

Fun facts

  • I was homeless up until November 2020

Support

Disclaimer 🇺🇦

On Feburuary 24, 2022 a self-proclaimed President (with term ending in 2008 per Constitutional limit) of Russia Vladimiar Putin has announced a so called «Special Military Operation» against the sovereign state of Ukraine 🇺🇦. I do not support and share in any way this blatant and unjustified (IMO) encroachement on country's and people's freedom. Please help to stop the war - spread the word!


November 03, 2022

lsp-timeout.nvim's People

Contributors

hinell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

lsp-timeout.nvim's Issues

attempt to call field 'get_clients' (a nil value)

Summary

Error  15:39:31 msg_show.lua_error Error detected while processing FocusLost Autocommands for "*":
15:39:31 msg_show Error executing lua callback: .../share/nvim/lazy/lsp-timeout.nvim/plugin/lsp-timeout.lua:82: attempt to call field 'get_clients' (a nil value)
stack traceback:
	.../share/nvim/lazy/lsp-timeout.nvim/plugin/lsp-timeout.lua:82: in function <.../share/nvim/lazy/lsp-timeout.nvim/plugin/lsp-timeout.lua:72>

Steps to reproduce

No response

Setup

    {
	"hinell/lsp-timeout.nvim",
	dependencies={ "neovim/nvim-lspconfig" }
    }

LSPs not restarting / null-ls

Summary

Since last update, I can't get my LSPs to restart on refocus, only inside .tsx files.

Actually, I have to manually use LspStart to restart the timedout servers.
Please see (.tsx file) :

Enregistrement.de.l.ecran.2023-10-26.a.15.18.01.mov

See the difference (.lua file) :

Enregistrement.de.l.ecran.2023-10-26.a.15.24.11.mov

EDIT : It seems that if lsp-timeout stop the servers and we don't use LspStop command to check if it's working, on refocus the LSPs are not restarted too.

Steps to reproduce

Stop LSP servers inside .tsx file (or typescript project ?) , switch focus and then refocus the nvim window.

Versions

NVIM v0.10.0-dev-1418+g15983cf2c-dirty
Build type: RelWithDebInfo
LuaJIT 2.1.1697887905

Option to exclude certain languages

Summary

New option exclude = { 'markdown', ... }.

So the plugin doesn't trigger for said language.

Why

There are many scenarios where this is necessary. I'm gonna describe two.

scenario 1

Imagine you are editing a markdown file.

You don't have a markdown lsp server, but you have prettierd as formatter.

When lsp-timeout run :LspStop, this is gonna also stop prettierd.

But it won't be possible to restore it with a LspAttach autocmd like next, because there is not lsp server at all.

      vim.api.nvim_create_autocmd({ "LspAttach" }, {
        desc = "Ensure null-ls start its sources a lsp client starts",
        callback = function()
           pcall(function() require("null-ls").enable({}) end)
        end,
      })

scenario 2

Some LSP servers might just miss behave, and it would be a good idea to be able to ignore the language entirely.

  • For example, java jdtls restores correctly, but it will send error notifications for a while.
    screenshot_2023-10-29_01-11-44_136919706

tsserver not restarting after switching from `jose-elias-alvarez/typescript.nvim` to `pmizio/typescript-tools.nvim`

Summary

EDIT : After some investigations tsserver is restarted, but the LSP typescript-tools is not.
EDIT 2 It seems that lua_ls doesn't restart too. Can it be related to the fact that it is handled by lsp-zero ? Or by the latest update of lsp-timeout?

Before switching from jose-elias-alvarez/typescript.nvim to pmizio/typescript-tools.nvim tsserver was restarting without any problems. Now it wont restart.

If it can help, here's typescript-tools config :

local M = {}

M.config = function()
  local lsp_zero = require("lsp-zero")
  lsp_zero.extend_lspconfig()
  require("typescript-tools").setup({
    settings = {
      tsserver_file_preferences = {
        includeInlayParameterNameHints = "all",
        includeCompletionsForModuleExports = true,
        includeInlayParameterNameHintsWhenArgumentMatchesName = true,
        includeInlayFunctionParameterTypeHints = true,
        includeInlayVariableTypeHints = true,
        includeInlayVariableTypeHintsWhenTypeMatchesName = true,
        includeInlayPropertyDeclarationTypeHints = true,
        includeInlayFunctionLikeReturnTypeHints = true,
        includeInlayEnumMemberValueHints = true,
      },
      tsserver_format_options = {
        allowIncompleteCompletions = false,
        allowRenameOfImportPath = true,
      },
      separate_diagnostic_server = true,
      publish_diagnostic_on = "insert_leave",
      expose_as_code_action = {},
      tsserver_max_memory = "auto",
      tsserver_locale = "fr",
      complete_function_calls = true,
      include_completions_with_insert_text = true,
      code_lens = "all",
      disable_member_code_lens = true,
    },
  })
end

return M

Steps to reproduce

I don't have any steps to reproduce the issue, all I can give you is my neovim configuration if you want to try.
You can find it here : ls-devs/nvim

Versions

NVIM v0.10.0-dev-1413+g684e93054-dirty
Build type: RelWithDebInfo
LuaJIT 2.1.1697887905

Add ability to disable neovim on startup

idea is using tmux, i want to restore many neovim sessions without triggering lsp.

could add option to disable lsp at startup until the user-has-come-back trigger triggers

[FEAT] Ignore filetypes

Add option to ignore filetypes

It would be great if this plugin could ignore some filetypes like NeoTree Telescope etc..
Actually if u loose focus on a window such like NeoTree Telescope , the plugin try to restart some LSP cause its found 0 servers (even if u just ALT-TAB quickly).
But it needs to restart LSPs if they stopped even if focus is regained on an ignored filetype.

1.2.0 Error when neovim loses focus

I've read TROUBLESHOOTING instructions

  • Yes

Summary

There seem to be a bug when the current neovim screen loses focus.
screenshot_2023-10-29_20-35-20_742103937

Config

  {
    "hinell/lsp-timeout.nvim",
    dependencies={ "neovim/nvim-lspconfig" },
    event = "User BaseFile",
    init = function()
      vim.g["lsp-timeout-config"] = {
        stopTimeout = 1000,        -- Stop unused lsp servers after 1s (for testing).
        startTimeout = 2000,             -- Force server restart if nvim can't in 2s.
        silent = true,                   -- Notifications disabled
        filetypes = {                    -- Exclude servers that miss behave on LSP stop/start.
          ignore = { 'markdown', 'java' }
        },
      }
    end
  },

More info

I've tested with a few languages with the same result.

Steps to reproduce

  1. Use my config
  2. Open any file that has an active lsp client.
  3. move the mouse outside of neovim.

(it seems to be unrelated with the new option filetypes.)

Versions

NVIM v0.10.0-dev-1418+g15983cf2c6
Build type: RelWithDebInfo
LuaJIT 2.1.1697887905
Run "nvim -V1 -v" for more info

Specify operating system/environment

Archlinux

Lots of LSP not restarting.

Summary

Lots of LSP not restarting.

Before timeout :
Capture d’écran 2023-10-19 à 16 13 21

After timeout :
Capture d’écran 2023-10-19 à 16 24 35

lsp-timeout config :

  vim.g["lsp-timeout-config"] = {
    stopTimeout = 1000 * 60 * 5, -- ms, timeout before stopping all LSP servers
    startTimeout = 1000 * 10,  -- ms, timeout before restart
    silent = false,            -- true to suppress notifications
  }

Package manager : LazyNvim
Actually using lsp-zero if it can help

Steps to reproduce

.

Versions

NVIM v0.10.0-dev-1379+ga8fc94a2f-dirty Build type: RelWithDebInfo LuaJIT 2.1.1696795921

Not worked

I've read TROUBLESHOOTING instructions

  • Yes

Summary

Hello, I install lsp-timeout and config it by lazy.nvim, but it seems not worked.

Steps to reproduce

I using below config

        {
            "hinell/lsp-timeout.nvim",
            init = function()
                vim.g["lsp-timeout-config"] = {
                    stopTimeout = 1000,        -- Stop unused lsp servers after 1s (for testing).
                    startTimeout = 2000,             -- Force server restart if nvim can't in 2s.
                    silent = true,                   -- Notifications disabled
                    filetypes = {                    -- Exclude servers that miss behave on LSP stop/start.
                        ignore = { 'markdown', 'java' }
                    },
                }
            end,
            config = function ()
            end,
            dependencies = { "neovim/nvim-lspconfig" },
        },

When I run the LspInfo command, the lsp is always active.

I have focused on Nvim-tree, but lua_ls is still actived.
image

Versions

NVIM v0.10.0-dev-2000+g6fa0f303d
Build type: RelWithDebInfo
LuaJIT 2.1.1703358377

Specify operating system/environment

macos

New bug report

Summary

On neovim 0.94 I am getting an error message that comes up any time my neovim window loses focus:

Error detected while processing FocusLost Autocommands for "*":
Error executing lua callback: .../share/nvim/lazy/lsp-timeout.nvim/plugin/lsp-timeout.lua:83: attempt to call field 'get_clients' (a nil value)
stack traceback:
.../share/nvim/lazy/lsp-timeout.nvim/plugin/lsp-timeout.lua:83: in function <.../share/nvim/lazy/lsp-timeout.nvim/plugin/lsp-timeout.lua:72>

I'm loading lsp-timeout with lazy and this error comes up as soon as I switch away from my terminal.

Steps to reproduce

Launch neovim in terminal, open a file (or don't), then switch to another app.

Versions

Neovim 0.94

Does not work with `zbirenbaum/copilot.lua`

I've read TROUBLESHOOTING instructions

  • Yes

Summary

This plugin works fantastically well with every LSP server, but it seems to mess with Copilot when timing out all servers. When restarting, Copilot does not work again and querying its status simply outputs "Offline". Attempting to manually re-trigger Copilot (e.g., Copilot! attach) also outputs "Offline" and does not restart Copilot. I need to quit nvim and launch it again for Copilot to work. Any idea why this happens? Is there any way to also restart Copilot?

Steps to reproduce

Use this plugin along with zbirenbaum/copilot.lua, wait for this plugin to timeout the servers and then attempt to use Copilot again.

zbirenbaum/copilot.lua config:

require("copilot").setup({
  panel = {
    enabled = true,
    auto_refresh = true,
    keymap = {
      jump_prev = "[[",
      jump_next = "]]",
      accept = "<CR>",
      refresh = "R",
      open = "<M-c>",
    },
    layout = {
      position = "right",
      ratio = 0.3,
    },
  },
  suggestion = {
    enabled = true,
    auto_trigger = true,
    keymap = {
      accept = "<M-l>",
      next = "<M-]>",
      prev = "<M-[>",
      dismiss = "<M-h>",
    },
  },
  filetypes = {
    yaml = true,
    markdown = true,
    help = false,
    gitcommit = true,
    gitrebase = true,
    hgcommit = true,
    svn = true,
    cvs = true,
    ["."] = false,
  },
  server_opts_overrides = {
    autostart = true,
  },
})

This plugin's config is the default one.

Versions

nvim v0.10, latest versions of zbirenbaum/copilot.lua and this plugin.

Specify operating system/environment

MacOS

null-ls sources don't reload after restoring lsp clients

Summary

This is my :NullLsInfo when I open my file (it's loading beautysh).

screenshot_2023-10-16_05-22-47_969674073

And this is the same lsp-timeout reload the clients (it doesn't load it anymore)
screenshot_2023-10-16_05-22-28_698973754

Just to clarify, null-ls itself works fine (for example, on C, it will work correctly after restoring lsp-timeout because it don't require sources).

If you could try to reproduce, I would be thankful.

Steps to reproduce

When restoring, you should be able to reproduce.

Versions

  • "lsp-timeout.nvim", version = "1.0.1"
  • "nvimtools/none-ls.nvim", commit = "f39f627bbdfb33cc4ae4a95b4708e7dba7b9aafc"
  • "jay-babu/mason-null-ls.nvim", version = "^2"

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.