intersystems-community / vscode-objectscript

InterSystems ObjectScript extension for Visual Studio Code
https://docs.intersystems.com/components/csp/docbook/DocBook.UI.Page.cls?KEY=GVSCO
Other
108 stars 49 forks source link

Newly created routine doesn't show up in explorer #712

Closed pprice-meow closed 3 years ago

pprice-meow commented 3 years ago

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.

isc-bsaviano commented 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?

pprice-meow commented 3 years ago

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.

pprice-meow commented 3 years ago

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.

isc-bsaviano commented 3 years ago

@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)

pprice-meow commented 3 years ago

It gives me a syntax error. Even changing the single quote ' to double " doesn't help

isc-bsaviano commented 3 years ago

@pprice-meow I just executed that query in my management portal and it worked fine.

pprice-meow commented 3 years ago

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

pprice-meow commented 3 years ago

No, I have a couple of namespaces set up with filtering at the ISFS uri but not this one.

isc-bsaviano commented 3 years ago

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())

pprice-meow commented 3 years ago

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.

pprice-meow commented 3 years ago

I meant and NOT a vscode problem.

isc-bsaviano commented 3 years ago

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.

pprice-meow commented 3 years ago

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).

isc-bsaviano commented 3 years ago

Thanks for the clarification. I will need to research this internally

isc-bsaviano commented 3 years ago

@pprice-meow I just did a quick test and I couldn't reproduce your issue. Here's exactly what I did:

  1. ZLOAD a mac routine
  2. ZSAVE it with a new name
  3. Open my VS Code workspace

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.

pprice-meow commented 3 years ago

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 // New routine

quit ZS ZS3907AL It shows up in the list on explorer. Now, I wonder, could there be anything in the routine I am copying that would cause these symptoms?
pprice-meow commented 3 years ago

Here's my entry in the workspace for the namespace I'm using:

    {
        "name": "audev:INS",
        "uri": "isfs://audev:ins/"
    },
isc-bsaviano commented 3 years ago

@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

pprice-meow commented 3 years ago

Yep. It works with the new routine. And using the SQL code above, the routine is not in the table output.

pprice-meow commented 3 years ago

I mean, the copy of a routine doesn't show up in the table. The new routine (from scratch) shows up in the table.

isc-bsaviano commented 3 years ago

@pprice-meow The new routines that I created using ZSAVE show up in the explorer (after refresh) and in the StudioOpenDialog result set.

pprice-meow commented 3 years ago

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.

isc-bsaviano commented 3 years ago

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.

pprice-meow commented 3 years ago

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

isc-bsaviano commented 3 years ago

The contents of the routines shouldn't matter. Since I can't reproduce this there's not much more I can do, sorry.

pprice-meow commented 3 years ago

I understand. Somehow I have to figure out how to edit these routines and i just hate vi!

isc-bsaviano commented 3 years ago

Do they show up in Studio?

pprice-meow commented 3 years ago

Linux... I don't use windows.

isc-bsaviano commented 3 years ago

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

pprice-meow commented 3 years ago

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.

pprice-meow commented 3 years ago

Aha! It shows up in studio on my VM. Now that's interesting. Why? I haven't gotten to Postman yet.

pprice-meow commented 3 years ago

And all the other routines I've created this way show up as well.

isc-bsaviano commented 3 years ago

That's interesting. I don't know enough about the inner workings of Studio to identify why that could be the case though.

pprice-meow commented 3 years ago

Also, as an aside, the routines show up in the management portal system explorer.

isc-bsaviano commented 3 years ago

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.

pprice-meow commented 3 years ago

I finally got the atelier api working. Those routines don't show up in the json output. (or xml)

isc-bsaviano commented 3 years ago

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.

pprice-meow commented 3 years ago

Well actually.... the GetDoc works. I was able to get to the routine that doesn't show up the GetDocNames list

isc-bsaviano commented 3 years ago

Interesting. I will look at how their implementations differ on Monday, maybe that'll lead somewhere.

isc-solon commented 3 years ago

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).

isc-bsaviano commented 3 years ago

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.