Author Topic: How do I open a *.pbxproj to edit?  (Read 463 times)

spongyryno

  • Community Member
  • Posts: 19
  • Hero Points: 0
How do I open a *.pbxproj to edit?
« on: August 02, 2021, 04:40:00 am »
I frequently need to open *.pbxproj files (which are a flavor of XML), but SlickEdit keeps thinking that they are project files, and I cannot actually edit them.

Is there a way I can configure SlickEdit so that it will always treat them as text files?

Graeme

  • Senior Community Member
  • Posts: 2638
  • Hero Points: 330
Re: How do I open a *.pbxproj to edit?
« Reply #1 on: August 02, 2021, 09:27:22 am »
In tools -> options -> languages -> file extension manager, add pbxproj to the list of file extensions and select the language you want to associate.  You could choose "plain text" or if it is xml compatible you could choose "xml"  - or yaml etc.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5958
  • Hero Points: 467
Re: How do I open a *.pbxproj to edit?
« Reply #2 on: August 02, 2021, 12:58:08 pm »
vs -fn myfile.pbxproj

Using the file open dialog after opening SlickEdit also works
« Last Edit: August 02, 2021, 02:58:27 pm by Clark »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5958
  • Hero Points: 467
Re: How do I open a *.pbxproj to edit?
« Reply #3 on: August 02, 2021, 03:00:11 pm »
I meant to use the -fn invocation option. -f seems to work but I don't know why. -f is not an invocation option.

spongyryno

  • Community Member
  • Posts: 19
  • Hero Points: 0
Re: How do I open a *.pbxproj to edit?
« Reply #4 on: August 02, 2021, 08:57:09 pm »
In tools -> options -> languages -> file extension manager, add pbxproj to the list of file extensions and select the language you want to associate.  You could choose "plain text" or if it is xml compatible you could choose "xml"  - or yaml etc.

Graeme, I tried this---however, it's already configured correctly (as XML). However, even if I change it to "plain text", it still doesn't work. When I type:

Code: [Select]
vs foo.pbxproj
...it still doesn't open the file in the text editor. Rather, it *closes* every file I have open, and it treats it as a workpsace file. IOW, before I do this, the Project/Close Workspace menu option is disabled (because SlickEdit doesn't think there's a workspace open). After I run that command on the command-line, all text files that were opened are closed, and now this menu option is enabled. It thinks that "foo.pbxproj" is a workspace it should open. I never ever want SlickEdit to think this... I want it to stop thinking files with this extension are workspace files. Ever.


spongyryno

  • Community Member
  • Posts: 19
  • Hero Points: 0
Re: How do I open a *.pbxproj to edit?
« Reply #5 on: August 02, 2021, 08:59:19 pm »
vs -fn myfile.pbxproj

Using the file open dialog after opening SlickEdit also works

Clark... same thing. When I do:

Code: [Select]
vs -fn myfile.pbxproj
...it doesn't open the file in the text editor... in fact, it *closes* every file I had open, and now *enables* the Project/Workspace menu item. It thinks I just tried to open a workspace... but I didn't. I tried to open a text file to edit it. SlickEdit doesn't understand... this is not a workspace file.... it's a text file I want to edit.

spongyryno

  • Community Member
  • Posts: 19
  • Hero Points: 0
Re: How do I open a *.pbxproj to edit?
« Reply #6 on: August 02, 2021, 09:25:17 pm »
Note that I should also add: this isn't an issue with SlickEdit 2019. Only SlickEdit 2020.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5958
  • Hero Points: 467
Re: How do I open a *.pbxproj to edit?
« Reply #7 on: August 03, 2021, 12:31:13 am »
Code: [Select]
vs -fn myfile.pbxproj

works for me. I tested on macOS with SlickEdit 25.0.2 (latest 2020 version).

Can you post the exact command line you are executing?

Also, try a default config like this:

Code: [Select]
vs -sc /tmp/config -fn myfile.pbxproj

I just want to make sure that there aren't any configuration changes that are causing this problem.

There was a correction put in to SlickEdit 2020 to do a better job recognizing when a project file is specified.


spongyryno

  • Community Member
  • Posts: 19
  • Hero Points: 0
Re: How do I open a *.pbxproj to edit?
« Reply #8 on: August 03, 2021, 01:16:56 am »
I'm working on a PC, not on a mac.

The exact command line I'm using is:

Code: [Select]
vs.exe .\myfile.pbxproj
The contents of "myfile.pbxproj" can be anything, but even something as simple as this is 100% reprodicuble:

Code: [Select]
<xml>
</xml>

If I have any files open in SlickEdit at the time, they are closed. This is really frustrating and it's making SlickEdit unusable.


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5958
  • Hero Points: 467
Re: How do I open a *.pbxproj to edit?
« Reply #9 on: August 03, 2021, 02:26:02 am »
Try something like this:

Code: [Select]
vs.exe -fn .\myfile.pbxproj

The above command works for me on Windows.

If the above command does not work, try a default config like this:

Code: [Select]
vs.exe -sc <temp-config-directory> -fn .\myfile.pbxproj

Do you have an application which creates pbxproj files on Windows? SlickEdit thinks it's an XCode project file.

spongyryno

  • Community Member
  • Posts: 19
  • Hero Points: 0
Re: How do I open a *.pbxproj to edit?
« Reply #10 on: August 03, 2021, 05:33:08 am »
Okay, so the reason that:

Code: [Select]
vs -fn .\myfile.pbxproj


...wasn't working was because I still had lingering myfile.vpw, myfile.vpwhist, and myfile.vtg files. Deleting them made the "-fn" work. Thanks---that is definitely something.

However, I would prefer to somehow tell SlickEdit to never consider *.pbxproj files as project/workspace files, so that I could just do:

Code: [Select]
vs myfile.pbxproj

...without it closing all my files and not even working. How can I do that? Again, this works fine in SlickEdit 2019.

Quote
Do you have an application which creates pbxproj files on Windows? SlickEdit thinks it's an XCode project file.

No, not an application... but this is the extension used by many of the project files of our build system (that builds the Windows and Xbox OS).




Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5958
  • Hero Points: 467
Re: How do I open a *.pbxproj to edit?
« Reply #11 on: August 03, 2021, 10:06:35 am »
Hot fix added for this. Added def_open_workspace_exts macro variable which you can manually set from "Macro>Set Macro Variable...". It contains a space delimited list of all the file extensions that SlickEdit considers a workspace file on invocation. You can set it to blank if you don't want any specified files to be opened as a workspace (a reasonable setting).

Default setting for def_open_workspace_exts is as follows:
Code: [Select]
.vpj .vpw .dsw .wsp .vcw .pbxproj .xcodeproj .xcode .xcworkspace .sln .jpx .flp Cargo.toml

Note that Cargo.toml is not a file extension but a name without path.

spongyryno

  • Community Member
  • Posts: 19
  • Hero Points: 0
Re: How do I open a *.pbxproj to edit?
« Reply #12 on: August 05, 2021, 02:46:15 pm »
Thanks, Clark. In the meantime, is my best option to just go back to SlickEdit 2019?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5958
  • Hero Points: 467
Re: How do I open a *.pbxproj to edit?
« Reply #13 on: August 05, 2021, 02:48:58 pm »
Yes. Might be a few weeks before the next hot fix build is out. These changes will be in v26 beta 2. That will be out sooner (about 1 week).