Closed pprice-meow closed 3 years ago
@pprice-meow VS Code uses the %Library.RoutineMgr_StudioOpenDialog()
query to fetch a list of documents in a namespace. How did you create this routine? Are you editing client side or server side in VS Code?
I've tried it a few ways. First, I tried the +file button in the explorer. I got a message saying that the routine already exists and that I don't have an override flag set. Then I went to Cache (or IRIS happens on both) and enter a few lines of code and ZS it. Back to vscode and it's not there. Next, I went to Cache (same on IRIS) and ZL a routine and ZS with a new name. Still not there.
Yes, I am editing on the server side.
One thing I hadn't noticed... If I don't add an extension (.int or .mac) that's when I get the message I can't create the routine with the +file button. So that's my mistake.
I still have a few routines that I've ZL and ZS with a new name that are not showing in the explorer window. This is essentially copying and editing new routines. It doesn't happen all the time though.
@pprice-meow Do you have any query parameters in your ISFS uri for your workspace config? If so, that will affect the files that get shown in the explorer. Can you run this query in the namespace that you've created the routines in and see if the routine shows up in the result set? It will return all routines in the namespace.
CALL %Library.RoutineMgr_StudioOpenDialog('*.mac,*.int',1,1,1,1,0,0)
It gives me a syntax error. Even changing the single quote ' to double " doesn't help
@pprice-meow I just executed that query in my management portal and it worked fine.
No. I ran in in Cache at the > prompt... How do you run this in a management portal? To me, the management portal is /csp/sys/UtilHome.csp
No, I have a couple of namespaces set up with filtering at the ISFS uri but not this one.
System Explorer -> SQL. Make sure you switch to the correct namespace. Alternatively, you can execute SQL queries in terminal if you start the SQL shell (d $system.SQL.Shell()
)
Aha! That works. And nope. The routines that I'm looking for are still not there. I can ZLOAD them in Cache but not see them here. Sounds like an Intersystems problem and a vscode problem.
I meant and NOT a vscode problem.
Just to clarify, you see this behavior with routines that you create in VS Code and with routines created using ZS? Or was the VS Code file creation issue solely the lack of an extension as addressed above? Also, you can edit your comments, just click on the three dots on the top right of the header for that comment.
It is when I ZSAVEd the routine in Cache. The vscode problem was just when I didn't put an extension on the filename. SPE (Stupid Programmer Error).
Thanks for the clarification. I will need to research this internally
@pprice-meow I just did a quick test and I couldn't reproduce your issue. Here's exactly what I did:
In my ISFS folder for that server and namespace, I see both the original mac routine and the new int routine. My ISFS folder uri has no query parameters.
I'm doing this with an intermediate routine. (.int) I just did it again with a new routine name. And have the same problem. BUT when I start with
ZR K
ZS3907AL
Here's my entry in the workspace for the namespace I'm using:
{
"name": "audev:INS",
"uri": "isfs://audev:ins/"
},
@pprice-meow I don't think that the contents of the routine should matter. Are you refreshing your VS Code explorer after you do the ZSAVE? It's right next to the new file and folder buttons
Yep. It works with the new routine. And using the SQL code above, the routine is not in the table output.
I mean, the copy of a routine doesn't show up in the table. The new routine (from scratch) shows up in the table.
@pprice-meow The new routines that I created using ZSAVE show up in the explorer (after refresh) and in the StudioOpenDialog result set.
shrug I don't know what to say. Maybe something is corrupt in my CACHE.dat for that namespace/volume. It's just frustrating. I am working to move out of Cache into IRIS. Maybe if I create a new IRIS volume and namespace then %RO the routines... that may get them to show up.
I know what it's like trying to run down a problem when you can't recreate it.
I'll see what I can do in the mean time.
Does the namespace that you're using have complex routine mappings? Maybe the new routines that you're creating are being stored in another database. I'm using the USER namespace on a recent IRIS.
Nope. Nothing complex. It's my development platform so no routine mapping.
And... I just did a ^%RO from the Cache system and an ^%RI in IRIS... I watched them come into IRIS and compile... I started a new instance of vscode and opened the new IRIS and new namespace for these routines...
And... they still don't show up in the list! ARGH!
I'd love to send the routines to you but confidentiality and what not...
The contents of the routines shouldn't matter. Since I can't reproduce this there's not much more I can do, sorry.
I understand. Somehow I have to figure out how to edit these routines and i just hate vi!
Do they show up in Studio?
Linux... I don't use windows.
Do you have a REST client like curl or Postman handy? Can you try getting the contents of the routine using the Atelier API? I'm curious if you get a not found error
I'm setting up a windows VM and I do use postman. I'll look at the Atelier docs. I used to use Atelier exclusively but seeing the writing on the wall... I moved to vscode.
Aha! It shows up in studio on my VM. Now that's interesting. Why? I haven't gotten to Postman yet.
And all the other routines I've created this way show up as well.
That's interesting. I don't know enough about the inner workings of Studio to identify why that could be the case though.
Also, as an aside, the routines show up in the management portal system explorer.
Thanks for the extra info. I still don't know why you're seeing this bizarre behavior. One takeaway from this though is that you should be doing your development exclusively in VS Code if possible. Sticking to one IDE will help avoid this issue and files getting out of sync. If you get Postman running and can send a request to the Atelier GetDoc API, let me know what the result is.
I finally got the atelier api working. Those routines don't show up in the json output. (or xml)
Ok. I wouldn't expect them to show up in the list if you called GetDocNames but I was hoping that calling GetDoc would return the text instead of 404.
Well actually.... the GetDoc works. I was able to get to the routine that doesn't show up the GetDocNames list
Interesting. I will look at how their implementations differ on Monday, maybe that'll lead somewhere.
I am using VS Code in client-side editing mode. I created a new routine using ZS. I also ZLoaded an existing routine and ZSaved it with a new name. Both showed up in the Explorer. Both are .int (as expected). When I open them in VS Code, both have ROUTINE routinename [Type=INT]
as the top line (as expected).
Thanks for the confirmation @isc-solon.
@pprice-meow Since this can't be reproduced on my end, I think it's fair to say that this is a weird aberration with your specific system/routines. I'm going to close this issue for now. If you find a better way to reproduce it, feel free to reopen.
New routines aren't showing up in the explorer list. The refresh button doesn't seem to work.
Create a new routine in a Cache namespace. Although this doesn't work all the time. The routine shows up in the ^ROUTINE global but not in the explorer list. I have a series of routines named ZS3904**.int that are in explorer but one ZS3904AL.int that is not. This is not the only routine that doesn't show up. I am experiencing this on multiple systems. I develop using linux workstation on Cache running on linux.
Is there another global that has the list of routines for the explorer? The routine appears in both ^ROUTINES and ^rINDEX.