Open ctf0 opened 1 year ago
Thanks for reporting these issues!
activationEvents
to onFileSystem:file
like you did on your fork? Does that work as expected with no problems?htmlhint.configFile
?both of the issues are solved on my branch yes, as for does it work https://marketplace.visualstudio.com/items?itemName=ctf0.htmlhint the installation count says it all especially that this is all what i've added
@coliff Could you please include just the activationEvents
changes provided by @ctf0 to allow for more startup options?
Any work on this? I'm trying to validate some html inside markdown documents.
I think that the:
"activationEvents": [
"onFileSystem:file"
],
is needed so the extension can be activated for other files than HTML (so it can be used for markdown files if I specify markdown
inside htmlhint.documentSelector
configuration) .
The other change I can see is the addition of:
"htmlhint.documentSelector": {
"items": {
"type": "string"
}
}
that I don't know if it is really necessary.
@coliff For the htmlhint.configFile
part @ctf0 added the htmlhint.optionsFile
configuration.
In htmlhint-server/src/server.ts
he added optionsFile
to the Settings
interface:
interface Settings {
htmlhint: {
enable: boolean;
options: any;
optionsFile: string;
},
[key: string]: any;
}
and the code to load the configuration if the option is specified inside getConfiguration
:
else if (settings.htmlhint && settings.htmlhint.optionsFile) {
options = loadConfigurationFile(settings.htmlhint.optionsFile)
}
sorry for the delay on this... I'd been testing that change locally and hope to get an update with this change out soon. thanks!
@coliff Sorry to bother you but it's been more than a year since you said you where testing the change locally. Any news on this?
Is there no other way to achieve what you intend other than onFileSystem:file
? I'm trying to set up VS Code as my editor for Git and HTMLHint has an activation time of over 500 ms.
Is there no other way to achieve what you intend other than
onFileSystem:file
? I'm trying to set up VS Code as my editor for Git and HTMLHint has an activation time of over 500 ms.
I don't think that change impacts activation time much. The latest version of the extension (1.0.5) has an activation time of 120ms on my Windows 11 laptop, and the first version (1.0.0) has an extension time of 110ms so it's nearly identical.
Just to be sure, are you talking about this value?
This seems to be the sum of the time needed to load the extension and the time to actually activate it. The loading time is typically much higher for HTMLHint. Here's a snippet of the output of the "Developer: Startup Performance" command:
Extension | Eager | Load Code | Call Activate | Finish Activate | Event | By |
---|---|---|---|---|---|---|
HTMLHint.vscode-htmlhint | false | 671 | 30 | 0 | onFileSystem:file | HTMLHint.vscode-htmlhint |
But I think I'll investigate this further when I have the time and come back to you if I have something actionable.
yes, but I have a very fast, relatively new Laptop which perhaps skews things somewhat 😅
the
"htmlhint.documentSelector
wont work because of https://github.com/htmlhint/vscode-htmlhint/blob/07db8b265378ccf7f0064926abd8c2f1597f05fe/htmlhint/package.json#L32htmlhint.configFile
isnt available https://github.com/htmlhint/vscode-htmlhint/blob/07db8b265378ccf7f0064926abd8c2f1597f05fe/htmlhint/package.json#L39REF: https://github.com/htmlhint/vscode-htmlhint/tree/main/htmlhint#settings