Exclude files from search in VSCode's extension - vscode-extensions

My VSCode extension creates a database of symbols and stores it along the project. I'd like to automatically exclude this file from search results (it would be even better to exclude it from file explorer).
Is there a way how can I modify "search.exclude" from my extension or can I set such a setting in my extension's package.json?

There is no API for you to contribute to search.exclude and/or files.exclude settings, so you are out of luck on this.
On the other hand, you can make your extension to update the User Settings using workspace.getConfiguration("section").update("section") API. With that, search.exclude and/or files.exclude settings could de updated to respect the symbols you want to be ignored.
But, I would suggest you to warn the users about this process, asking for their approval, before effectively updating the setting. Personally, I don't do this, and prefer that extensions that don't do this as well, but I understand sometimes this is necessary/inevitable.
Hope this helps

Related

I am going through project configuration in craftcms

I am going through documentations for project configuration in craftcms not sure what is the different between project-config/write and project-config/modify?
project-config/write takes the config currently stored in the database and writes it out as YAML files in the config/ folder. You usually don't need this since Craft does this automatically whenever you change something in the backend (unless you have turned that off).
project-config/rebuild attempts to rebuild the entire project-config based on the state of the entire database. This is only required in rare edge cases.
Rest you can check the official documentation here:
https://craftcms.com/docs/4.x/project-config.html#what-s-stored-in-project-config

how can I execute a three.js example in my project folder?

How can I execute a three.js example in my project folder? The example I want to execute is this:
https://threejs.org/examples/webgl_animation_keyframes.html
.
After installing three.js through npm, I copied example's source code:
https://github.com/mrdoob/three.js/blob/master/examples/webgl_animation_keyframes.html
in my empty examples folder located at '/node_modules/three/examples'.
I think there's a path direction problem importing some of including library files such as
"import { RoomEnvironment } from './jsm/environments/RoomEnvironment.js';"
"loader.load( 'models/gltf/LittlestTokyo.glb', function ( gltf )"
etc.
Do I have to copy those library files and paste it on the right path by hand? I'm afraid this is not a correct solution. Is there a solution something like, as I wish, downloading all necessary library files in the right places by input some npm command?
The situation is certainly not ideal, but here are some tips:
You can clone the whole repository so you have all the resources used by the examples: git clone --depth=1 https://github.com/mrdoob/three.js.git
You can use a web browser's web page saving feature (Ctrl+S) but be sure to replace the HTML with the example's source HTML, because it will be much cleaner. You'll need to fix up file path references, and it may still miss some resources. Also make sure not to get the iframe containing page, but rather the demo itself.
If Save Webpage As misses some resources, you can use Chrome's dev tools Network tab. Refresh the page to populate it, then right click inside the table > Copy > Copy All as CURL. This will give you a command you can paste in your terminal (in an empty directory, ideally) to download all the resources used by the webpage. This can still miss some resources that are dynamically loaded, such as with 1. the model selector in the LDraw Loader example, in which case you could switch to each model to purposely populate the network requests table, or 2. a fallback for older browsers, in which case you may not be able to get it through this method.
It's much easier to remove features than to add and combine them, so try to find an example that uses as many of the things you want as possible (without being overwhelmingly complex). It's worth looking outside of the official examples to real projects and third party experiments. Just note that they may not be up to date with the latest APIs.
I hope someone writes a script to automate setting up a Three.js project from an example... and posts a better answer than this!

How to add GET parameter to CSS filename in plugin JCH Optimize (Joomla)

I cannot find an answer to for several weeks. Perhaps my experience in development is not so great :) One site uses the JCH Optimize plugin and I noticed that after clearing the old memory (caches), the CSS and JS file links do not change, i.e. the names of these files remain old. The problem is that the browser checks the file name and if it has not changed, then the site visitors show the old version of the style file. The question itself, where in the plugin (in which code file) i can add some GET parameters ?vers = 1.1 so that for the browser it is a new file and it would update the information for users. I will be glad to hear any solutions. Thanks.
The names of the combined css and javascript files are keyed from the names of the individual files on the page. Clearing the cache will not cause the plugin to generate a different file name.
As of version 7.0.0, there is an option to generate a different cache key if you want to change the names of the combined file. Update your current version to get that capability.

Install two mutually-exclusive files with the same name to the same directory

My program deploys with a configuration option that I've chosen to expose as a feature. This option can be one of two values.
Each configuration changes a set of settings files. They have different input file names (for the sake of example, let's call it option1-config20-lv80.xml), but should be installed to the configuration directory as config20-lv80.xml. Each option has a prefix that should be stripped like that, which also means only one of these options can be selected for install at a time. However, even with conditions preventing the install of one feature when the other is selected, my output is littered with:
LGHT0204: ICE30: The target file 'config20-lv80.xml' is installed in 'path' by to different components... This breaks component reference counting.
How can I give my users the option to choose between these configuration options and get around my ICE30 issues without any negative side effects?
I saw an similar question answered, but I'm not 100% sure how to implement it in wix#, or if there are other ways open to me to achieve my goal without disabling ICE30 validation or creating 2 installers.
A bit rushed, have a look...
Milk & Honey Winnie: In cases like this I prefer to install both files with different names using two different components and then switch between them with an option shown in the application itself. On launch or in the preferences. Makes deployment simpler, it is already complex (section "The Complexity of Deployment"). The linked answer you refer to can work technically, as can more hacky approaches.
Alternatives: I have a long answer here on different ways to install settings files: Create folder and file on Current user profile, from Admin Profile ranging from eliminating the whole file and using internal defaults, to downloading settings files from the network or just relying on clouded web-service settings retrieval from a database. Not 100% match, but maybe give it a skim?
A related issue is when you have a settings file that regular users can't write to. This is a list of approaches for eliminating that condition: System.UnauthorizedAccessException while running .exe under program files.

How can I search all files which are NOT in .gitignore?

I have to do a major search-and-replace update across multiple repos...
In my initial search, I get back over 30,000 results. Many of these results are inconsequential and shouldn't be touched because they are 3rd-party tools. Most of these tools are ignored in the repos by .gitignore.
So, I tried creating a new Search Scope which could include only non-.gitignored files only to find I must manually select all folders...
...or must I?
Is there a way to create a scope or otherwise search only non-.gitignored files?
NOTE: Do not confuse my request with PhpStorm/Intellij's "ignore" feature. I am specifically asking about .gitignore.