Giter VIP home page Giter VIP logo

Comments (9)

chemzqm avatar chemzqm commented on June 14, 2024

coc-rls has problem with reading the true WORKINGDIR.

It doesn't use cwd, it resolve Cargo.toml from current file.

I can't reproduce the problem. Consider upload full output by use "tsserver.trace.server": "verbose", in configuration: "tsserver.trace.server": "verbose",

from coc-rls.

Ionizing avatar Ionizing commented on June 14, 2024

Sorry, I followed your step, but cannot get log as a result of "tsserver.xxx command not found".
But I tried to config rls in coc-settings.json as following:

        "rls": {
            "command": "rustup",
            "args": ["run", "nightly", "rls"],
            "filetypes": ["rust"],
            "settings": {},
            "enable": true,
            "trace.server": "verbose"
        }

The problem was reproduced, and I got the log here:

https://paste.ubuntu.com/p/8xvWPY8XDr/

from coc-rls.

chemzqm avatar chemzqm commented on June 14, 2024

Do you have Cargo.toml file in directory file:///Users/ionizing/Documents/tests/rusttest/CLRS ?
Maybe your cargo is just too old, and it can't generate the file for you, try upgrade.

from coc-rls.

Ionizing avatar Ionizing commented on June 14, 2024

No. Cargo.toml exists in file:///Users/ionizing/Documents/tests/rusttest/CLRS/coctest, and the rust project root directory is file:///Users/ionizing/Documents/tests/rusttest/CLRS/coctest. When I delete the .git/ in CLRS, both coc-rls and rls works well.

from coc-rls.

chemzqm avatar chemzqm commented on June 14, 2024

I've fixed this issue in coc-rls, to fix the problem with configuration, you need to add "rootPatterns": ["Cargo.toml"], to rls section.

from coc-rls.

Ionizing avatar Ionizing commented on June 14, 2024

I found a workaround: cd into the root dir of project, open src files via NERDTree and Cargo.toml can be found correctly.

from coc-rls.

mike-kfed avatar mike-kfed commented on June 14, 2024

I ran into this today... This only happens when you have a git project with multiple rust crates inside, because the default rootPatterns look for the .git directory. Which makes it work without config by chance on "normal" rust crates, because they likely happen to have a .git dir at the same root as the Cargo.toml.

to make this work for sub-crates I opened the config of coc in vim with command :CocConfig and pasted this:

{
	"languageserver": {
		"rls": {
			"command": "rustup",
			"args": ["run", "nightly", "rls"],
			"filetypes": ["rust"],
			"rootPatterns": ["Cargo.toml"]
		}
	}
}

this seems to be the minimal config to make it work. I don't fully understand how the coc-rls plugs into coc, but I'd vote for injecting the "Cargo.toml" into rootPatterns by default when the coc-rls is loaded. This way it actually looks for the cargo.toml in every case, and no custom config file writing is necessary (just having languageserver -> rls -> rootPatterns is not enough, all of the above is needed, probably causing other side-effects?)

from coc-rls.

chemzqm avatar chemzqm commented on June 14, 2024

https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders

from coc-rls.

mike-kfed avatar mike-kfed commented on June 14, 2024

thanks, now using autocmd FileType rust let b:coc_root_patterns = ['Cargo.toml', '.git'] in .vimrc

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.