mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-16 14:34:08 +02:00
feat(treesitter): support for objdump files (#320)
* Added aerial queries for objdump Added objdump to minimal_init.lua * ci: tests fail if changes to snapshot files * cleanup: comments on test filetype special cases * test: add objdump test snapshots --------- Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
This commit is contained in:
parent
3a3baf0930
commit
eb301a4763
6 changed files with 62 additions and 4 deletions
7
.github/workflows/tests.yml
vendored
7
.github/workflows/tests.yml
vendored
|
@ -72,6 +72,13 @@ jobs:
|
|||
run: |
|
||||
bash ./run_tests.sh
|
||||
|
||||
- name: Check for changes
|
||||
run: |
|
||||
git add tests
|
||||
git diff --quiet --staged || echo "Changes to snapshot file detected. Run 'make update_snapshots' and commit the changes"
|
||||
git diff --stat --staged
|
||||
git diff --quiet --staged
|
||||
|
||||
update_docs:
|
||||
name: Update docs
|
||||
runs-on: ubuntu-22.04
|
||||
|
|
|
@ -154,6 +154,7 @@ In addition, you will need to have either Treesitter or a working LSP client. Yo
|
|||
- make
|
||||
- markdown
|
||||
- norg
|
||||
- objdump
|
||||
- org
|
||||
- php
|
||||
- proto
|
||||
|
|
7
queries/objdump/aerial.scm
Normal file
7
queries/objdump/aerial.scm
Normal file
|
@ -0,0 +1,7 @@
|
|||
(disassembly_section_label
|
||||
(identifier) @name
|
||||
(#set! "kind" "Interface")) @type
|
||||
|
||||
(disassembly_section
|
||||
(identifier) @name
|
||||
(#set! "kind" "Function")) @type
|
|
@ -3,11 +3,13 @@ vim.cmd([[set runtimepath+=.]])
|
|||
vim.o.swapfile = false
|
||||
vim.bo.swapfile = false
|
||||
vim.filetype.add({
|
||||
-- Neovim doesn't have built-in filetype detection for these filetypes
|
||||
extension = {
|
||||
norg = "norg", -- Neovim doesn't have built-in norg filetype detection
|
||||
usd = "usd", -- Neovim doesn't have built-in USD filetype detection
|
||||
usda = "usd", -- Neovim doesn't have built-in USD filetype detection
|
||||
smk = "snakemake", -- Neovim doesn't have built-in Snakemake filetype detection
|
||||
norg = "norg",
|
||||
objdump = "objdump",
|
||||
usd = "usd",
|
||||
usda = "usd",
|
||||
smk = "snakemake",
|
||||
},
|
||||
})
|
||||
|
||||
|
|
32
tests/symbols/objdump_test.json
Normal file
32
tests/symbols/objdump_test.json
Normal file
|
@ -0,0 +1,32 @@
|
|||
[
|
||||
{
|
||||
"col": 0,
|
||||
"end_col": 29,
|
||||
"end_lnum": 1,
|
||||
"kind": "Interface",
|
||||
"level": 0,
|
||||
"lnum": 1,
|
||||
"name": ".text",
|
||||
"selection_range": {
|
||||
"col": 23,
|
||||
"end_col": 28,
|
||||
"end_lnum": 1,
|
||||
"lnum": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"col": 0,
|
||||
"end_col": 91,
|
||||
"end_lnum": 9,
|
||||
"kind": "Function",
|
||||
"level": 0,
|
||||
"lnum": 3,
|
||||
"name": "<engine::world::World::createEntity()>",
|
||||
"selection_range": {
|
||||
"col": 17,
|
||||
"end_col": 55,
|
||||
"end_lnum": 3,
|
||||
"lnum": 3
|
||||
}
|
||||
}
|
||||
]
|
9
tests/treesitter/objdump_test.objdump
Normal file
9
tests/treesitter/objdump_test.objdump
Normal file
|
@ -0,0 +1,9 @@
|
|||
Disassembly of section .text:
|
||||
|
||||
0000000000000000 <engine::world::World::createEntity()> (File Offset: 0x70):
|
||||
_ZN6engine5world5World12createEntityEv():
|
||||
/home/selecaoone/repositories/jumpy/engine/src/lib/world.cpp:14
|
||||
0: 48 89 f8 mov rax,rdi
|
||||
_ZNKSt15__uniq_ptr_implIN6engine13entityManager13EntityManagerESt14default_deleteIS2_EE6_M_ptrEv():
|
||||
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/unique_ptr.h:154
|
||||
3: 48 8b 4f 40 mov rcx,QWORD PTR [rdi+0x40]
|
Loading…
Reference in a new issue