Support completions that require changing from dot to bracket access#20547
Support completions that require changing from dot to bracket access#2054710 commits merged intomasterfrom
Conversation
27bec0d to
087493a
Compare
087493a to
53bc018
Compare
|
As I mentioned last week, there are people who've been using spaces in names to use as part of type system hacks to have pseudo-private members. Now something that starts with a space will bubble to the top. @RyanCavanaugh had an idea of excluding names that are spaces, but we could generalize to any character that isn't a valid IdentifierStart I think another idea might be is to de-prioritize names that aren't valid property accesses. |
src/services/types.ts
Outdated
|
|
||
| export interface GetCompletionsAtPositionOptions { | ||
| includeExternalModuleExports: boolean; | ||
| includeBracketCompletions: boolean; |
There was a problem hiding this comment.
If we ever want to support completing strings in object literals (without users needing to explicitly type in a quote character), does it make sense to call this something else?
There was a problem hiding this comment.
It depends on whether we will still want a flag for the behavior of completing bracketed expressions, or if this will only be used in a non-user-facing way as an editor feature flag. I believe vscode had plans to make a user-facing options for includeExternalModuleExports in case some people don't want that.
There was a problem hiding this comment.
Yes we have an option for includeExternalModuleExports. However I think we would always want to enable includeBracketCompletions or whatever this new option is called. This flag is useful for backwards compatibility (see #20730) so that we don't break clients that don't support insertText
3df745e to
84f9203
Compare
|
@DanielRosenwasser We could set |
3a30279 to
fd9ea5b
Compare
I do not think this is a good idea. from a user perspective, there are searching for We can filter out things that start with at least one sapace.. it is not common for property names to be written that way. |
mhegazy
left a comment
There was a problem hiding this comment.
We need to filter out the ones that start with spaces as discussed earlier.
761f2cb to
5091bfc
Compare
|
@mhegazy @DanielRosenwasser Good to go? |
|
//cc @chuckjaz |
Requires a build of TS with microsoft/TypeScript#20547 Fixes #36429 Also relaxes the matching logic for suggestion items with filter texts
Fixes #19433
Must wait on microsoft/vscode#39893 first.
This adds a completion for a property even if it can't follow a
.-- and adds a code action to change the style fromx.|tox["|"].