Author Topic: Slick-C Error inPython when typing "printf("  (Read 1447 times)

JeppeOland

  • Community Member
  • Posts: 44
  • Hero Points: 2
Slick-C Error inPython when typing "printf("
« on: September 14, 2023, 01:25:28 AM »
Obviously because I'm not a Python guy except in a pinch, so "printf" is muscle memory.
Anyways ... type it in SlickEdit, and it helpfully replaces it with just "print", but also pops up an error:
"Variable element or variable not initialized. file=codehelp.ex offset=27306"
Sometimes the first part is just a ?.

Dennis

  • Senior Community Member
  • Posts: 3998
  • Hero Points: 521
Re: Slick-C Error inPython when typing "printf("
« Reply #1 on: September 14, 2023, 12:43:36 PM »
I will look into this.  Could you send the the most recent part of <slickedit-config-dir>/logs/stack.log ?

Dennis

  • Senior Community Member
  • Posts: 3998
  • Hero Points: 521
Re: Slick-C Error inPython when typing "printf("
« Reply #2 on: September 14, 2023, 01:28:38 PM »
Never mind, that was easier to reproduce than I expected.

JeppeOland

  • Community Member
  • Posts: 44
  • Hero Points: 2
Re: Slick-C Error inPython when typing "printf("
« Reply #3 on: September 15, 2023, 07:30:54 AM »
Similarly, typing "numpy.sign(" replaces with "sin()" and gives the same error.
(replacing in this case is wrong since there IS a sign function)

Dennis

  • Senior Community Member
  • Posts: 3998
  • Hero Points: 521
Re: Slick-C Error inPython when typing "printf("
« Reply #4 on: September 15, 2023, 02:16:56 PM »
You can turn off the auto-correct feature by going to Document > Python Options... > Completion Options > | | Auto-correct identifier before operator.  The same option applies both to "." operators and function argument help / open paren.

I might be able to tweak things to handle the "numpy" case, I assume that the reason that it tries to replace with "sin" is because it can not find numpy.sign.  You could try creating a language specific tag file for Python in order to have the numpy module tagged.

JeppeOland

  • Community Member
  • Posts: 44
  • Hero Points: 2
Re: Slick-C Error inPython when typing "printf("
« Reply #5 on: September 15, 2023, 02:40:57 PM »
Is "numpy" not being automatically tagged?

Dennis

  • Senior Community Member
  • Posts: 3998
  • Hero Points: 521
Re: Slick-C Error inPython when typing "printf("
« Reply #6 on: September 15, 2023, 02:51:22 PM »
Looks like our automatic Python tagging only gets the standard Python packages.  Numpy is an add-on.

It is a pretty commonly used package, I might look into adding information for it to our "python.tagdoc". 
It might be a good idea to add PyTorch too.  I will look into it.

JeppeOland

  • Community Member
  • Posts: 44
  • Hero Points: 2
Re: Slick-C Error inPython when typing "printf("
« Reply #7 on: September 15, 2023, 03:02:09 PM »
Yeah those are pretty common.
Stuff like matplotlib.pyplot is also pretty frequently used.

Dennis

  • Senior Community Member
  • Posts: 3998
  • Hero Points: 521
Re: Slick-C Error inPython when typing "printf("
« Reply #8 on: September 15, 2023, 09:54:52 PM »
The original problem will be fixed in the next beta.  The proportion of "easy to reproduce" / "easy to fix" for this one was out of this world.

JeppeOland

  • Community Member
  • Posts: 44
  • Hero Points: 2
Re: Slick-C Error inPython when typing "printf("
« Reply #9 on: September 15, 2023, 10:09:26 PM »
Best kind of bug there is (for the guy fixing it) ;D

JeppeOland

  • Community Member
  • Posts: 44
  • Hero Points: 2
Re: Slick-C Error inPython when typing "printf("
« Reply #10 on: November 11, 2023, 02:04:01 AM »
On the final version now, but there are tons of errors like this still.
In a python file, if I type "slef." I also get a Slick-C stacktrace "file=codehelp.ex offset=-27132".