marskey / telescope-sg Goto Github PK
View Code? Open in Web Editor NEWAst-grep picker for telescop.nvim
Ast-grep picker for telescop.nvim
Hi,
I've installed and tested the extension, but nothing it returns as a result:
but when I run the command in terminal, it produces results:
$ ast-grep --json -p '$A()'
...
"file": "./static/tabbed-0.7/tabbed.c",
"language": "C",
"metaVariables": {
"single": {
"A": {
"text": "cleanup",
"range": {
"byteOffset": {
"start": 29639,
"end": 29646
},
"start": {
"line": 1371,
"column": 1
},
"end": {
"line": 1371,
"column": 8
}
}
}
},
"multi": {},
"transformed": {}
}
}
]
Config:
ast_grep: 0.9.1
NVIM v0.9.1
ast_grep = {
command = {
"ast-grep",
"--json",
"-p",
},
grep_open_files = false,
lang = nil,
},
...
require("telescope").load_extension("ast_grep")
Because first search is for $ which takes lots of time.
Tested in Windows/WSL.
Some form of manual confirming to start searching when I entered my query would be nice.
What colorschme is in use?
the only thing preventing me from installing this plugin is that it requires an imperatively installed global dependency (npm i -g @ast-grep/cli
).
This is easy to forget when setting up a new machine (because I might have f'd up my configs again ๐ ).
Is there a way to get packer or sth else to install the dependency for me, in a declarative way?
I get [telescope.run_command]: Unknown command
with the following config in after/telescope.lua
:
require("telescope").setup {
extensions = {
ast_grep = {
command = {
"ast-grep",
"--json=stream",
},
grep_open_files = false,
lang = nil,
},
}
}
I get this error in :messages :
[telescope] [WARN 11:04:31] /Users/.../.local/share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:489: Fin
der failed with msg: ...lazy/telescope-sg/lua/telescope/_extensions/ast_grep.lua:99: attempt to get length of local
'icon' (a nil value)
The Telescope picker window is empty:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.