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

Add verification function when saving #282

Merged
merged 6 commits into from
Jan 28, 2024
Merged

Add verification function when saving #282

merged 6 commits into from
Jan 28, 2024

Conversation

abliger
Copy link
Contributor

@abliger abliger commented Jan 24, 2024

No description provided.

Copy link
Contributor Author

@abliger abliger left a comment

Choose a reason for hiding this comment

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

package.json Outdated
"vscode-html-css.vaildOnSave": {
"type": "boolean",
"description": "Verify label class names when saving files.",
"scope": "application",
Copy link
Owner

Choose a reason for hiding this comment

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

Better to be resource (workspace) scopped and be an enum for future. (Like On save, On change etc)

src/extension.ts Outdated
@@ -27,8 +27,13 @@ export function activate(context: ExtensionContext) {
workspace.onDidCloseTextDocument((document) =>
validations.delete(document.uri)
),
workspace.onDidChangeTextDocument((event) =>
validations.delete(event.document.uri)
workspace.onDidChangeTextDocument(async (event) => {
Copy link
Owner

Choose a reason for hiding this comment

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

This should be according to the settings, such as on save on change etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also discovered this issue today and will submit it later

@@ -16,3 +16,9 @@ export function getStyleSheets(uri: Uri): string[] {
.getConfiguration("css", uri)
.get<string[]>("styleSheets", []);
}

export function getVaildOnSave(): Boolean {
return workspace
Copy link
Owner

Choose a reason for hiding this comment

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

Should be resource scopped like styleSheets

@ecmel
Copy link
Owner

ecmel commented Jan 25, 2024

Thank you for the PR 👍

Copy link
Contributor Author

@abliger abliger left a comment

Choose a reason for hiding this comment

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

Add feature: Prompt source file

@ecmel ecmel merged commit bdbe497 into ecmel:master Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants