Skip to content

Commit

Permalink
fix: inertia helper regex (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhedger committed Feb 2, 2023
1 parent c818b75 commit a7b05ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/providers/inertiaComponentLink.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export class InertiaComponentLinkProvider implements DocumentLinkProvider {
provideDocumentLinks(
document: TextDocument
): ProviderResult<DocumentLink[]> {
// https://regex101.com/r/YiSfGR/2
// https://regex101.com/r/YiSfGR/5
const helperRegex = new RegExp(
'^(?!Route::)inertia\\(\\s*([\'"])(?<component>(?:(?!\\1).)*)(\\1)\\s*(?:,[\\s\\S]*?)?\\);',
'gmd'
'^(?!.*Route::inertia).*inertia\\(\\s*([\'"])(?<component>.+)(\\1)\\s*(?:,[\\s\\S]*?)?\\)',
'gdm'
);

// https://regex101.com/r/FheqGS/1
Expand Down

0 comments on commit a7b05ea

Please sign in to comment.