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

Detect default themes #12

Merged
merged 6 commits into from
Aug 14, 2021
Merged

Detect default themes #12

merged 6 commits into from
Aug 14, 2021

Conversation

vocksel
Copy link
Owner

@vocksel vocksel commented Aug 13, 2021

Problem

While it's easy enough to detect the themes the user has installed, there are several default themes that VS Code comes with that we do not detect.

Solution

Add support for finding the install directory for VS Code on the user's system to grab the default theme files.

Closes #3

This has some issues currently. "Default Dark+" currently throws an error right now. Others like Monokai work perfectly fine though!

@vocksel
Copy link
Owner Author

vocksel commented Aug 14, 2021

I have tested this and it can detect default extensions on both Windows and MacOS. These are the paths used to accomplish this:

export const WINDOWS_DEFAULT_EXTENSIONS = [
    process.platform === 'win32' && path.join(process.env.LOCALAPPDATA,
        '/Programs/Microsoft VS Code/resources/app/extensions'),
    'C:/Programs Files/Microsoft VS Code/resources/app/extensions',
    'C:/Program Files (x86)/Microsoft VS Code/resources/app/extensions'
]

export const MACOS_DEFAULT_EXTENSIONs = [
    '/Applications/Visual Studio Code.app/Contents/Resources/app/extensions'
]

I'm wondering how brittle these paths are though.

@vocksel vocksel merged commit 1323421 into main Aug 14, 2021
@vocksel vocksel deleted the detect-default-themes branch August 14, 2021 13:30
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.

Add detection for default themes
1 participant