-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[analytics] include vscode editor settings in our diagnostics report #60259
Comments
I started looking at this and there are two options:
The first one results in all of the editor settings be included in the payload (once for global, once for each workspace folder) which isn't terrible, but also means this shows up in instrumentation logs (where it didn't before). The second seems better, however it currently fails because in the Dart-Code extension we have middleware to set I've opened Dart-Code/Dart-Code#5433 and will fix Dart-Code's middleware to not fail if we do (2), however it does mean we can't do (2) until that fix has been out enough time that we're happy to break compatibility with older versions of the extension (or, we use the version of the extension as an indicator of whether to request these values). |
Another idea is that we send a separate |
I found another problem with this... It seems we are unable to fetch language-specific configuration with this API. Eg. if the user has: "editor.formatOnSave": false,
"[dart]": {
"editor.formatOnSave": true
} By fetching Given these settings are VS Code-specific anyway (there's nothing in LSP that suggests an editor should use There are a few different ways this could be passed to the server:
My feeling is that (3) is probably the better of those three, but since I suggest we add initializationOptions to the report anyway, including it there could be convenient (even if it doesn't actually affect initialization). @bwilkerson interested in your thoughts too. |
Another option:
|
Note: I'm not sure if this is relevant because I'm not sure I fully understand where this info will be. Since running the analyzer from source is slower than from the snapshot, maybe informing that setting is defined, can be good for us to review the data gathered for timings. |
There's a "Collect Report" button at the top of the diagnostic site (which you can launch from VS Code with the Dart: Open Analyzer Diagnostics command) that creates a json report that can be shared to help debug issues.
If we were to include this, I would guess there's a more reliable way to know we're running from the snapshot (for ex. |
Options 3 and 4 seem reasonable to me but don't feel super strongly. Anyway, thanks for digging in! I do think this will be really useful in diagnosing issues. |
I'm thinking that maybe it could be useful in future to include additional non-setting information in that diagnostic report that is known to Dart-Code but not the server, so maybe adding something to For example: "experimental": {
"diagnosticInfo": {
"foo": "bar",
"settings": {
"global": { // global settings
"editor.formatOnSave": true,
},
"workspaceFolders": [ // settings for each workspace folder in the workspace (if different to global)
{
"editor.formatOnSave": false,
},
{
"editor.formatOnSave": false,
}
]
}
}
} One slight drawback of doing it up-front like this is that if the user modifies it during the session, we'll have stale values. That's probably not terrible though? |
Assuming that we care about these settings for debugging purposes, then we should probably do this in a way that allows the server to get updated information when it changes. That probably means a custom notification? |
I love the idea of
It's more work but I'm inclined to agree. It could be really confusing for debugging if the data we were working with was stale. |
There have been a number of hypotheses around slowness associated w/ enablement of things like format and fix on-save actions and it would be great to find any correlations in user reports.
Settings in particular that are currently not known by server (but could help):
editor.formatOnSave
editor.codeActionsOnSave
/fyi @DanTup
The text was updated successfully, but these errors were encountered: