diff --git a/README.md b/README.md index ca5395f..43f4eb6 100755 --- a/README.md +++ b/README.md @@ -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 diff --git a/package-lock.json b/package-lock.json index b410c3b..697254b 100755 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "i18n-codelens", - "version": "1.0.4-beta.1", + "version": "1.0.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "i18n-codelens", - "version": "1.0.4-beta.1", + "version": "1.0.5", "dependencies": { "fastest-levenshtein": "^1.0.12", "lodash": "^4.17.21", @@ -1621,6 +1621,7 @@ "resolved": "https://registry.npmjs.org/keytar/-/keytar-7.7.0.tgz", "integrity": "sha512-YEY9HWqThQc5q5xbXbRwsZTh2PJ36OSYRjSv3NN2xf5s5dpLTjEZnC2YikR29OaVybf9nQ0dJ/80i40RS97t/A==", "dev": true, + "hasInstallScript": true, "dependencies": { "node-addon-api": "^3.0.0", "prebuild-install": "^6.0.0" diff --git a/package.json b/package.json index 013419c..d74b93f 100755 --- a/package.json +++ b/package.json @@ -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", @@ -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\\(['\"])(?[a-zA-Z0-9.-]+?)(?=['\"]\\))" + "default": "(?<=\\W[tT]\\(['\"])(?[a-zA-Z0-9 .-]+?)(?=['\"]\\))" } } } diff --git a/src/SettingUtils.ts b/src/SettingUtils.ts index 2a0ee02..fdf44c2 100644 --- a/src/SettingUtils.ts +++ b/src/SettingUtils.ts @@ -27,7 +27,7 @@ export default class SettingUtils implements vscode.Disposable { private resourceDefinitionLocations = new Map(); private languageResourcesFilesCache: ResourceItem[] = []; private initialLoadDone: boolean; - private resourceLineRegex = /(?<=["'])(?[\w\d\-_.]+?)(?=["'])/; + private resourceLineRegex = /(?<=["'])(?[\w\d\- _.]+?)(?=["'])/; private codeFileRegex = /^(.(?!.*node_modules))*\.(jsx?|tsx?)$/; public static readonly fireDebouncedOnDidChangeResourceLocations = debounce((...args) => SettingUtils._onDidChangeResourceLocations.fire(...args), 500);