Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 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 Expand Up @@ -441,8 +440,8 @@ export type Configuration = {
*/
'disableMethodSnippets.jsxAttributes': boolean
/**
* disable method snippets at function arguments
* @default true
* Wether to disable method snippets in function arguments
* @default false
*/
'disableMethodSnippets.functionArguments': boolean
/**
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
6 changes: 5 additions & 1 deletion typescript/src/completionsAtPosition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ export const getCompletionsAtPosition = (
}
}
let prior = getPrior()
// todo rethink its usage and maybe always prefill instead
const ensurePrior = () => {
if (!prior) prior = { entries: [], isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false }
if (!prior) {
prior = { entries: [], isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false }
;(sharedCompletionContext.prior as typeof prior) = prior
}
return true
}
const hasSuggestions = prior?.entries.some(({ kind }) => kind !== ts.ScriptElementKind.warning)
Expand Down