Skip to content

Commit

Permalink
feat: Enable suggestions.displayImportedInfo to short-format by d…
Browse files Browse the repository at this point in the history
…efault
  • Loading branch information
zardoy committed Jul 13, 2023
1 parent 5c9ff75 commit 8410ab3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/configurationType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,9 @@ export type Configuration = {
*/
'suggestions.keywordsInsertText': 'none' | 'space'
/**
* Will be `format-short` by default in future as super useful!
* Requires TypeScript 5.0+
* Wether to show module name from which completion comes (inserted at start of completion detail)
* @recommended
* @default disable
* @default short-format
*/
'suggestions.displayImportedInfo': 'disable' | 'short-format' | 'long-format'
/**
Expand Down
2 changes: 1 addition & 1 deletion typescript/src/completions/displayImportedInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default (entries: ts.CompletionEntry[]) => {
for (const entry of entries) {
const { symbol } = entry
if (!symbol) continue
const [node] = symbol.getDeclarations() ?? []
const [node] = symbol.declarations ?? []
if (!node) continue
let importDeclaration: ts.ImportDeclaration | undefined
if (ts.isImportSpecifier(node) && ts.isNamedImports(node.parent) && ts.isImportDeclaration(node.parent.parent.parent)) {
Expand Down

0 comments on commit 8410ab3

Please sign in to comment.