The new CRMScript Editor - Some feedback

lock
push_pin
done
Besvaret
31

Hi,

We noticed this morning that you have launched a new CRMScript "editor".

But, we quickly found a few errors that is causing our day to day to become much harder.

1. Indentation does no longer work.
Ctrl + A and then Shift + Tab would indent the code, not it just moves everything to the left.

2. Bracket highlights does not always work.

Works just fine

The else does not.

Seems quite hard to recreate when i try to do it "manually", but we have seen this issue in multiple customer enviroments, and, the code works just fine

3. String highlights does not always work.

As you see on the log, the debug16 part should be green.

Any suggestions?

6. dec. 2023 | 01.14 PM

Alle Svar (31)

Co-sign. I noticed all of the same things Pär mentions.

Another thing is that I find the colors too muted. For example when you've added one too many parantheses, the red background color indicating there's too many is barely visible:

 

Compared to before where the parantheses itself was highlighted in a clear red - much easier to see:


Also, the tracing is very wonky now. If you drag and slide the trace bar back and forth, the same variables will be added multiple times.

On a positive note: Yay for search and replace functionality!

6. dec. 2023 | 01.27 PM

New editor

Old editor

 

Highlighting goes wrong here in new editor.

 

=====

New intellisense - maximum of 7 items in window

Old Intellisense

Much more items are available in the intellisense window.

 

========

"F11" for "full-screen" editing not working anymore

 

 

 

7. dec. 2023 | 09.43 AM

The new editor also breaks a lot of the indenting in scripts if you tab for indentation:

😥

11. dec. 2023 | 03.48 PM

Hi guys,

Sorry for making your working environment more difficult. We will look into the defects you have pointed out and try to fix them.

Sverre

12. dec. 2023 | 08.00 AM
Out of curiosity - isn't it possible to keep the current/old editor active until most of the items mentioned are fixed? Or is there a good reason/necessity for the continuation of the roll-out of the new editor (including the issues mentioned in this topic)?
12. dec. 2023 | 08.06 AM

Hi guys,

I have comitted a fix for some of this:

  • Shift-Tab will reindent section (not de-indent).
  • F11 will toggle full screen.
  • Mismatching bracket will be red.
  • Intellisense list is larger (3x).

I am unable to reproduce the incorrect bracket matching you pointed out, Bas. Do you have some more code for this?

I do not think the new editor is the cause for the tracing-variable bug. I have seen that one for quite some time. It should be fixed, but that is outside this particular task.

The language mode i no longer "c-like" (from codemirror v3), but "cpp". There is no c-like mode anymore. I think this has some subtle impacts on the functionality, without knowing exactly what they are.

The changes will become available in standard nightly-upgraded SOD sites by tomorrow, Wednesday 13. Dec. Could you please try out the editor there and let me know how it works?

Sverre

12. dec. 2023 | 02.02 PM
Thanks for the quick fix Sverre!
12. dec. 2023 | 02.04 PM
Thanks Sverre - that was quick. :)
13. dec. 2023 | 01.40 PM

That's great news!!!

Regarding my earlier reported issue - you can reproduce it via the following code:

 

#setLanguageLevel 4;
String source = "test blabla etc";
String[] words = source.split(" ");
Integer[] customerIds;
Integer[] categoryIds;
12. dec. 2023 | 03.45 PM

- Exclamation marks are yellow in old editor, "same blue color" in new editor (less visible/less recognizable)

- Parentheses are less recognizable in new editor, "same blue color", in old editor they were marked as white.

 

13. dec. 2023 | 07.10 AM

Building on what Bas said about exclamation marks. It's actually all operators. They used to be yellow, now they're all light blue, same as the rest of the text. Makes it much harder to read.

Before:

 

 Now:

13. dec. 2023 | 01.38 PM

Just had/have a problem at a customer using Release_10.2.11_2023.12.07-04 we where not able to update a script.
Every time we pressed save after changing the script - the script reloaded the original script into the editor (we used MS Edge).
Is this related to 'The New CRMScript Editor' or is this another problem(I have never had this problem before)?
We tried to log out and in again.

(I really love the search and replace feature and caseinsensitive intellisence) 

13. dec. 2023 | 01.57 PM

In the old version you got all suggestions when pressing ctrl + space. now you only get one suggestion.

 

 

14. dec. 2023 | 10.43 AM
I noticed this as well yesterday. The other stuff I can accept for now since it's mostly appearance-related, but this one truly hampers functionality and productivity.
15. dec. 2023 | 08.26 AM

I don't like at all that seleting part of code will automatically select all other parts. I get confused and scared that I will remove the wrong codeline when this happens.

 

 

