Giter VIP home page Giter VIP logo

Comments (11)

chemzqm avatar chemzqm commented on June 14, 2024 1

Also checkout https://github.com/neoclide/coc.nvim/wiki/Statusline-integration for include g:coc_status in your statusline, so you can see the server status.

from coc-rls.

chemzqm avatar chemzqm commented on June 14, 2024 1

The example is used in languageserver section, but you don't need that when using extension, I should update the example.

from coc-rls.

oblitum avatar oblitum commented on June 14, 2024

It may be unrelated to your issue. This doesn't happen for me with Rust, completion is working fine, at least so far on the code I've tried until now, but the same thing happens for me when using coc-pyls, and it always happen when I open a script outside of its directory, like vim ~/.local/bin/foo.py instead of cd ~/.local/bin && vim foo.py. The latter works fine, the former hangs. But I think it may possibly be a pyls issue.

You may try describe whether that affects you. You should also state whether it happens for specific source code and not for other cases, in that case, you should post it (it will be probably a RLS issue though).

from coc-rls.

chemzqm avatar chemzqm commented on June 14, 2024

500ms is too low, server could be slow sometimes.
Try change coc.preferences.timeout to 2000 in your coc-settings.json.

from coc-rls.

dakom avatar dakom commented on June 14, 2024

Thanks!

Followup: I do get auto-complete in Rust for core things - but it doesn't seem to work for imported crates properly.

I'm very new to Rust and getting into it by way of Wasm so maybe things are getting confused by the presence of both Cargo.toml and tsconfig.json in the project root?

Here's the stuff I've added to my config now:

coc-settings.json

{
  "coc.preferences.timeout": 5000,
  "coc.preferences.acceptSuggestionOnCommitCharacter": true,
  "tslint.enable": false,
  "coc.preferences.autoTrigger": "always"
}

init.vim

"Status line
function! StatusDiagnostic() abort
  let info = get(b:, 'coc_diagnostic_info', {})
  if empty(info) | return '' | endif
  let msgs = []
  if get(info, 'error', 0)
    call add(msgs, 'E' . info['error'])
  endif
  if get(info, 'warning', 0)
    call add(msgs, 'W' . info['warning'])
  endif
  return join(msgs, ' '). ' ' . get(g:, 'coc_status', '')
endfunction

" Airline statusline integration
let g:airline_section_error = '%{airline#util#wrap(StatusDiagnostic(),0)}'

Btw the airline just shows "RLS" - and flashes through some other stuff as I type... not sure the right way to set that up either.. sorry!

from coc-rls.

chemzqm avatar chemzqm commented on June 14, 2024

Seems g:airline_section_error could only be number, there should be some way to integrate a custom varialbe or function with ariline, but I don't know either.

Could be RLS have trouble when analyzing your project, you can get the output channel: https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

from coc-rls.

dakom avatar dakom commented on June 14, 2024

Oh interesting... it seems I am getting info for some third-party crates but not others!

Could be just my lack of Rust knowledge and maybe I'm doing something wrong... don't want to take this thread off-track so feel free to close it, since completions are definitely coming through for at least some crates :)

Out of curiousity -
I don't see anything with :CocCommand workspace.showOutput.. is there a window I need to open?

Also, is this a legal coc-settings.json? I get a warning that tsserver and rls are invalid keys:

{
  "coc.preferences.timeout": 5000,
  "coc.preferences.acceptSuggestionOnCommitCharacter": true,
  "tslint.enable": false,
  "coc.preferences.autoTrigger": "always",
  "rls": {
      "command": "rustup",
      "trace.server": "verbose",
      "args": ["run", "nightly", "rls"],
      "filetypes": ["rust"],
      "settings": {}
    }
}

Thanks again!

from coc-rls.

chemzqm avatar chemzqm commented on June 14, 2024

The configuration is invalid, for coc-rls, checkout https://github.com/neoclide/coc-rls#configuration for configuration keys you can use.

from coc-rls.

dakom avatar dakom commented on June 14, 2024

Oh- does this not contradict the example in https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel ?

from coc-rls.

oblitum avatar oblitum commented on June 14, 2024

It may be unrelated to your issue. This doesn't happen for me with Rust, completion is working fine, at least so far on the code I've tried until now, but the same thing happens for me when using coc-pyls, and it always happen when I open a script outside of its directory, like vim ~/.local/bin/foo.py instead of cd ~/.local/bin && vim foo.py. The latter works fine, the former hangs. But I think it may possibly be a pyls issue.

For what is worth, that's not happening anymore, issue is gone.

from coc-rls.

chemzqm avatar chemzqm commented on June 14, 2024

Rls can't response when it's busy, make sure your have statueline integration to get the status, checkout :h coc-status.

from coc-rls.

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.