Skip to content

Instantly share code, notes, and snippets.

@kurtis318
Last active April 5, 2019 14:25
Show Gist options
  • Select an option

  • Save kurtis318/d72d60161505bf35fb59fe6cefff0175 to your computer and use it in GitHub Desktop.

Select an option

Save kurtis318/d72d60161505bf35fb59fe6cefff0175 to your computer and use it in GitHub Desktop.
Visual Studio Code Tips

Fix to get outline for bash source in vscode

Issue

VS Code can syntacally parse bash source code but there is no outline of vars and functions in the OUTLINER.

Solution

REF: bash-lsp/bash-language-server#41 Need to have npm installed

sudo npm i -g bash-language-server tree-sitter tree-sitter-bash --unsafe-perm

If npm is not installed, run this command to install on Red Hat/CentOS/Fedora

sudo yum -y install npm

Make sure the Bash IDE extension is installed.

Make open edited files show as tabs

Issue

Started vscode and opened a folder/directory. When I click on files in the directory list, a tab appears. I noticed that the tab title was in italics (this should have meant it was a quick-preview). When I tried opening another file by clicking on the directory list, the previous file would go away. I was expecting to see 2 tables, one for each tab. I could get them to stay in the OPEN EDITORs panel if I made a change (tab title is no longer italics). I want to see all files as new tabs when I open then from the directory listing. Seems reasonable behavoir to me.

Solution

REF: microsoft/vscode#51649

This took a while to find this solution. The above web site told me to change these settings: "workbench.editor.enablePreview": false and "workbench.editor.enablePreviewFromQuickOpen": false.

This was somewhat helpful but here is what I did in more detail.

  1. File -> Preferences -> Settings
  2. In the search bar at the top of the new tab type in the text workbench.editor.enablePreview (pressing enter key was not needed).
  3. Uncheck the checkbox. The theme colors made it hard to distinquish if there is a checkbox if this setting is already turned off (false).
  4. Repeated steps in 2-3 above for workbench.editor. enablePreviewFromQuickOpen. This setting had 20 results so look closely for the correct setting to uncheck.
  5. Close the Settings tab by clicking the X to the right of the tab name (probably on the left for Mac users).
  6. View -> Command Pallete...
  7. Type this command followed by enter key toggle tab v.
  8. Try to open two separate files in the directory. If there is still only one tab, repeat step 7. The toggle might have already been off.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment