Hide executables in the VSCode explorer/sidebar - Linux - linux

When I compile my C++ programs, the executables tend to show up in my VSCode explorer/sidebar which is annoying when your workspace has a ton of them. I want to have a setting through which they no longer appear there like the .git folder.
When I was on windows, I could put **/.exe in the Files to exclude list but on linux(pop!_OS), the executables seem to have no extension and so, I don't know what to put in that list. I tried putting in **/. (which I didn't think would work), and it didn't.

In settings Files > Files: Exclude
or settings.json
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/.exe": true
},

Related

Template loader not looking at directories defined in DIRS

I'm trying to add a base template for use in different apps in my Django project. I've created a base.html file at "myapp/templates/base.html"
Here is the relevant info in my settings.py:
BASE_DIR = Path(__file__).resolve().parent.parent
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
When I try to load the view in my browser, I get a this error:
TemplateDoesNotExist at /home/
base.html
Request Method: GET
Request URL: http://127.0.0.1:8000/home/
Django Version: 3.1.1
Exception Type: TemplateDoesNotExist
Exception Value:
base.html
Exception Location: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/template/backends/django.py, line 84, in reraise
Python Executable: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3
Python Version: 3.8.5
Python Path:
['/Users/jonmi/PycharmProjects/projects/grocery',
'/Library/Frameworks/Python.framework/Versions/3.8/lib/python38.zip',
'/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8',
'/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload',
'/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages']
Server time: Sun, 13 Dec 2020 01:43:02 +0000
As I understand it, the template loader should look in each of my installed_apps' template directories since APP_DIRS is set to True, and it should also look in any directory in the DIRS list. However, the template loader is only looking in the app directories (e.g. myapp/home/templates/home/base.html) and not in anything I add to the DIRS list.
I've tried changing whats in the DIRS list, including just trying to type out the path to base.html as a string myself, but it doesn't check anything I add to the list.
I've seen similar questions asked, but they are all for older versions of Django, and the solutions they've provided did not work for me. There are lots of people who have had the TemplateDoesNotExist error, but this is the question I've found most similar to mine: Django 1.8 ignores DIRS, cannot find templates
However, the solutions posted there did not help me, and the question is about a much older version of Django.
How can I get the template loader to look at what's in the DIRS list?
EDIT:
In trying to add some more info to my question, I figured out what was wrong. I had copy and pasted the TEMPLATES settings from another stackoverflow question into my settings.py, but I hadn't overwritten the old TEMPLATES settings, so they were getting switched back to my initial settings since my old settings were further down in my code.
If you're having this problem, the TEMPLATES settings in my question do indeed work properly.
Thanks to whoever read and commented.

Package.json fields: Child directories are not ignored

I'm working on a large TS-based library. When I build the application, this creates a lot of .d.ts files, most of which are of internal use only, and make no sense to export or ship to the end user. Usually I've used a .npmignore file to keep these out, but recently learned that certain tools really prefer that information to be included via the "files" field of the package.json, so here I am trying to convert.
Now, I have a directory structure that looks somewhat like this:
dist/
--bundle.js
--...
--components/
----componentA.d.ts
----componentB.d.ts
----common/
----...
--hooks/
----...
--util/
----...
The idea is that I want all top level files, and all files directly under /components/ but no child directories. In my .npmignore, I'd do this like:
# blacklist all
**
# include whitelist
!dist/*
!dist/components/*
However, when I do the same under "files" in my package.json, all that crap still comes along. The single wildcard is not respected.
Edit:
"files": [
"dist/*",
"dist/components/*",
...
],
Reproducing what you show of your file system, this works for me:
"files": ["dist/*.js", "dist/components/*.ts"]
Omitting the file extensions indeed included all the subdirectory cruft. I tested with npm 7 and npm 6.

"SublimeAutoPep8: some issue(s) were not fixed" such as E501

I'm getting a soft warning in Python:
SublimeAutoPep8: some issue(s) were not fixed:
File "/Library/WebServer/dir/dir/filename.py", line 11: not fixed E501
File "/Library/WebServer/dir/dir/filename.py", line 33: not fixed E501
My current AutoPep8.sublime-settings is:
{
"format_on_save": true,
"max-line-length": 100,
}
I've tried adding the following config in Preferences.sublime-settings:
"pep8": {
"#disable": false,
"args": [],
"excludes": [],
"ignore": [ "E251", "W291", "E501" ],
"max-line-length": null,
"select": ""
},
doesn't seem to be right though.
What should I do to ignore these warnings? Thank you!
Firstly you should not be adding your AutoPep8 settings in Preferences.sublime-settings instead they should all be added to the AutoPep8.sublime-settings file which should be located in your Sublime Text User config directory.
Secondly I think you may have muddled up the settings of 2 different Sublime Text packages, those being Auto​PEP8 and Python PEP8 Autoformat. Given the warning message you mention it seems reasonable to assume you installed AutoPep8 but the settings you show are a combination of the 2 packages, see the default AutoPep8.sublime-settings file and the default pep8_autoformat.sublime-settings file. Both packages have an ignore setting but the Python PEP8 Autoformat package expects a list of strings, which is what you used, while the AutoPep8 package expects a string of comma separated values, which is what I think you should have used.
You should be able to open your user AutoPep8.sublime-settings file using the Sublime Text menu:
Menu --> Preferences --> Package Settings --> AutoPep8 --> Settings – User
I suggest you try these AutoPep8.sublime-settings settings:
{
"format_on_save": true,
"max-line-length": 100,
// Crucially "ignore" uses a string with comma
// separated values and not a list of strings.
"ignore": "E251, W291, E501"
}

Autoformatting failed, buffer not changed : Sublime text

While setting up Python Development Environment in Sublime text 3, I wanted Auto formatting on and hence I made the following settings in Preferences > Package settings > Anaconda > Settings User
{
"auto_formatting": true,
"autoformat_ignore":
[
],
"pep8_ignore":
[
"E501"
],
"anaconda_linter_underlines": false,
"anaconda_linter_mark_style": "none",
"display_signatures": false,
"disable_anaconda_completion": true,
"python_interpreter": "/usr/local/bin/python3"
}
The auto_formatting value is set to true in user settings and it is set to false in default settings .
The auto formatting does not work out and gives me Autoformatting failed, buffer not changed error . Also tried changing auto_formatting_timeout = 5 //seconds , but that didn't work out . It would be of great help if someone could help me out .
I had the exact same issue. The problem is the last line is pointing to the wrong path for your python interpreter
Preferences > Package Settings > Anaconda > Settings - User
Delete the last line
"python_interpreter": "/usr/local/bin/python3"
Replace it with
"python_interpreter": "C:\\Users\\YOUR_NAME\\AppData\\Local\\Programs\\Python\\Python38-32\\python.EXE"
IMPORTANT: Your python interpreter path might be different to mine so find out where it is. Remember you need to use TWO backslashes in the path not ONE
Sublime is looking for python in environmental variable when you build it, and it is not able to find it there. You can test it in cmd by typing python and if it opens Microsoft store then here is the fix you can do, it worked for me. Open setting -> search for manage app execution aliases -> turn off "python.exe" and "python3.exe". Now check if you can get python in cmd by typing python, if you do then sublime problem should be fixed. If you want to know why this works follow this stack overflow

Sublime Text breaks after tree view refreshment and requires an OS reboot to work again (Linux)

I'm currently struggling with a bug(?), which completely breaks Sublime after some time of using it and requires a complete OS reboot to make it work again. The only correlation I found so far is that this always happens whenever a tree view refreshment is triggered (either manually or by creating or deleting a file or directory). Though, it also happened once when I hit tabulator for auto completion, so I'm not quite sure.
The first time this happened was after I opened a very large SQL file by mistake and killed the process, because, you know, Sublime and large files.
I already tried deleting the session files, but that didn't change anything.
I have absolutely no idea what this could be about, so I'd be very thankful for any kind of ideas, that could lead to the right direction.
Operating System: Arch Linux. Maybe that's of some relevance, I don't know. I'm using the official stable channel for pacman, though.
Package Control / Packages: A File Icon, AdvancedNewFile, Alignment, All Autocomplete, Autoprefixer, Case Conversion, CodeFormatter, Color Highlighter, CSScomb, DocBlockr, Emmet, FileDiffs, Git, GitGutter, Grunt, HTML-CSS-JS Prettify, Inc-Dec-Value, jQuery, Less, Local History, MarkdownEditing, Material Theme, Package Control, PHP-Twig, PyV8, Sass, SFTP, SideBarEnhancements, SQLTools, SublimeCodeIntel, SublimeLinter, SublimeLinter-php, Sublimerge 3, Symfony2 Snippes, Terminal, Xdebug Client, zzz A File Icon zzz
Settings:
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"dictionary": "Packages/Language - English/en_US.dic",
"ensure_newline_at_eof_on_save": true,
"font_options":
[
"gray_antialias"
],
"font_size": 10,
"ignored_packages":
[
"Markdown",
"Vintage"
],
"indent_guide_options":
[
"draw_normal",
"draw_active"
],
"line_padding_bottom": 3,
"line_padding_top": 3,
"material_theme_bright_scrollbars": true,
"overlay_scroll_bars": "enabled",
"remember_full_screen": true,
"rulers":
[
80,
120
],
"show_encoding": true,
"show_line_endings": true,
"theme": "Material-Theme.sublime-theme",
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}

Resources