Comments (4)
I am very skeptical that the LSP is returning items in a hierarchy, when LSP servers do that we display the symbols in a hierarchy.
First, double check that your LSP server is up-to-date, then run :LspInfo
to confirm that only intelephense is attached to your buffer. Then, run the following code (preferably on a small sample file):
local bufnr = vim.api.nvim_get_current_buf()
local params = { textDocument = vim.lsp.util.make_text_document_params(bufnr) }
local client = vim.lsp.get_active_clients({ bufnr = bufnr })[1]
client.request("textDocument/documentSymbol", params, function(err, result, ctx, config)
vim.print(result)
end, bufnr)
This should print some output (which you can see with :messages
), which will allow us to see the raw data that the server is actually giving us.
from aerial.nvim.
I'm not really familiar with how LSP works but based on this output I think LSP is fine...
This is the code I tested it on with the aerial outline near:
And this is the output of the code:
{ {
kind = 5,
location = {
range = {
["end"] = {
character = 1,
line = 30
},
start = {
character = 6,
line = 2
}
},
uri = "file:///home/mahdi/Documents/aerial/main.php"
},
name = "Calculator"
}, {
containerName = "Calculator",
kind = 7,
location = {
range = {
["end"] = {
character = 16,
line = 5
},
start = {
character = 9,
line = 5
}
},
uri = "file:///home/mahdi/Documents/aerial/main.php"
},
name = "$result"
}, {
containerName = "Calculator",
kind = 9,
location = {
range = {
["end"] = {
character = 3,
line = 11
},
start = {
character = 18,
line = 8
}
},
uri = "file:///home/mahdi/Documents/aerial/main.php"
},
name = "__construct"
}, {
containerName = "Calculator",
kind = 6,
location = {
range = {
["end"] = {
character = 3,
line = 17
},
start = {
character = 18,
line = 14
}
},
uri = "file:///home/mahdi/Documents/aerial/main.php"
},
name = "add"
}, {
containerName = "add",
kind = 13,
location = {
range = {
["end"] = {
character = 26,
line = 14
},
start = {
character = 22,
line = 14
}
},
uri = "file:///home/mahdi/Documents/aerial/main.php"
},
name = "$num"
}, {
containerName = "Calculator",
kind = 6,
location = {
range = {
["end"] = {
character = 3,
line = 23
},
start = {
character = 18,
line = 20
}
},
uri = "file:///home/mahdi/Documents/aerial/main.php"
},
name = "subtract"
}, {
containerName = "subtract",
kind = 13,
location = {
range = {
["end"] = {
character = 31,
line = 20
},
start = {
character = 27,
line = 20
}
},
uri = "file:///home/mahdi/Documents/aerial/main.php"
},
name = "$num"
}, {
containerName = "Calculator",
kind = 6,
location = {
range = {
["end"] = {
character = 3,
line = 29
},
start = {
character = 18,
line = 26
}
},
uri = "file:///home/mahdi/Documents/aerial/main.php"
},
name = "getResult"
}, {
kind = 13,
location = {
range = {
["end"] = {
character = 5,
line = 33
},
start = {
character = 0,
line = 33
}
},
uri = "file:///home/mahdi/Documents/aerial/main.php"
},
name = "$calc"
} }
from aerial.nvim.
This is using the deprecated SymbolInformation structure for the symbols, which cannot provide a hierarchy. From the spec:
SymbolInformation[]
which is a flat list of all symbols found in a given text document. Then neither the symbol’s location range nor the symbol’s container name should be used to infer a hierarchy.
Allegedly Intelephense migrated off of that to DocumentSymbol in 2019 (source). You could try filing an issue with Intelephense asking if they could update their document symbol provider, but there's nothing aerial can do about this.
from aerial.nvim.
Oh, I thought the containerName
in every single block is the parent of that symbol.
Anyway thank you so much for your response and the time you spent on this issue, I appreciate it so much.
from aerial.nvim.
Related Issues (20)
- bug: "AerialOpen float" is always empty, but "left" and "right" work HOT 11
- bug: :bdelete will crash or close nvim when an inactive Aerial buffer is open HOT 1
- Help with xml query HOT 1
- Question HOT 1
- bug: Floating window is closed when jump even with `close_on_select = false` HOT 2
- bug: Missing symbols when using treesitter as backend HOT 1
- Missing treesitter symbols for javascript HOT 1
- feature request: same method in sub- and/or in super-class; display all the methods of a class including inherited ones HOT 3
- bug: lua/aerial/util.lua:236: attempt to index local 'ignore' (a nil value) HOT 1
- bug: golang missing variables, constants, fields if functions or structs are enabled
- bug: telescope aerial stays at mid HOT 5
- bug: `:AerialToggle` does nothing while the cursor in inside `:Neotree` HOT 1
- Support for filtering by tags in the telescope
- feature request: add option to not ignore diff windows
- feature request: workspace-level symbols HOT 2
- bug: need to delete the keymaps before mapping a new one HOT 1
- bug: `julia` treesitter queries broken after latest `nvim-treesitter` update
- feature request: autofocus while toggle HOT 2
- Missing symbols for YAML with treesitter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aerial.nvim.