-
Notifications
You must be signed in to change notification settings - Fork 32
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
Outline view is rendered as a flat list rather than a nested (tree) structure. #268
Comments
Can you please share in the log that response to the |
This sounds more like RLS issue than corrosion. |
Here's a snippet from a public project (cannot disclose details about my private ones) The information seems to be there, but laid out in a weird way. Is //! Result and Error types.
use std::ffi::CStr;
/// Error type for this crate.
#[derive(Debug, Clone)]
pub enum Error {
/// A generic error, with a description string.
Generic(String),
}
impl Error {
/// Construct an `Error` from a malloc-allocated C string, then free the C string.
pub(crate) fn take(x: *const libc::c_char) -> Self {
unsafe {
let msg = CStr::from_ptr(x).to_string_lossy().into_owned();
libc::free(x as *mut _);
Error::Generic(msg)
}
}
}
impl std::error::Error for Error {
fn description(&self) -> &str {
use self::Error::*;
match *self {
Generic(ref x) => x,
}
}
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
use self::Error::*;
match *self {
Generic(ref x) => f.pad(x),
}
}
}
/// Result type for this crate.
pub type Result<T> = std::result::Result<T, Error>;
|
{
"jsonrpc": "2.0",
"id": "11",
"result": [
{
"name": "Generic",
"kind": 22,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 8,
"character": 4
},
"end": {
"line": 8,
"character": 11
}
}
},
"containerName": "Error"
},
{
"name": "Error",
"kind": 10,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 6,
"character": 9
},
"end": {
"line": 6,
"character": 14
}
}
},
"containerName": "error"
},
{
"name": "__self_0",
"kind": 13,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 8,
"character": 12
},
"end": {
"line": 8,
"character": 18
}
}
}
},
{
"name": "__self_0",
"kind": 13,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 8,
"character": 12
},
"end": {
"line": 8,
"character": 18
}
}
}
},
{
"name": "x",
"kind": 13,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 13,
"character": 23
},
"end": {
"line": 13,
"character": 24
}
}
}
},
{
"name": "take",
"kind": 6,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 13,
"character": 18
},
"end": {
"line": 13,
"character": 22
}
}
}
},
{
"name": "msg",
"kind": 13,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 15,
"character": 16
},
"end": {
"line": 15,
"character": 19
}
}
}
},
{
"name": "self",
"kind": 13,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 23,
"character": 20
},
"end": {
"line": 23,
"character": 24
}
}
}
},
{
"name": "description",
"kind": 6,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 23,
"character": 7
},
"end": {
"line": 23,
"character": 18
}
}
},
"containerName": "Error"
},
{
"name": "x",
"kind": 13,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 26,
"character": 24
},
"end": {
"line": 26,
"character": 25
}
}
}
},
{
"name": "self",
"kind": 13,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 32,
"character": 12
},
"end": {
"line": 32,
"character": 16
}
}
}
},
{
"name": "f",
"kind": 13,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 32,
"character": 18
},
"end": {
"line": 32,
"character": 19
}
}
}
},
{
"name": "fmt",
"kind": 6,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 32,
"character": 7
},
"end": {
"line": 32,
"character": 10
}
}
},
"containerName": "Display"
},
{
"name": "x",
"kind": 13,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 35,
"character": 24
},
"end": {
"line": 35,
"character": 25
}
}
}
},
{
"name": "Result",
"kind": 26,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 41,
"character": 9
},
"end": {
"line": 41,
"character": 15
}
}
},
"containerName": "error"
},
{
"name": "T",
"kind": 26,
"location": {
"uri": "file:///home/norru/Projects/3rdParty/openexr-rs/src/error.rs",
"range": {
"start": {
"line": 41,
"character": 16
},
"end": {
"line": 41,
"character": 17
}
}
}
}
]
} |
RLS is not implementing |
RLS implements |
The specification clearly states that the containerName is a "decoration" and isn't intended to be used to build a hierarchy. This is even more true for the example you shared because some container names reference elements that aren't local symbols in the file (like namespaces). |
@mickaelistria I do agree that the right course of action would be for RLS to implement |
Looks like the RLS team will implement |
Now that corrosion uses rust-analyzer is this one fixed for you? |
Closing due to lack of interest from reporter. |
Outline view is rendered as a flat list rather than a nested (tree) structure.
The text was updated successfully, but these errors were encountered: