Author Topic: Build, Edit build tool?  (Read 4985 times)

SimonHF

  • Community Member
  • Posts: 43
  • Hero Points: 0
Build, Edit build tool?
« on: December 12, 2014, 06:41:21 pm »
I added a couple of build tools using "Build, Add new build tool". However, there are some problems:

1. How to edit the build tools added?

2. The added build tools seem to show up randomly. If I have 50 files loaded with the same extension then the build tools added only show up in the build menu on about 70% of the files :-( How to fix this?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6468
  • Hero Points: 504
Re: Build, Edit build tool?
« Reply #1 on: December 12, 2014, 07:39:10 pm »
1. Use Project>Properties and click on the Tools Tab. I don't have the editor in front of me right not but I think thats where all of the build tools are.

2. I have no idea what you've done. Not enough information. Please tell me you created a project first and you're not using extension specific projects. If you add a build command to an extension specific project, it will only show up when that extension is active. Maybe you did that.

hs2

  • Senior Community Member
  • Posts: 2757
  • Hero Points: 291
Re: Build, Edit build tool?
« Reply #2 on: December 12, 2014, 07:39:29 pm »
Build Tools are configured per project and should be visible in the Project Properties. Beware that they might be different for Debug/Release so the (current) build configuration should match in this case. For files not part of the current project build tools might be disabled, but I'm not sure at the moment. The file extension is not important as far as I know.
HS2

SimonHF

  • Community Member
  • Posts: 43
  • Hero Points: 0
Re: Build, Edit build tool?
« Reply #3 on: December 12, 2014, 08:47:23 pm »
Thanks for this info. So first of all, I have no project defined. So here is what I found out by looking at the project properties for a .php file where the build tool shows and does not show (note: both files are .php files):

foo.php does not show the build tools and project properties does not show the build tools, however it says "Settings for: .phpscript" but the ".phpscript" is greyed out.

bar.php does show the build tools and project properties does show the build tools, however it says "Settings for: .html" but the ".html" is greyed out.

So why does it think that one .php file is html and the other is phpscript?

It's also interesting that the color of each file is different for each too! bar.php has the single line "<?php" at the top with a white background, and the background for all other lines is grey. Whereas with foo.php, all lines have a white ground. Both files have "<?php" as the first line. What gives?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6468
  • Hero Points: 504
Re: Build, Edit build tool?
« Reply #4 on: December 12, 2014, 09:07:56 pm »
You can override defaults per file which you may have accidentally done. To fix do the following:
  * Edit foo.php
  * go to Document>Select Mode and choose "HTML".

A .php file is really a .html file with php script code embedded in it. That's pretty simplified but it's pretty close to how SlickEdit thinks.


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6468
  • Hero Points: 504
Re: Build, Edit build tool?
« Reply #5 on: December 12, 2014, 10:35:00 pm »
If you want to get the most power out of SlickEdit, you really need to create a workspace/project and add all your source files. That way, you can quickly open files from the Open or Files tool windows. For example, if you have a file called foo.php in some directory which isn't the current, you can quickly open it from the Open tool window or Files tool window if the current workspace/project has that source file in it and you never need to type a path.

By creating a workspace/project you also get way better symbol analysis features (sorry namespaces don't work yet).

This will also fix your Build menu issues since you won't be using extension specific projects.

SimonHF

  • Community Member
  • Posts: 43
  • Hero Points: 0
Re: Build, Edit build tool?
« Reply #6 on: December 13, 2014, 01:52:03 am »
Thanks for the info.

There's over 25,000 .php files in the project. Typically I have about 100 files open but they are spread randomly across the 25,000 .php files. Will SlickEdit handle that? Right now, I grep for a file that I'm interested in on the command line, then open it from the command line. It's a large code base.

I am currently tagging all the files. You mention better symbol analysis with projects. Like what?

In which approx. timeframe do you expect the namespaces to be working?

Why does SlickEdit see some .php files as .phpscript and some as .html? Can I predict it or force it somehow?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6468
  • Hero Points: 504
Re: Build, Edit build tool?
« Reply #7 on: December 13, 2014, 02:29:42 am »
Normally I would say 25,000 files isn't that much for tagging but I've never tried a ton of HTML with embedded PHP. You say you are currently tagging all the files. Did you use the Tag Files dialog? If so, I recommend you remove that tag file, create a workspace/project, and add files files to the project. There won't be a difference in symbol analysis but it will be much easier to open files in the workspace. You use the command line so "e name-without-path" will kick but.

Here's another tip. Use "sgrep" in the Build window since next-error, prev-error, and cursor-error work (sgrep <something> -t "*.php").

The good news is that namespace support for PHP will take a high priority. Right now, it doesn't look like we can add it until v20.

I assume the .html vs .phpscript you are seeing is because you brought up Project Properties and you don't have a project open. It should always show .html for a .php file unless you manually changed the mode and it got saved away. Can you reproduce this (.phpscript shown) with a default config by just editing a particular file? Start SlickEdit with "vs -sc some-directory-which-does-not-exists" for a default config.