Comments (16)
settagstack()
/gettagstack()
are added in Vim 8.1.0519.
You can implement the feature.
I will check the PR.
from vim-racer.
Could we add add-to-stack functionality to rust-def instead?
We cannot add/change the tag stack from Vim script.
from vim-racer.
OK. I have reopened. I don't work for it though.
from vim-racer.
I think you need to add the feature in the function.
And you must add the CTRL-T
keymapping for it.
https://github.com/racer-rust/vim-racer/blob/master/autoload/racer.vim#L176
from vim-racer.
I was about to report this also, but I see someone beat me to it.
from vim-racer.
tag stack is the builtin function.
So we cannot extend it.
from vim-racer.
Could we add add-to-stack functionality to rust-def
instead?
Don't know much of vim/neovim internals though :)
from vim-racer.
I guess this can be closed then. Thanks!
from vim-racer.
How does cscope modify the tag stack, or vim-go? I'd be interested in pursuing whatever route they ended up taking.
from vim-racer.
How does cscope modify the tag stack, or vim-go? I'd be interested in pursuing whatever route they ended up taking.
cscope is builtin function.
from vim-racer.
vim-go modify the tag stack?
Really? I will check it.
from vim-racer.
https://github.com/fatih/vim-go/blob/5db7dd6a618ffad89d270e97dbf47bf484747ad1/autoload/go/def.vim
vim-go does not change vim tag stack.
It just changes the jump list and the original stack.
from vim-racer.
If you can, pull request is wellcome.
from vim-racer.
@Shougo, even if you don't necessarily want to work on this yourself, I don't think this issue should be closed until there's a proper resolution, whether that resolution happens here or in Vim itself (see issue vim/vim#3336). Tag stack keybindings usually work in vim language integration plugins. I use jedi-vim (python), vim-go and tsuquyomi (typescript) nearly every day and they all support this functionality; it's pretty much par for the course.
If it helps anyone, I found a plugin (vim-tagimposter) that lets you simulate the needed functionality with the following mapping:
au FileType rust nmap <C-]> :<C-u> TagImposterAnticipateJump <Bar> :call racer#GoToDefinition()<CR>
It seems you can't do <Plug>(rust-def)
as it throws the dreaded "Trailing Characters" error.
CTRL-T
works, as does CTRL-]
. I ran into some trouble with functions that racer could not find - it puts it into the tag stack anyway. I will follow this up at the vim-tagimposter repo as well, maybe there's something silly I'm doing wrong. My vimscript knowledge is rudimentary at best. Here's a minimal reproducing example:
extern crate yep;
use std::io;
use std::io::prelude::*;
use std::fs::File;
fn main() -> io::Result<()> {
let mut f = File::open("file_that_totally_exists.txt")?;
let mut buffer = Vec::new();
f.read_to_end(&mut buffer)?;
Ok(())
}
If I try to jump to read_to_end
, racer does not find the definition but the tag still appears in :tags
and I have to pop it off myself with CTRL-T
.
Still, progress is progress; I hope this helps somebody.
from vim-racer.
No problem, that's totally reasonable, you've already done plenty for us by providing this plugin in the first place. Thank you for re-opening the issue.
I would hope that ultimately vim would be fixed to cater to this extremely common use case. If and when they fix vim, would you accept a PR to integrate with it?
from vim-racer.
If and when they fix vim, would you accept a PR to integrate with it?
Of course, yes. I will check the PR.
from vim-racer.
Related Issues (20)
- Colorscheme configuration in vim-racer HOT 1
- Preview is not getting close HOT 2
- Compilation error (Android, Termux) HOT 1
- I don't get the idea of that plugin HOT 1
- Should add an option to suppress stderr printout when racer panics HOT 8
- Unsure about completion behaviour HOT 1
- How to Jump back when go to definition. like ctrl+T. (not ctrl+o) HOT 6
- Error "E117: Unknown function: racer#RacerComplete HOT 9
- Autocomplete always pre-selects (auto-inserts) the first suggestion. HOT 2
- Option to change default key bindings for completion HOT 1
- This autocomplete plugin not working in NeoVim HOT 6
- Failed to run on windows HOT 1
- Please provide <Plug>(rust-doc-tab) or other method to allow documents to be viewed in a new tab. HOT 2
- Ctrl+x Ctrl+o is not working HOT 3
- E764: Option 'omnifunc' is not set HOT 5
- E117: Unknown Function: racer#RacerComplete HOT 3
- Tag a new release HOT 1
- No ouput from RacerDoc or RacerDef when space in file path HOT 1
- Ctrl+x + Ctrl+o does not work HOT 9
- Deprecation notice? HOT 1
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 vim-racer.