Skip to content

Commit da99f2e

Browse files
authored
Merge pull request #159 from zardoy/develop
2 parents 6df3960 + 8410ab3 commit da99f2e

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/configurationType.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,9 @@ export type Configuration = {
115115
*/
116116
'suggestions.keywordsInsertText': 'none' | 'space'
117117
/**
118-
* Will be `format-short` by default in future as super useful!
119-
* Requires TypeScript 5.0+
118+
* Wether to show module name from which completion comes (inserted at start of completion detail)
120119
* @recommended
121-
* @default disable
120+
* @default short-format
122121
*/
123122
'suggestions.displayImportedInfo': 'disable' | 'short-format' | 'long-format'
124123
/**
@@ -441,8 +440,8 @@ export type Configuration = {
441440
*/
442441
'disableMethodSnippets.jsxAttributes': boolean
443442
/**
444-
* disable method snippets at function arguments
445-
* @default true
443+
* Wether to disable method snippets in function arguments
444+
* @default false
446445
*/
447446
'disableMethodSnippets.functionArguments': boolean
448447
/**

typescript/src/completions/displayImportedInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default (entries: ts.CompletionEntry[]) => {
99
for (const entry of entries) {
1010
const { symbol } = entry
1111
if (!symbol) continue
12-
const [node] = symbol.getDeclarations() ?? []
12+
const [node] = symbol.declarations ?? []
1313
if (!node) continue
1414
let importDeclaration: ts.ImportDeclaration | undefined
1515
if (ts.isImportSpecifier(node) && ts.isNamedImports(node.parent) && ts.isImportDeclaration(node.parent.parent.parent)) {

typescript/src/completionsAtPosition.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ export const getCompletionsAtPosition = (
9191
}
9292
}
9393
let prior = getPrior()
94+
// todo rethink its usage and maybe always prefill instead
9495
const ensurePrior = () => {
95-
if (!prior) prior = { entries: [], isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false }
96+
if (!prior) {
97+
prior = { entries: [], isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false }
98+
;(sharedCompletionContext.prior as typeof prior) = prior
99+
}
96100
return true
97101
}
98102
const hasSuggestions = prior?.entries.some(({ kind }) => kind !== ts.ScriptElementKind.warning)

0 commit comments

Comments
 (0)