Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRS: Reorganize - All Files error #110

Closed
nicolassaleron opened this issue Mar 27, 2019 · 23 comments

Comments

Projects
None yet
4 participants
@nicolassaleron
Copy link

commented Mar 27, 2019

Hello,

Since version [1.1.0] - 2019-03-26, the action "CRS: Reorganize - All Files" returns the error "Cannot read property 'uri' of undefined".

@GreatScott000

This comment has been minimized.

Copy link

commented Mar 27, 2019

I receive the same error using CRS: Rename - All Files. It happens whether the new setting CRS.RenameWithGit is false or true.

Also, with this setting TRUE I don't see any staged objects in source control (Azure DevOps using Git).

Does this setting apply to Rename - Single file too?

@nicolassaleron

This comment has been minimized.

Copy link
Author

commented Mar 27, 2019

By the way, renaming one file at a time works fine.

@waldo1001

This comment has been minimized.

Copy link
Owner

commented Mar 28, 2019

Interesting. I have renamed and reorganized all files in the baseapp (which means +5000 files), and it worked fine, both with Git and without git. So I'm not able to reproduce.

Can you share a usecase with me? Maybe a sample project? It can depend on:

  • how you setup your settings (workspace, multiple workspaces, user, ...)
  • characters in your file
  • ...

would be great, because else, I'm searching blind.. :(

@waldo1001

This comment has been minimized.

Copy link
Owner

commented Mar 28, 2019

@nicolassaleron & @GreatScott000 ,

hm, one thing you might try (judging from the error): open a file from the workspace, and THEN rename all.

@nicolassaleron

This comment has been minimized.

Copy link
Author

commented Mar 28, 2019

I have attached a sample project (quite simple I think :) )

When you use "CRS: Reorganize - All Files", MyTable.al is not moved or renamed.

Note that if you delete the folder named "src", il will be correctly created (and the subfolder will be also correctly created).

I am running the last version of VSCode (1.32.3).

TestProject.zip

@GreatScott000

This comment has been minimized.

Copy link

commented Mar 28, 2019

I happen to have a Bash terminal session open and saw this when I try to rename a single file.

Todd.Scott@5CG70948WR MINGW64 /c/EvolveiMS/Repos/dev/Nav/DRON001/13.0 (Nav BC)/Extension/Legacy (master)
$ code c:\EvolveiMS\Repos\dev\Nav\DRON001\13.0 (Nav BC)\Extension\Legacy\PageExtension\Interaction Log Entries Ext 123.albash: syntax error near unexpected token `('

Note, there is a ( and ) in my folder path.

The file does get renamed but not using the git mv command noted in the the release notes. There is no staged file.

@waldo1001

This comment has been minimized.

Copy link
Owner

commented Mar 28, 2019

Well, the git mv doesn't really handle "special characters" well - I noticed when I'm using the full object name (with spaces) in the filename, it doesn't work.. .

And since I'm sending the complete path, it's probably going wrong there.. will test

@waldo1001

This comment has been minimized.

Copy link
Owner

commented Mar 28, 2019

@GreatScott000 & @nicolassaleron ,

I'm still not able to reproduce, even not with the attached app. but I cleaned up some errors in the background (similar). May be you could test this? You can download the new version here (not on the marketplace yet):
https://www.dropbox.com/s/auaso0zig9s2erd/crs-al-language-extension-1.1.1.vsix?dl=1

@waldo1001

This comment has been minimized.

Copy link
Owner

commented Mar 28, 2019

I happen to have a Bash terminal session open and saw this when I try to rename a single file.

Todd.Scott@5CG70948WR MINGW64 /c/EvolveiMS/Repos/dev/Nav/DRON001/13.0 (Nav BC)/Extension/Legacy (master)
$ code c:\EvolveiMS\Repos\dev\Nav\DRON001\13.0 (Nav BC)\Extension\Legacy\PageExtension\Interaction Log Entries Ext 123.albash: syntax error near unexpected token `('

Note, there is a ( and ) in my folder path.

The file does get renamed but not using the git mv command noted in the the release notes. There is no staged file.

I tried this with a folder with brackets - and it did a successful git mv :(.
image

image

Not that I don't believe you, but I need a valid scenario to repro and debug :(.

@nicolassaleron

This comment has been minimized.

Copy link
Author

commented Mar 28, 2019

thanks, works fine for me now :)

By my mistake, I tried the new version with an empty al file in my project and get the error message "Cannot read property 'toLowerCase' of undefined".

@waldo1001

This comment has been minimized.

Copy link
Owner

commented Mar 28, 2019

Great!

Let me look at that as well. it's no biggy, I guess, but the error is not nice.

@GreatScott000 ,
I did notice a problem with the brackets and renaming one file when it was attempting to open the new file again (with the terminal). Should be fixed in this one:

https://www.dropbox.com/s/auaso0zig9s2erd/crs-al-language-extension-1.1.1.vsix?dl=1

waldo1001 added a commit that referenced this issue Mar 28, 2019

@waldo1001

This comment has been minimized.

Copy link
Owner

commented Mar 28, 2019

By my mistake, I tried the new version with an empty al file in my project and get the error message "Cannot read property 'toLowerCase' of undefined".

@nicolassaleron,
hm, again, not able to repro that one. If you allow me, I will neglect it for now. If it's really an issue, let's create a new issue on github for this ..

@fgilsc

This comment has been minimized.

Copy link

commented Mar 28, 2019

I'm experimenting this error for a few days ago
image

@GreatScott000

This comment has been minimized.

Copy link

commented Mar 28, 2019

Installed the updated VSIX
Okay, the Bash error is gone but I still do not see the git mv

This is the Output from Git with I run CRS: Rename - Single File

Looking for git in: C:\Program Files\Git\cmd\git.exe
Using git 2.20.1.windows.1 from C:\Program Files\Git\cmd\git.exe

git rev-parse --show-toplevel
git config --get commit.template
Open repository: c:\EvolveiMS\Repos\dev
git fetch
git status -z -u
git symbolic-ref --short HEAD
git rev-parse master
git rev-parse --symbolic-full-name master@{u}
git check-ignore -z --stdin
git rev-list --left-right master...refs/remotes/origin/master
git for-each-ref --format %(refname) %(objectname) --sort -committerdate
git remote --verbose
git status -z -u
git symbolic-ref --short HEAD
git rev-parse master
git rev-parse --symbolic-full-name master@{u}
git rev-list --left-right master...refs/remotes/origin/master
git for-each-ref --format %(refname) %(objectname) --sort -committerdate
git remote --verbose
git check-ignore -z --stdin
git show :Nav/DRON001/13.0 (Nav BC)/Extension/Legacy/Page/Attendee Interact Wiz. Subform 50088.al
git status -z -u
git check-ignore -z --stdin
git symbolic-ref --short HEAD
git rev-parse master
git rev-parse --symbolic-full-name master@{u}
git rev-list --left-right master...refs/remotes/origin/master
git for-each-ref --format %(refname) %(objectname) --sort -committerdate
git remote --verbose
git show :Nav/DRON001/13.0 (Nav BC)/Extension/Legacy/Page/Attendee Interact Wiz. Subform 50500.al
git ls-files --stage -- Nav/DRON001/13.0 (Nav BC)/Extension/Legacy/Page/

This is the crs-al-language output

28/03/2019, 10:35:52 - Rename file from Attendee Interact Wiz. Subform 50088.al to Attendee Interact Wiz. Subform 50500.al

And this is what I see in Source Control: GIT
image

If I understood the release notes correct I should see something in Staged Changes, correct?

@waldo1001

This comment has been minimized.

Copy link
Owner

commented Mar 28, 2019

@GreatScott000 , I'm sure you did set the setting ""CRS.RenameWithGit": true". Where did you do that? What settings.json? Screenshot would be nice.

@waldo1001

This comment has been minimized.

Copy link
Owner

commented Mar 28, 2019

@fgilsc ,

I'm experimenting this error for a few days ago
image

Is it possible to share a bit more? what situation? Settings? the project? A sample?

@GreatScott000

This comment has been minimized.

Copy link

commented Mar 28, 2019

@waldo1001
It is in my User Settings.
image
I tried with it turned on in both User and Workspace (only opening a folder), same results.

@GreatScott000

This comment has been minimized.

Copy link

commented Mar 28, 2019

@waldo1001 I just tried it with it only on in Workspace, same problem.

@waldo1001

This comment has been minimized.

Copy link
Owner

commented Mar 28, 2019

This is so weird :(. I did notice I have to "Reload Window" after I have changed the setting to make it work, but still .. .
Stupid question: your repo is initialized for git, right? ;-)

@waldo1001

This comment has been minimized.

Copy link
Owner

commented Mar 28, 2019

I sensed a disturbance in the force when working with multiple workspaces.

I suspect you have multiple workspaces - true? can you test by opening just one workspace?

I need to fix this, of course, but just like to see if I'm on the right path ;-)

@waldo1001

This comment has been minimized.

Copy link
Owner

commented Mar 28, 2019

@GreatScott000

OK, i think i solved the multiple workspaces part (by not checking it's a git repo or not).

I would greatly appreciate if you could test again!
https://www.dropbox.com/s/auaso0zig9s2erd/crs-al-language-extension-1.1.1.vsix?dl=1

@waldo1001 waldo1001 added in test and removed Investigate labels Mar 28, 2019

@GreatScott000

This comment has been minimized.

Copy link

commented Mar 29, 2019

Yes, I have multiple folders in a workspace and as far as I know it is a GIT repository. It shows SOURCE CONTROL: GIT in the window anyway!

I installed the new VSIX you supplied. I first had to uninstall the AL Outline extension. I then decided to uninstall the previous version of CRS-AL-Language too.

I manually changed my settings.json (in .vscode) "CRS.RenameWithGit": true rather than using the settings editor. Renamed my file and....

It works!

image

I did this first in a single folder rather than opening my workspace.

I then updated my workspace settings file and IT WORKS!

Thanks @waldo1001 love this tool

@waldo1001

This comment has been minimized.

Copy link
Owner

commented Mar 29, 2019

Great! Then I'm going to close this issue - if there is anything else, please open a new one ;-)

@waldo1001 waldo1001 closed this Mar 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.