14. dec. 2023 | 10.46 AM
This is not a bug, but a new feature that I've personally wanted in the editor for a long time. The idea is that it highlights all the other matching text. Only when you press Ctrl+Shift+L it actually selects all that other text, and you can then quickly edit multiple lines at a time. Very handy in some cases. VSCode has the same functionality.
15. dec. 2023 | 08.40 AM
ok, maybe it is get feauture then, that I just need to get used to first . But I would prefer if the part I select has a brighter color than the other parts. As in picture above I almost not see the part I selected, but I see everything else.
15. dec. 2023 | 09.12 AM
On that I agree. It's a little odd that the highlighting of the other text you are not actually selecting, is more visible than the text you ARE selecting.
15. dec. 2023 | 11.57 AM

Hi all,

Again, thanks for your feedback. I have fixed the select and select-matches colors like this:

(Bottom is selection, the two others are the matched ones). These colors are quite subtle, but I wanted to keep the selection color the same as the old editor. And consequently, when the matched ones should be less strong, it became quite close to the background. 

Multiple autocomplete options has also been fixed.

Yellow operators have been fixed.

And finally, I have fixed the bug Morten reported which is quite critical. In some conditions (perhaps only using Edge), there is a race condition allowing the submit of the form to be processed before the blur of the editor, causing the content of the editor to not update the CGI-variable, and consequently loosing the changes in the editor. A temporary workaround would be to click outside the editor before clicking the Ok/Apply button. But the fix I am submitting now should fix this properly.

Sverre

18. dec. 2023 | 09.30 AM
Great - thanks! :)
19. dec. 2023 | 03.08 PM

I assume these changes will be available tommorow in SOD? I just saw we have a new build in our SOD and production sandbox environments now (SuperOffice CRM Online 10.2 Build Release_10.2.11_2023.12.15-06)

Re the indenting, I still see this issue in scripts created with the 'old' editor.

18. dec. 2023 | 09.58 AM
Hi David,
Yes, this will be available in SOD for testing tomorrow. Can you elaborate a bit on the indenting issue you are experiencing? Does the code look like that immediately when you open the code (i.e. a classic tab used to be 2 characters but is now 8)? Or does it happen when you reindent?
Sverre
18. dec. 2023 | 12.19 PM
Hi,
It is like this immediately when opening the code, changing the indenting of the code in the new editor works correctly.
18. dec. 2023 | 12.49 PM

Hi David,

I changed the column width of tab yesterday from 4 to 2, same as indenting width. Did it help?

Sverre

19. dec. 2023 | 01.45 PM

Hi,

No change:

 

Build 'SuperOffice CRM Online 10.2 Build Release_10.2.11_2023.12.18-02'.

If i paste the same code into the classic editor, it is indented correctly:

 

19. dec. 2023 | 02.15 PM
Your version is wrong because you are on the Release-build. You'd want todays build for main, like this: "SuperOffice CRM Online 10.3 Build main_10.3.1_2023.12.19-01". Not sure how you could switch to that one.
19. dec. 2023 | 02.40 PM

In the old editor, without it being in "edit" modus, you were able to use the "Find" function. In the new version, CTRL + F no longer works which makes it difficult to search inside code when you are looking at it in "read-only" mode. This is especially harmful when you are evaluating a trace-result and want to do "handson-searching" inside the code (tested in Chrome).

5. jan. 2024 | 03.39 PM
1+
And, the possibility to copy a script without being in edit mode, now ctrl + a marks the whole page and only the visible part of the script
8. jan. 2024 | 07.01 AM

Cursor alignment when going to the new line is also broken,

Previous editor

(see the cursor position on line 37 after pressing enter at the end of line 36)

New editor:

(see the cursor position on line 626 after pressing enter at the end of line 625)

Do note that I am indenting with tab.

Tested on release SuperOffice CRM Online 10.2 Build Release_10.2.11_2023.12.18-02

 

8. jan. 2024 | 12.18 PM

Hi David,

Can you show some more of the code that is not working? From my experience, it works in some cases and not in others. I have not had time to narrow it down, but it seems for instance that foreach() will break it. Which I guess makes sense, since it is not a legal C++ keyword.

Sverre

15. jan. 2024 | 09.43 AM

Hi Sverre, I did some experimenting, it breaks when an array declaration is involved.

Notice the cursor position when going to the next line (using enter)

No array:

With array:

tested on version SuperOffice CRM Online 10.3 Build Release_10.3.1_2024.01.12-04

16. jan. 2024 | 01.27 PM

Tilføj svar