Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Wildcards for files association #101

Merged
merged 1 commit into from
Jun 12, 2023
Merged

Feat: Wildcards for files association #101

merged 1 commit into from
Jun 12, 2023

Conversation

wladimirgrf
Copy link
Contributor

This Pull Request introduces a new feature, wildcards for file customization.

Solving this issue: Allow wildcards in files association #93

Example:

config workspace
Screenshot 2023-06-11 at 13 24 26 Screenshot 2023-06-11 at 13 17 45

@@ -9,7 +9,12 @@ const updateThemeJSONHandlers = {
},
"files.associations": (themeJSON, files) => {
for (const file in files) {
themeJSON.fileNames[file] = files[file];
if(file.startsWith('*.')){
const newExtension = file.replace('*.','');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const newExtension = file.replace('*.','');
const newExtension = file.substring(2);

@miguelsolorio miguelsolorio self-requested a review June 12, 2023 20:56
@miguelsolorio miguelsolorio self-assigned this Jun 12, 2023
Copy link
Owner

@miguelsolorio miguelsolorio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wladimirgrf This is working lovely! One minor question, should we also support ".service.ts": "angular" without the *, to ensure it works multiple ways?

@wladimirgrf
Copy link
Contributor Author

@wladimirgrf This is working lovely! One minor question, should we also support ".service.ts": "angular" without the *, to ensure it works multiple ways?

@miguelsolorio No, we need to have a character, in this case *, to identify that we should consider the value as an extension and not a file type.

If we only consider the .. We will have problems with customizing files like .nvmrc, .env, .eslintrc.js, any file that starts with ..

Because for cases like *.module.ts I create it as "fileExtensions" and not as "fileNames".

@miguelsolorio
Copy link
Owner

Ah, that makes sense! In that case let's merge this in. Thanks again! 🍻

@miguelsolorio miguelsolorio merged commit fe326f8 into miguelsolorio:main Jun 12, 2023
@wladimirgrf wladimirgrf deleted the feature/wildcards-files-association branch June 13, 2023 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants