-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[analytics] include vscode editor settings in our diagnostics report #60259
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
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 is actually a notification that we can get when configuration changes: (arguably, we should implement this regardless of this issue because right now we only capture a snapshot of settings at server start and rarely refresh it - I think only when contexts change) Option 4 above would avoid any custom protocol - however, since the settings are client-specific (whether we read I think I'm torn between synthetic config and something completely custom. Synthetic settings feels slightly odd, but avoids custom protocol. Custom protocol makes it easier to capture any information we think is relevant without having to add more and more synthetic settings (which may or may not actually be settings). Probably the biggest differences comes down whether we want:
I think if we want the first, we should probably use the synthetic config (eg. map I feel like the second is most flexible (and allows capturing additional information with only Dart-Code changes, rather than changes to both Dart-Code and the SDK). WDYT @bwilkerson @pq ? |
I can't think of any settings that I'd want to use in the server to customize its behavior, and I like the flexibility of an arbitrary map of values that we could use on any platform. For example, I wouldn't want to use |
Agreed. #2 sounds great. Thanks, Danny! |
…be included in the report See #60259, though this still requires the related client changes. Change-Id: I6a9419780b9d4c4b0c7a9518098c69e1609262b2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418100 Reviewed-by: Phil Quitslund <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
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: