-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Conversation
There was a problem hiding this 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", |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
Thank you for the PR 👍 |
There was a problem hiding this 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
No description provided.