Skip to content

Commit

Permalink
Internal RegExp & Glob Pattern are updated
Browse files Browse the repository at this point in the history
  • Loading branch information
hepter committed Oct 19, 2022
1 parent a35c756 commit 0381a25
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ It can be made to work in various projects by changing the regex information and

## Change Log

##### v1.0.6
- Internal RegExp & Glob Pattern are updated to support better matching.

##### v1.0.5

- Multiple resource key detection fixed at the single line for Hover and Code Action Providers.

##### v1.0.4

- Logs forwarded to the custom i18 CodeLens output channel.
- Minor fixes.

##### v1.0.3

Performance tweaks & refactored with new features
Expand Down
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "i18n-codelens",
"displayName": "i18n CodeLens",
"description": "i18n CodeLens makes it easy to find missing language resources, provides various Code Actions, Hover Information, and tips for you to add or edit the language resources.",
"version": "1.0.5",
"version": "1.0.6",
"publisher": "mustafa-kuru",
"author": {
"email": "mustafakuru042@gmail.com",
Expand Down Expand Up @@ -91,13 +91,13 @@
"type": "string",
"description": "Language file glob patterns. (Language resource files must be key value object files.)",
"editPresentation": "singlelineText",
"default": "**/locales/*.json"
"default": "**/locales/**/*.json"
},
"i18n-codelens.resourceCodeDetectionRegex": {
"type": "string",
"description": "Regex to detect hover or codeLenses for resource key.",
"description": "Regex to detect hover or codeLenses for resource key. Example default matches: t('key') or T('key')",
"editPresentation": "singlelineText",
"default": "(?<=T\\(['\"])(?<key>[a-zA-Z0-9.-]+?)(?=['\"]\\))"
"default": "(?<=\\W[tT]\\(['\"])(?<key>[a-zA-Z0-9 .-]+?)(?=['\"]\\))"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/SettingUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class SettingUtils implements vscode.Disposable {
private resourceDefinitionLocations = new Map<string, vscode.Location[]>();
private languageResourcesFilesCache: ResourceItem[] = [];
private initialLoadDone: boolean;
private resourceLineRegex = /(?<=["'])(?<key>[\w\d\-_.]+?)(?=["'])/;
private resourceLineRegex = /(?<=["'])(?<key>[\w\d\- _.]+?)(?=["'])/;
private codeFileRegex = /^(.(?!.*node_modules))*\.(jsx?|tsx?)$/;

public static readonly fireDebouncedOnDidChangeResourceLocations = debounce((...args) => SettingUtils._onDidChangeResourceLocations.fire(...args), 500);
Expand Down

0 comments on commit 0381a25

Please sign in to comment.