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

Folder level configuration for asciidoc.preview.asciidoctorAttributes #928

Open
jxdm-dmoreau opened this issue Jan 7, 2025 · 0 comments
Labels
💬 discussion Disccussion on new features, projects, etc... ✨ enhancement

Comments

@jxdm-dmoreau
Copy link

Description

When trying to configure Asciidoctor attributes at the folder level using .vscode/settings.json, the configuration is ignored.
However, the same configuration works when set in VSCode's User Settings.

Steps to reproduce

  1. Create a .vscode/settings.json file in your repository with:
{
    "asciidoc.preview.asciidoctorAttributes": {
        "skip-front-matter": ""
    }
}

Open an AsciiDoc file with front matter.

---
title: Title
---

some text

The front matter is still processed in the preview, indicating the attribute is not taken into account

Other folder settings (non-preview related) work correctly, confirming that the .vscode/settings.json file is properly loaded

Analysis

Looking at the extension's source code, specifically in asciidoctorAttributesConfig.ts:

typescriptCopyconst asciidocPreviewConfig = vscode.workspace.getConfiguration('asciidoc.preview', null)

The getConfiguration method is called with null as the scope parameter.
According to VSCode API documentation, this means it will only get the global configuration.
To properly support folder-level configuration, the extension should probably use the appropriate scope (Uri or WorkspaceFolder) when calling getConfiguration.

Additional Information

VSCode Version: 1.96.2
Extension Version: 3.5.2
OS: Windows 11 on remote WSL Ubuntu 24.04

@jxdm-dmoreau jxdm-dmoreau added ✨ enhancement 💬 discussion Disccussion on new features, projects, etc... labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 discussion Disccussion on new features, projects, etc... ✨ enhancement
Projects
None yet
Development

No branches or pull requests

1 participant