Merge for 1.33.3 (pre-release)#14564
Open
sean-mcmanus wants to merge 12 commits into
Open
Conversation
* Fix TypeScript errors.
…hs with spaces) (#14552) * Fix clang-format/clang-tidy version check failing on Windows (and paths with spaces)
* Improve crash call stack data.
…14554) * Fix Windows backslash paths being mangled when adding an SSH target
* Fix format settings.
* Localization - Translated Strings
…ssion (#14540) * Add EvaluatableExpressionProvider to fix C/C++ debug hover on dereferenced members VS Code's default debug data-tip keeps a leading `*`/`&` and clips on the right, so hovering an intermediate member of e.g. `*a.b.c` evaluates `*a.b` (a dereference of the struct `a.b`) and shows no value. Register an EvaluatableExpressionProvider that, only for that case, returns the expression without the leading operator. Every other expression returns undefined so the default behavior is unchanged. * Move the debug hover provider to the debugger Register the EvaluatableExpressionProvider during debugger activation instead of through the language client, so it also works when IntelliSense is disabled, and move it next to the other debugger code. The expression computation lives in a vscode-free module (evaluatableExpression.ts) so it can be unit tested directly. Registering a provider replaces VS Code's built-in data-tip expression detection, so it reproduces that for ordinary tokens and additionally handles access chains the built-in detection gets wrong for C/C++: - A leading */& binds to the whole access chain (the postfix ., ->, [] operators bind tighter), so it is dropped for an interior member of a dot chain, where *a.b would dereference the struct a.b, and kept on the final member and before ->. - Array subscripts and :: are kept in the token, so members after a subscript (a.b[i].c) and scoped names (ns::var) resolve instead of producing a broken fragment. * Document why the leading-operator drop is .-only The leading */& is kept before -> / [] and at the end of a chain because those left operands are provably pointers/arrays, so *ptr->m, *a.b[i] and &a[i] evaluate without error; it is dropped only before . where the left operand may be a struct. Documents these keep-leading outcomes as deliberate per review feedback. * Decline non-token cursor positions inside a subscript Inside [...] the token spans whitespace and operators (e.g. a[i + j]), so returning the nearest identifier evaluated the wrong expression when the cursor was on an operator or space. Return undefined unless the cursor is on the index identifier itself, and add tests. * Rewrite hover token detection with a balanced-bracket scanner Replace the token regex with a manual scanner so nested subscripts (a[b[i]]) stay in one token, fix hovering past the last identifier truncating a trailing subscript, and decline non-token positions inside [...] (operators/whitespace). Keep the leading * only on the final dereferenced segment (including a final subscript element like *a.b[i]); drop it on interior segments and drop a leading & always. Removes the previous regex (and its ReDoS surface). --------- Co-authored-by: Sean McManus <seanmcm@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.