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

Use default workspace config if available and no settings config #30

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

josephsumabat
Copy link
Contributor

@josephsumabat josephsumabat commented Feb 14, 2024

This will allow us to have a canned workspace config (.vscode/alloglot.json) that can be overriden by any vscode settings file (settings.json for example). This will reduce the setup on mwb to simply installing the extension

@github-actions github-actions bot added the patch label Feb 14, 2024
@josephsumabat josephsumabat force-pushed the joseph/default-workspace-config branch from c92c7f9 to 04e2e69 Compare February 14, 2024 18:21
@josephsumabat josephsumabat force-pushed the joseph/default-workspace-config branch from 04e2e69 to 8e1009b Compare February 14, 2024 18:34
@josephsumabat josephsumabat marked this pull request as draft February 14, 2024 18:37
@josephsumabat josephsumabat marked this pull request as ready for review February 14, 2024 18:38

export function activate(context: vscode.ExtensionContext): void {
const settingsSection = vscode.workspace.getConfiguration(alloglot.root)
const alloglotWorkspaceLanguages = getWorkspaceConfig('.vscode/alloglot.json');
const alloglotVscodeLanguages = settingsSection.get<Array<LanguageConfig>>(alloglot.config.languages, [])
const alloglotLanguages = alloglotVscodeLanguages.length === 0 ? alloglotWorkspaceLanguages : alloglotVscodeLanguages;
Copy link
Contributor

Choose a reason for hiding this comment

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

ah, so it's either wholesale override, rather than merge. that's a lot easier to implement, and more predictable for end users.

Copy link
Contributor

@friedbrice friedbrice left a comment

Choose a reason for hiding this comment

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

Great work! This is going to improve a lot of people's workflows.

@friedbrice friedbrice added minor and removed patch labels Feb 14, 2024
@friedbrice friedbrice merged commit 34561bf into main Feb 14, 2024
1 check passed
@friedbrice friedbrice deleted the joseph/default-workspace-config branch February 14, 2024 19:30
Copy link

A PR to release these changes has been created, bumping the version from 2.2.0 to 2.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants