Ctags - Neither rebuildOnFileSave nor rebuildOnStart work
See original GitHub issueEnvironment data
VS Code version: 1.20.1 Python Extension version: 2018.1.0 Python Version: 2.7.14 OS and version: MacOS 10.13.3
Actual behavior
${workspaceFolder}/.vscode/tags file is not updated when I save a python file nor if I restart VS Code.
Expected behavior
${workspaceFolder}/.vscode/tags file will be updated when I save a python file or restart VS Code.
Steps to reproduce:
- Verify tags file doesn’t exist
- Open a project with python files in VS Code and open a Python source file
- Verify the tags file still doesn’t exist (rebuildOnStart hasn’t activated)
- Make a change to the Python file and save
- Verify the tags file still doesn’t exist (rebuildOnFileSave hasn’t activated)
- Perform a global symbol search
- The tags file has been created (this is only created if it doesn’t exist, if it already existed it isn’t updated with new symbols)
- Add a new function definition to a Python file and save (rebuildOnFileSave hasn’t activated)
- Perform a global symbol search for newly added symbol (this fails to find it)
- Run ‘Python: Build Workspace Symbols’ (this updates tags file)
- Perform a global symbol search for newly added symbol (this succeeds)
Logs
Output from Python
output panel (only gets logged when I perform a global symbol search if the tags file doesn’t exist, or if I run the ‘Python: Build Workspace Symbols’ command.)
ctags --options=/XXXXX/.vscode/extensions/ms-python.python-2018.1.0/resources/ctagOptions --languages=Python --exclude=**/site-packages/** --exclude=.history -o /YYYYY/.vscode/tags .
Output from Console window
(Help->Developer Tools menu) (I see this on VS Code startup.)
[Extension Host] Python Extension: Failed to get conda info from conda null
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:253
Issue Analytics
- State:
- Created 6 years ago
- Reactions:25
- Comments:17 (4 by maintainers)
Top Results From Across the Web
coc-python - npm
Install ctags for Workspace Symbols, from here, or using brew install ctags on macOS. Useful commands. Open the Command List (use :CocCommand ...
Read more >Better Python Object Serialization - Planet Python
The Fellow Work Group is looking for more members from all around the world! ... rebuildOnStart” to true, or rebuilt on every file...
Read more >Harami | PDF | Html Element | Bracket - Scribd
Controls auto save of dirty files. Accepted values: 'off', 'afterDelay',. 'onFocusChange' (editor loses focus), 'onWindowChange' (window loses focus).
Read more >VScode设置界面怎么改回UI - CSDN
Only works before elements, not inside tags or for text. ... qualified path to the ctags executable (else leave as ctags, assuming it...
Read more >After upgrading to 1.30.2, formatting disorder #1062 - Issuehunt
limitSymbolsToIncludedHeaders" is either not specified or set to "${default}". ... add a directory change command to allow relative path loading to work.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yea been scratching my head as to why goto symbol was always a few lines off, I added the following keybinding as a workaround for me:
So it looks like
python.workspaceSymbols.rebuildOnStart
andpython.workspaceSymbols.rebuildOnFileSave
were never implemented at all 🤷♂️ They were just a no-op setting.I also checked the original commit of the setting where the implementation was added, 6ef8f53275b3bceaceddb0da78357aaf8c7fdb71, and a few commits around it. None had the implementation.
Prescribed solution
For
python.workspaceSymbols.rebuildOnStart
, add these lines at the end of constructor in https://github.com/Microsoft/vscode-python/blob/edbd57ad3cbdb8685de5eabf7933a9ecd7607ae2/src/client/workspaceSymbols/main.ts#L44-L52For
python.workspaceSymbols.rebuildOnFileSave
, add these lines in the constructorand create the method