Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/tough-cookie-4.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
waldo1001 committed Oct 20, 2023
2 parents 6977f0c + 8471f1e commit 95cec42
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 72 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
@@ -1,6 +1,6 @@
# Change Log
All notable changes to the "crs-al-language-extension" extension:
## [1.5.26] - 2023-07-12
## [1.5.28] - 2023-07-12
Fix from [James Pearson](https://github.com/jimmymcp): pull request [#282 - Do not add quotes to object names if not necessary when reorganising](https://github.com/waldo1001/crs-al-language-extension/pull/282/files) - thanks!

## [1.5.25] - 2023-01-20
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -221,7 +221,7 @@ tableextension 50100 "Just Some Table Extension" extends Customer //18
* `DisableWaldoSnippets`: Disables the CRS snippets that come with this extension. When you change the setting, you need to restart VSCode twice. Once for disabling the snippets on activation (at that time, the snippets are still loaded). And the second time to actually not load the snippets anymore.
* `SkipWarningMessageOnRenameAll`: Skips the Warning when renaming all files which can disturb custom VS tasks.
* `RenameWithGit`: Use 'git mv' to rename a file. This keeps history of the file, but stages the rename, which you should commit separately. **The feature is still in preview-mode, therefore the default value is 'false'**

* `ReorganizeByNamespace`: This is a feature that allows for the automatic reorganization of files by creating folder structures based on the namespaces defined within the files. **The feature is still in preview-mode, therefore the default value is 'false'**
## Skip String manipulation

You can skip string manipulation by adding comments to your code:
Expand Down
131 changes: 82 additions & 49 deletions package-lock.json

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

8 changes: 7 additions & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"name": "crs-al-language-extension",
"displayName": "waldo's CRS AL Language Extension",
"description": "Make working with the (Dynamics NAV / 365) AL Language easier and more efficient.",
"version": "1.5.26",
"version": "1.5.28",
"publisher": "waldo",
"icon": "images/waldo.png",
"author": {
Expand Down Expand Up @@ -267,6 +267,12 @@
"description": "Use 'git mv' to rename a file. This keeps history of the file, but stages the rename, which you should commit separately. The feature is still in preview-mode, therefore the default value is 'false'",
"scope": "resource"
},
"CRS.ReorganizeByNamespace": {
"type": "boolean",
"default": false,
"description": "This is a feature that allows for the automatic reorganization of files by creating folder structures based on the namespaces defined within the files. The feature is still in preview-mode, therefore the default value is 'false'",
"scope": "resource"
},
"CRS.SearchObjectNamesRegexPattern": {
"type": "string",
"default": "^\\w+ (\\d* )?\"*",
Expand Down
8 changes: 7 additions & 1 deletion src/NAVObject.ts
Expand Up @@ -8,6 +8,7 @@ export class NAVObject {
public objectType: string;
public objectId: string;
public objectName: string;
public objectNamespace: string;
public objectActions: NAVObjectAction[] = new Array();
public tableFields: NAVTableField[] = new Array();
public pageFields: NAVPageField[] = new Array();
Expand Down Expand Up @@ -155,6 +156,7 @@ export class NAVObject {
this.objectType = '';
this.objectId = '';
this.objectName = '';
this.objectNamespace = '';
this.extendedObjectName = '';
this.extendedObjectId = '';
var ObjectNamePattern = '"[^"]*"' // All characters except "
Expand Down Expand Up @@ -273,7 +275,11 @@ export class NAVObject {
return null
}
}

var patternObject = new RegExp('namespace\\s+([A-Za-z0-9_.]+?)\\s*;', "i");
var match = this.NAVObjectText.match(patternObject);
if (match && match[1]) {
this.objectNamespace = match[1];
}
this.objectType = this.objectType.trim().toString();
this.objectId = this.objectId.trim().toString();
this.objectName = this.objectName.trim().toString().replace(/["]/g, '');
Expand Down
2 changes: 2 additions & 0 deletions src/Settings.ts
Expand Up @@ -34,6 +34,7 @@ export class Settings {
static readonly DisableDefaultAlSnippets = 'DisableDefaultAlSnippets';
static readonly DisableCRSSnippets = 'DisableCRSSnippets';
static readonly RenameWithGit = 'RenameWithGit';
static readonly ReorganizeByNamespace = 'ReorganizeByNamespace';
static readonly Browser = 'browser';
static readonly Incognito = 'incognito';
static readonly packageCachePath = 'packageCachePath';
Expand Down Expand Up @@ -100,6 +101,7 @@ export class Settings {
this.SettingCollection[this.DisableCRSSnippets] = this.getSetting(this.DisableCRSSnippets);
this.SettingCollection[this.PublicWebBaseUrl] = this.getSetting(this.PublicWebBaseUrl);
this.SettingCollection[this.RenameWithGit] = this.getSetting(this.RenameWithGit);
this.SettingCollection[this.ReorganizeByNamespace] = this.getSetting(this.ReorganizeByNamespace);
this.SettingCollection[this.SearchObjectNamesRegexPattern] = this.getSetting(this.SearchObjectNamesRegexPattern);
this.SettingCollection[this.DependencyGraphIncludeTestApps] = this.getSetting(this.DependencyGraphIncludeTestApps);
this.SettingCollection[this.DependencyGraphExcludeAppNames] = this.getSetting(this.DependencyGraphExcludeAppNames);
Expand Down

0 comments on commit 95cec42

Please sign in to comment.