GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Support a 'recommended' completion entry · Pull Request #20020 · microsoft/TypeScript Conversation
|
| !!(localSymbol.flags & SymbolFlags.ExportValue) && checker.getExportSymbolOfSymbol(localSymbol) === recommendedCompletion; | ||
| } | ||
|
|
||
| function trueOrUndef(b: boolean): true | undefined { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Avoid abbreviations.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| function getFirstSymbolInChain(symbol: Symbol, enclosingDeclaration: Node, checker: TypeChecker): Symbol | undefined { | ||
| const chain = checker.getAccessibleSymbolChain(symbol, enclosingDeclaration, /*meaning*/ SymbolFlags.All, /*useOnlyExternalAliasing*/ false); | ||
| return chain |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nested shorthands are hard to read. Consider if else, or switch statement.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ccfe89d to
d1abfbe
Compare
|
Should probably get review from Matt Bierner (@mjbvz) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Just to confirm, the expected UX here would be that we surface the recommended completion first? Should that also happen if the user has already started typing something? Would sort order be enough here then? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| case SyntaxKind.AmpersandAmpersandToken: | ||
| case SyntaxKind.CommaToken: | ||
| return node === right ? getContextualType(binaryExpression) : undefined; | ||
| case SyntaxKind.EqualsEqualsEqualsToken: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
this changes what contextual type mean in the language. we should talk about this first
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| case SyntaxKind.CallExpression: | ||
| case SyntaxKind.NewExpression: | ||
| return getContextualTypeForArgument(<CallExpression>parent, node); | ||
| if (node.kind === SyntaxKind.NewKeyword) { // for completions after `new ` |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
this one too
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| kindModifiers: string; // see ScriptElementKindModifier, comma separated | ||
| kindModifiers: string; | ||
| sortText: string; | ||
| /** |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
why is this comment removed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| replacementSpan?: TextSpan; | ||
| hasAction?: true; | ||
| source?: string; | ||
| isRecommended?: true; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
i would rather we put this on the CompletionInfo instead. i understand for the server we have to put it on the entry.. but for VS for example, it makes more sense to have it on the info..
Please check with Andrew Casey (@amcasey) about this too.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm not intimately familiar with these types. The info is the wrapper object containing a list of entries? Assuming that's the case, having it on the entry is the most convenient place for VS.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's defined at interface CompletionInfo in services/types.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Then, yes, the entry would be preferable to the info. I've created a PR with the VS change if you'd like to test it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Visual Studio will show the recommended completion as selected if nothing is typed. the order does not change. I would recommend doing the same for VSCode; changing the order is disorienting. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
32ca804 to
c37427c
Compare
|
Andrew Casey (@amcasey) Good to go? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Andy (Andrewkraft) (@Andy-MS), have you tried it in VS? If not, I will. Otherwise, yes. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
So far, it's not working. console.log('Hello world'); class CA { } class CB { } const c: CB = //caret
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I've confirmed that the flag is getting to Roslyn, but I have yet to figure out why it's having no effect. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Looks like a problem in the managed component. I think you're good to go. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Andrew Casey (@amcasey) Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.