there are always StringFragments
This commit is contained in:
parent
9bc514a782
commit
d957675ac8
|
|
@ -236,7 +236,12 @@ export const getStringParts = (node: SyntaxNode, input: string) => {
|
|||
}
|
||||
})
|
||||
|
||||
return { parts, hasInterpolation: parts.length > 0 }
|
||||
// hasInterpolation means the string has interpolation ($var) or escape sequences (\n)
|
||||
// A simple string like 'hello' has one StringFragment but no interpolation
|
||||
const hasInterpolation = parts.some(
|
||||
(p) => p.type.id === terms.Interpolation || p.type.id === terms.EscapeSeq
|
||||
)
|
||||
return { parts, hasInterpolation }
|
||||
}
|
||||
|
||||
export const getDotGetParts = (node: SyntaxNode, input: string) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user