File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -67,16 +67,19 @@ export class ModulesHoverProvider implements HoverProvider {
67
67
68
68
const stringBeforeLeftQuote = lineText . slice ( 0 , leftQuotaIndex ) ;
69
69
const stringAfterRightQuote = lineText . slice ( rightQuotaIndex + 1 ) ;
70
- const afterFnCallRegexp = / ^ \s * \) (?: ; .* | \n ? ) $ / ;
70
+ const afterFnCallRegexp = / ^ \s * \) (?: ; .* | \n ? ) / ;
71
71
const afterStatementRegexp = / ^ \s * (?: ; .* ) ? $ / ;
72
72
const isModule = // named imports/exports: import { pick } from 'lodash' or export * from 'antd'
73
73
( / (?: \b | \s + ) f r o m \s + $ / . test ( stringBeforeLeftQuote ) &&
74
74
afterStatementRegexp . test ( stringAfterRightQuote ) ) ||
75
75
// unnamed import
76
76
( / (?: \b | \s + ) i m p o r t \s + $ / . test ( stringBeforeLeftQuote ) &&
77
77
afterStatementRegexp . test ( stringAfterRightQuote ) ) ||
78
- // dynamic imports: import( 'lodash' )
79
- ( / (?: \b | \s + ) i m p o r t \s * \( \s * $ / . test ( stringBeforeLeftQuote ) &&
78
+ // dynamic imports:
79
+ // case1: import( 'lodash' )
80
+ // case2: import( 'lodash' ).then()
81
+ // case3: /** @type {import('next').NextConfig } */
82
+ ( / (?: \b | \{ | \s + ) i m p o r t \s * \( \s * $ / . test ( stringBeforeLeftQuote ) &&
80
83
afterFnCallRegexp . test ( stringAfterRightQuote ) ) ||
81
84
// require: require('lodash' )
82
85
( / r e q u i r e \s + \( \s * $ / . test ( stringBeforeLeftQuote ) &&
You can’t perform that action at this time.
0 commit comments