Ctl click doesn't jump to server functions anymore

I’m on chrome on Linux : Version 73.0.3683.103 (Official Build) (64-bit)

Used to work, doesn’t now (as of 2 days ago, though Ubuntu might have updated Chrome whilst I’ve been away). Also fails to jump to functions in included modules (client & server) - it used to, I’m sure…

Works for local functions & stuff, and the problem survives page refreshes.

Here’s a short vid showing it :

nojumplink

Tested on FF as well - 66.0.2 (64-bit) - same result.

Amazing how much you come to rely on something …

Out of curiosity, how did you know to even try CTRL-click? Are these shortcuts documented anywhere?

1 Like

I asked for it a while back on the forum, I can’t remember if I got a notification or whether I just tried it out of habit (I use PyCharm on the desktop as well as PHP Storm, both of which have it).

No documented list exists as far as I know. I did ask for one a while back …

Then let’s start building one – based on reality-checks, of course!

Which category do you think it belongs in?

I would suggest “Show N Tell” - make it a sticky so easily referenced.

It also needs organization.

It’s clear we need to not only what action to take (CTRL-Z, click, shift-click, hover, …), but often, where to apply it, e.g., to a control, a border, a keyword, an identifier, a widget Property field, etc.

If we’re going to distribute/collect submissions from informed users, a standard notation for the above would help.

Moving to Bug Reports - CTRL-click should still take you to the funciton definition.

Regarding documentation: we have new and improved documentation in the works. It will include more about ‘using the Anvil editor’ than we presently have.

Overhauls of the undo/redo and CTRL-F find mechanisms are also near the top of our roadmap, so navigating the code should generally get easier!

2 Likes

Usually the ctrl+click stops working when there is an error on a module. And by error I mean anything that the ide considers wrong, like actual syntax errors, but also f-strings, duplicate function names, etc.

Often I edit a server module in pycharm and I use f-strings, then I push the module to Anvil and the ctrl+click stops working. Sometimes only on the functions defined on that server module, sometimes on all the functions.

I went back to an older, untouched for ages project that I know has no errors in and the problem is still there - fine on local variables and functions but not on server functions.

Wonder if something has changed in a new release of Anvil that sees something as an error whereas before it wasn’t?

I’m going to go through my projects carefully and see if anything is in red …

Also - I suppose it’s worth knowing if anyone else is seeing this? If not then the issue is likely to be mine, I guess.

Brand new projects are fine - ok, so it’s something in my existing projects that’s no longer acceptable.

Gawd …

Right,

this is odd. 5 of the projects that stopped working have miraculously started working again. Then one stopped again. Then it started again (about 20 minutes between those points).

Note by working I mean the links are control-clickable, the apps always worked fine.

None of my modules have, that I can see, any errors. Nor did I do anything consciously at least to alter the projects.

Erm…

EDIT -
now they are all broken again!!

There’s no rhyme or reason to it that I can see. It will be broken one minute, then clicking around different forms (not changing anything) it will suddenly start again. I’ve tried resaving (in the hope it would rescan) but it makes no obvious difference. Tried running the app in the IDE but again no obvious affect.

Do your server modules have http endpoints?
If yes, is the address at the bottom of the editor visible?

I noticed that when the ctrl-click breaks also that address disappears.

No, these are all @anvil.server.callable functions.

I’m manually & visually checking for any errors that are not shown as errors in the IDE (ie the IDE is just not picking them up), but nothing so far.

I do have dependencies on other apps, and I import other server (non-client-callable) functions from modules, so I’m wondering if it’s some combination that’s confusing the IDE. There doesn’t seem to be anything actually wrong because the app works perfectly.

Please DM me clone link(s)! (From your description, my first guess is that something funny happens on app load/parsing that puts our autocompleter out of joint; my guess is that if you refresh your browser and load an app from scratch, and then open the same Python modules [forms/modules/etc] in the same order, you’ll always get the same result [working / not-working]. If we can get it reproducing, we can get it under the microscope and fix it!

bump - any progress on this?

Hey - yes! We investigated (thanks for your DM-ed clone link, which allowed us to reproduce it), and found that the issue is the order in which modules are parsed. (You need to have parsed the function definitions - to know where they’re defined - before you parse the thing that links to them). PyCon then got in the way :slight_smile:

tl;dr - We’ve made progress, and it’s on the list!

Thanks.
Is there any “quick fix” way to force the scanning of the server functions? I’ve got a rather large project and it’s, er, challenging.,…

I try and keep the project open so I don;'t have to, but it gets shut down sometimes.

Another symptom -

if you have a ctl-clickable function (that works), and you make a mistake on the form (ie create an error), the link is no longer ctl-clickable.

This means over 30-odd modules I have to keep cycling round opening the server modules to restore the ctl-click links.

I do appreciate you’re working on it, but this is new info (from me at least) and thought it might help.

edit - actually, it’s a little more nuanced than that. If I create an error and then fix it, but I click away from the previously erroneous bit, the link remains broken. If I correct the error and (say) press the space bar on the same line, the link gets re-established.

Not sure if this helps you in any way, but here’s my example :

from Response import Response
...
Response = anvil.server.call("myfunc")
..

“Response” contains a class definition, and the link is broken when I do this. If I replace “Response” with a regular variable and click away from the line, the link stays broken. But if I replace it and press the space bar afterwards, the link is re-established.

edit 2 - sometimes if I start typing elsewhere on that page the link gets re-established as well (when broken in this way). Dunno if any of this is of any use to you.

Did this get fixed?

It looks like it did, but no announcement?

In some circumstances – still chasing it down in others! Don’t want to jump the gun before it’s properly nailed down…

1 Like