Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoimport doesn't work #609

Open
h4-h opened this issue Oct 24, 2023 · 2 comments
Open

Autoimport doesn't work #609

h4-h opened this issue Oct 24, 2023 · 2 comments

Comments

@h4-h
Copy link

h4-h commented Oct 24, 2023

Autoimport doesn't work until I import something it doesn't appear in autocompletion, also for rust coq doesn't create use statements i.e. if I write HashMap it should add use std::collections::HashMap, idk what causes it...

examples with rust and typescript):

examples.mp4

init.lua

return require('packer').startup(function(use)
  use 'wbthomason/packer.nvim' 

  use {
    'nvim-treesitter/nvim-treesitter',
    run = ':TSUpdate',
    requires = {
      'neovim/nvim-lspconfig'
    }
  }

  use {
    'ms-jpq/coq_nvim',
    branch = 'coq',
    requires = {
      'ms-jpq/coq.artifacts'
    }
  }
end)

settings

require('nvim-treesitter.configs').setup({
  ensure_installed = { },
  sync_install = false,
  auto_install = true,
  ignore_install = { },
  highlight = {
    enable = true,
    additional_vim_regex_highlighting = false,
  },
  ident = {
    enable = true,
  }
})

vim.g.coq_settings = {
  auto_start = 'shut-up',
  clients = {
    snippets = {
      enabled = true,
      weight_adjust = 2,
    },
    lsp = {
      enabled = true,
      resolve_timeout = 2,
      weight_adjust = 1.75,
    },
    tree_sitter = {
      enabled = true,
      weight_adjust = 1.5,
    },
    paths = {
      path_seps = { '\\', '/' },
    },
  },
  keymap = {
    pre_select = true,
  },
}

local lspconfig = require('lspconfig')
local coq = require('coq')

local clients = { 'tsserver', 'rust_analyzer' }
for _, client in ipairs(clients) do
  lspconfig[client].setup(
    coq.lsp_ensure_capabilities({ on_attach = on_attach })
  )
end

vim.cmd([[COQnow -s]])
@azuline
Copy link

azuline commented Oct 25, 2023

i remember this working before, but i'm also experiencing this issue now.

i'm trying to bisect previous commits in order to figure out where the bug was introduced, but i can't COQdeps before july due to a forced time-based setuptools deprecation.

i'm honestly more pissed at setuptools right now than coq lol!

@Aonodensetsu
Copy link

Aonodensetsu commented Nov 9, 2023

auto_start seems not to work, but i put vim.cmd[[COQnow --shut-up]] at the bottom of the config function and it works fine now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants