feat(editor): Show tip when user can type dot after an expression (#8931)
This commit is contained in:
@@ -902,7 +902,7 @@ const regexes = {
|
||||
singleQuoteStringLiteral: /('.+')\.([^'{\s])*/, // 'abc'.
|
||||
doubleQuoteStringLiteral: /(".+")\.([^"{\s])*/, // "abc".
|
||||
dateLiteral: /\(?new Date\(\(?.*?\)\)?\.(.*)/, // new Date(). or (new Date()).
|
||||
arrayLiteral: /(\[.*\])\.(.*)/, // [1, 2, 3].
|
||||
arrayLiteral: /\(?(\[.*\])\)?\.(.*)/, // [1, 2, 3].
|
||||
indexedAccess: /([^"{\s]+\[.+\])\.(.*)/, // 'abc'[0]. or 'abc'.split('')[0] or similar ones
|
||||
objectLiteral: /\(\{.*\}\)\.(.*)/, // ({}).
|
||||
|
||||
|
||||
@@ -237,3 +237,9 @@ export const withSectionHeader = (section: CompletionSection): CompletionSection
|
||||
section.header = renderSectionHeader;
|
||||
return section;
|
||||
};
|
||||
|
||||
export const isCompletionSection = (
|
||||
section: CompletionSection | string | undefined,
|
||||
): section is CompletionSection => {
|
||||
return typeof section === 'object';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user