Closed alexbet closed 7 months ago
Looks like a bug in BracketFlasher package.
Looks like a bug in BracketFlasher package.
I disabled the Bracket Flasher package, restarted Sublime, but the problem remains.
I followed everything and everything seems fine, except it errors out. Here is the output from the LSP diagnostics:
error: error: The following required arguments were not provided:
<command>...
USAGE:
rustup run
For more information try --help
## Server Configuration
- command
```json
[
"rustup",
"run",
"rust-analyzer"
]
rustup run rust-analyzer
source.rust
source.rust
{}
{
"rust-analyzer": {
"assist": {
"emitMustUse": false,
"expressionFillDefault": "todo"
},
"cachePriming": {
"enable": true,
"numThreads": 0
},
"cargo": {
"autoreload": true,
"buildScripts": {
"enable": true,
"invocationLocation": "workspace",
"invocationStrategy": "per_workspace",
"overrideCommand": null,
"rebuildOnSave": false,
"useRustcWrapper": true
},
"cfgs": {},
"extraArgs": [],
"extraEnv": {},
"features": [],
"noDefaultFeatures": false,
"sysroot": "discover",
"sysrootQueryMetadata": false,
"sysrootSrc": null,
"target": null,
"unsetTest": [
"core"
]
},
"cargoRunner": null,
"check": {
"allTargets": true,
"command": "check",
"extraArgs": [],
"extraEnv": {},
"features": null,
"ignore": [],
"invocationLocation": "workspace",
"invocationStrategy": "per_workspace",
"noDefaultFeatures": null,
"overrideCommand": null,
"targets": null
},
"checkOnSave": "clippy",
"completion": {
"autoimport": {
"enable": true
},
"autoself": {
"enable": true
},
"callable": {
"snippets": "fill_arguments"
},
"fullFunctionSignatures": {
"enable": false
},
"limit": null,
"postfix": {
"enable": true
},
"privateEditable": {
"enable": false
},
"snippets": {
"custom": {
"Arc::new": {
"body": "Arc::new(${receiver})",
"description": "Put the expression into an `Arc`",
"postfix": "arc",
"requires": "std::sync::Arc",
"scope": "expr"
},
"Box::pin": {
"body": "Box::pin(${receiver})",
"description": "Put the expression into a pinned `Box`",
"postfix": "pinbox",
"requires": "std::boxed::Box",
"scope": "expr"
},
"Err": {
"body": "Err(${receiver})",
"description": "Wrap the expression in a `Result::Err`",
"postfix": "err",
"scope": "expr"
},
"Ok": {
"body": "Ok(${receiver})",
"description": "Wrap the expression in a `Result::Ok`",
"postfix": "ok",
"scope": "expr"
},
"Rc::new": {
"body": "Rc::new(${receiver})",
"description": "Put the expression into an `Rc`",
"postfix": "rc",
"requires": "std::rc::Rc",
"scope": "expr"
},
"Some": {
"body": "Some(${receiver})",
"description": "Wrap the expression in an `Option::Some`",
"postfix": "some",
"scope": "expr"
}
}
}
},
"diagnostics": {
"disabled": [
"unresolved-proc-macro"
],
"enable": true,
"experimental": {
"enable": false
},
"remapPrefix": {},
"useRustcErrorCode": false,
"warningsAsHint": [],
"warningsAsInfo": []
},
"files": {
"excludeDirs": [],
"watcher": "client"
},
"highlightRelated": {
"breakPoints": {
"enable": true
},
"closureCaptures": {
"enable": true
},
"exitPoints": {
"enable": true
},
"references": {
"enable": true
},
"yieldPoints": {
"enable": true
}
},
"hover": {
"actions": {
"debug": {
"enable": true
},
"enable": true,
"gotoTypeDef": {
"enable": true
},
"implementations": {
"enable": true
},
"references": {
"enable": false
},
"run": {
"enable": true
}
},
"documentation": {
"enable": true,
"keywords": {
"enable": true
}
},
"links": {
"enable": true
},
"memoryLayout": {
"alignment": "hexadecimal",
"enable": true,
"niches": false,
"offset": "hexadecimal",
"size": "both"
}
},
"imports": {
"granularity": {
"enforce": false,
"group": "crate"
},
"group": {
"enable": true
},
"merge": {
"glob": true
},
"preferNoStd": false,
"preferPrelude": false,
"prefix": "plain"
},
"inlayHints": {
"bindingModeHints": {
"enable": false
},
"chainingHints": {
"enable": true
},
"closingBraceHints": {
"enable": true,
"minLines": 25
},
"closureCaptureHints": {
"enable": false
},
"closureReturnTypeHints": {
"enable": "never"
},
"closureStyle": "impl_fn",
"discriminantHints": {
"enable": "never"
},
"expressionAdjustmentHints": {
"enable": "never",
"hideOutsideUnsafe": false,
"mode": "prefix"
},
"implicitDrops": {
"enable": false
},
"lifetimeElisionHints": {
"enable": "never",
"useParameterNames": false
},
"maxLength": 25,
"parameterHints": {
"enable": true
},
"rangeExclusiveHints": {
"enable": false
},
"reborrowHints": {
"enable": "never"
},
"renderColons": true,
"typeHints": {
"enable": true,
"hideClosureInitialization": false,
"hideNamedConstructor": false
}
},
"interpret": {
"tests": false
},
"joinLines": {
"joinAssignments": true,
"joinElseIf": true,
"removeTrailingComma": true,
"unwrapTrivialBlock": true
},
"lens": {
"debug": {
"enable": false
},
"enable": true,
"forceCustomCommands": true,
"implementations": {
"enable": true
},
"location": "above_name",
"references": {
"adt": {
"enable": false
},
"enumVariant": {
"enable": false
},
"method": {
"enable": false
},
"trait": {
"enable": false
}
},
"run": {
"enable": true
}
},
"linkedProjects": [],
"lru": {
"capacity": null,
"query": {
"capacities": {}
}
},
"notifications": {
"cargoTomlNotFound": true
},
"numThreads": null,
"procMacro": {
"attributes": {
"enable": true
},
"enable": true,
"ignored": {},
"server": null
},
"references": {
"excludeImports": false
},
"rename": {
"allowExternalItems": false
},
"restartServerOnConfigChange": false,
"runnables": {
"command": null,
"extraArgs": [],
"extraEnv": null
},
"rust": {
"analyzerTargetDir": null
},
"rustc": {
"source": null
},
"rustfmt": {
"extraArgs": [],
"overrideCommand": null,
"rangeFormatting": {
"enable": false
}
},
"semanticHighlighting": {
"doc": {
"comment": {
"inject": {
"enable": true
}
}
},
"nonStandardTokens": true,
"operator": {
"enable": true,
"specialization": {
"enable": false
}
},
"punctuation": {
"enable": false,
"separate": {
"macro": {
"bang": false
}
},
"specialization": {
"enable": false
}
},
"strings": {
"enable": true
}
},
"signatureInfo": {
"detail": "full",
"documentation": {
"enable": true
}
},
"terminusAutoClose": false,
"terminusUsePanel": false,
"typing": {
"autoClosingAngleBrackets": {
"enable": false
},
"continueCommentsOnNewline": true
},
"workspace": {
"symbol": {
"search": {
"kind": "only_types",
"limit": 128,
"scope": "workspace"
}
}
}
}
}
{}
/Users/alexbet/Desktop/_Rust/hello_cargo/src/main.rs
{
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin, text.html.basic",
"lsp_active": null,
"syntax": "Packages/Rust/Rust.sublime-syntax"
}
source.rust
[
"/Users/alexbet/Desktop/_Rust"
]
{
"folders": [
{
"path": "."
}
]
}
{
"clients": {
"rust-analyzer": {
"command": [
"rust-analyzer"
],
"enabled": true
},
"serve-d": {
"command": [
"/Users/alexbet/.config/serve-d/serve-d"
],
"enabled": true,
"selector": "source.d",
"settings": {
"d.aggressiveUpdate": false,
"d.completeNoDupes": true,
"d.dcdClientPath": "/Users/alexbet/.config/serve-d/serve-d",
"d.dcdServerPath": "/Users/alexbet/.config/serve-d/serve-d",
"d.enableAutoComplete": true,
"d.manyProjectsAction": "load",
"d.servedReleaseChannel": "stable"
}
}
},
"show_inlay_hints": false
}
Just in case someone has this same problem, I figured it out. It seems like there was a problem with permissions of some of the files in the ~/.npm/_cacache folder. When I flushed the NPM cache, everything started working well..
rust-analyzer (or rustup) should have nothing to do with npm. I don't think that was the problem.
The error is pretty clear from the output. You have defined a custom command that doesn't work:
error: error: The following required arguments were not provided:
<command>...
USAGE:
rustup run <toolchain> <command>...
For more information try --help
If you run rustup run rust-analyzer
in the terminal you will likely get the same error.
Also don't add a rust-analyzer
object to LSP global settings. LSP-rust-analyzer has its own settings.
I would suggest:
rust-analyzer
from global settingscommand
in LSP-rust-analyzer
settings to rust-analyzer
only.
Whenever I open a rust file, rust-analyzer is crashing. This is the error that I am getting:
How can I fix this?