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
106 stars 48 forks source link

Server-Side editing Open items as in Studio #1379

Closed EnricoParisi closed 2 months ago

EnricoParisi commented 2 months ago

Using Studio is possible to open ANY "file" (class, routine, include, csp, csr, etc.) that is "available" (local or via mapping) in the current namespace. I don't think this is possible using VS Code, or at least, if possible, it's not as easy and simple.

For example, if I need to open a % class and I've copied the classname in clipboard from documentation (or I type it in), in Studio I just press ctrl-O, ctrl-V (or type the name) and press enter and the class is opened. This is possible not only for classes but for any other "file", for example if I want to open %occInclude.inc (a very popular include file) I can easily do it in Studio. In fact, in Studio using the File Open dialog I can select the file type I want to open and choose/browse from a list, this is also very useful if you don't remember the exact spelling/case of an item and provide autocompletion as I type as well. Another example, in Studio you can open the class and/or the routine(s) generated for an SQL statement, you get the class or routine name from Management Portal and in Studio you just press ctrl-O and paste the class or routine name and you have it opened.

Even for items that are part of the current virtual folder structure I did not find an easy way to open a class without browsing the virtual folder structure. If I have copied in clipboard a classname, say "HS.FHIR.DTL.SDA3.vR4.Address.Address.cls", how can I open it immediately? Browsing the folder structure is a pain! I've tried using the new "Quick Open" feature but that feature works only for "file" name, in my example the file name is "Address.cls" and I get a list of more then 20 files to choose from, many with similar packege name/path! Quick is an opinion.....

As a side note, to me the fact that for the class HS.FHIR.DTL.SDA3.vR4.Address.Address.cls the file name is actually Address.cls is...well...debatable, I consider the package as integral part of a classname. But maybe that my opinion.

IMHO in VS Code you should be able to open the same "items" I used to open in Studio. Hopefully as easily as in Studio.

I'm using v2.12.6-beta.1 with proposed API enabled.

isc-bsaviano commented 2 months ago

@EnricoParisi As I mentioned when we spoke at summit, this is a known limitation. For classes that are in your workspace folder you can use Ctrl-T to open them by name (i.e. with the dot separator instead of forward slash). However, that doesn't work for other file types or classes that aren't in your workspace folder. I see the value in being able to "just open anything", but this doesn't fit within any existing VS Code menus so I'd have to create a separate command just for this feature.

@gjsjohnmurray I'd like your opinion on this request.

EnricoParisi commented 2 months ago

@isc-bsaviano Thank you for the hint on Ctrl-T, however that works only for classes (strangely without .cls at the end), it does not seems to work for any other item/file type (.mac, .int, .inc etc.).

isc-bsaviano commented 2 months ago

@EnricoParisi I just opened a pull request that adds the requested command. I'd appreciate your feedback.