The new CRMScript Editor - Some feedback

lock
push_pin
done
Besvarat
42

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 em

Allt Svar (42)

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 em

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 fm

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

😥

11. dec. 2023 | 03:48 em

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 fm
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 fm

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 em
Thanks for the quick fix Sverre!
12. dec. 2023 | 02:04 em
Thanks Sverre - that was quick. :)
13. dec. 2023 | 01:40 em
Any news when this will be released to online prod?
23. jan. 2024 | 07:23 fm

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 em

- 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 fm

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 em

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 em

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

 

 

14. dec. 2023 | 10:43 fm
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 fm

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 fm
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 fm
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 fm
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 fm

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 fm
Great - thanks! :)
19. dec. 2023 | 03:08 em

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 fm
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 em
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 em

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 em

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 em
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 em

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 em
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 fm

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 em

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 fm

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 em

Any update on this? I also noticed that the array declaration breaks the collapsing of methods.

These issues are very annoying in the daily use of the code editor...

2. feb. 2024 | 08:53 fm

Hi,

I have checked around a bit, and there is some good information here:

https://codemirror.net/examples/lang-package/

However, the solution does not seem to be easy. I have posted a question to their forum, and we'll take it from there. I agree that it is frustrating with the crappy auto-indentation. We will try to make it better.

Sverre

7. feb. 2024 | 07:30 fm

Hi all,

I am currently working on a fix for this issue. If you could please send me code examples of indenting not working asap, I would appreciate it a lot :-) Actual code, not screenshots please.

Sverre

28. feb. 2024 | 11:01 fm
Hi,

Great to hear this is being worked on!

I will send you some examples using e-mail, i assume it is sverre.hjelm at superoffice dot com?
28. feb. 2024 | 11:04 fm

Hi all,

Creating a new language in CodeMirror which would work for CRMScript proved to be rocket science. Or neurosurgery. However, I did notice that using "javascript" as language for CRMScript works much better for autoindenting. Square bracket color highlighting seems to work less well, but I believe that is less important than indenting. For now, I have added a checkbox in the old "ticket.fcgi?action=debug" screen (the value is saved as a cookie in your browser) which allows you to override so that CodeMirror is using "javascript" as language for CRMScript instead of "cpp". It is the best I can offer right now. Please try it out, and if you believe that it works better, then we will probably make this the standard in future releases. The checkbox will be available in SOD tomorrow, and in our upcoming 10.3.3 release.

Sverre

1. mars 2024 | 11:24 fm
I do not see this option in SOD yet, i am on build SuperOffice CRM Online 10.3 Build Release_10.3.3_2024.03.01-01, which build is needed for this?
4. mars 2024 | 09:49 fm
I have the option in "SuperOffice CRM Online 10.3 Build main_10.3.3_2024.03.04-01"
4. mars 2024 | 10:39 fm
Any sight on this being enabled by default? or if not possible in the short run, store these settings in userpreferences instead of cookies? (would also be really useful for the 'show exceptions on screen' setting)
21. mars 2024 | 10:34 fm

Got the new build now on SOD, this works a lot better in javascript mode, all collapsing and indenting issues are solved in my tests. 

Only thing I noticed that it is suggesting javascript related snippits now, that propably should be disabled/removed

Please change the language mode to javascript by default in next release! 😃

6. mars 2024 | 09:20 fm

Hot to get the rest of the suggested api.methods when I see tree dots?

 

6. mars 2024 | 10:57 fm

Lägg till svar