EditingFilesOutsideOfProject

Editing files that do not belong to a project in NetBeans.

Currently (as of NB 6.1) it is possible to use the "File/OpenFile..." menu or the "Favorites" browser to open and edit files that do not belong to any project, however it is not terribly convenient and we are not providing many important IDE features when editing such files.

Now as we are supporting for more and more scripting languages where the concept of project is too heavyweight in many cases we should start treating this scenario as a first-class citizen.

We hear users asking questions such as:

  • Why the editor does not work when editing a file outside a project?
  • How do I simply edit the files on my disk (typically, in a particular directory) without creating a project?
  • I only have JavaScript and HTML files, how do I edit them? Java web project is not appropriate for me.
  • Some people find it unintuitive to import PHP sources - they just want to open them and use them and not worry about the nbproject directory (mkleint: there doesn't have to be any nbproject directory, a lightweight project can identify the project folder either completely dynamically, eg. by figuring there's php files in this folder but not in parent folder, or it can mark the folder in a user transparent way, eg. by setting attributes on fileobject)


This wiki page will be used to gather all the use cases and ideas on how to address them. See also the umbrella issue #135222 for a list of enhancements and bugs in this area

Brain Storming Ideas

UI

  • opening files from the operating system - provide a way to associate extensions in the installer
  • it is already possible to do from the command line: use "netbeans --open [[[filename | [filename]]".
  • on Windows, you can register NetBeans to open all files with the .php extension, and it works as expected (when you doubleclick on a file, it will start NetBeans if it is not running already, or open the file in the existing instance if it is running. Unfortunately, on Mac this does not work: issue #137169.
  • when file that doesn't belong to a project it should be opened show it the Favorites view by default
  • running the file
  • rename Favorites to something else (File System Explorer?)
  • and maybe delete Files, just automatically show generic source roots from open projects in whatever Favorites is now called
  • Allow for selecting an existing "infrastructure" project when openning a file-outside-a-project. The project will be used to configure the libraries that the file could use, for autocompletion.
  • (Real scenario) OpenCms offers a nice Web-DAV feature that can be used to edit existing jsps. I'd like to quickly open one of those jsps and have the whole IDE formatting/styling/autocompletion functionality. Unfortunately, the file does not belong to any project, so no autocompletion available. Creating a real project (with the DAV-sources) is a no-go, as the DAV directory is huge, and netbeans tries to explore every file (it would take weeks until it is finished!). It'd be fantastic if I could somehow tell the IDE what classpath to use for autocompletion for those files.

API/Infrastructure

  • classpath
  • indexing
  • settings

Related Issues

  • The Client Side project suggested by the JavaScript debugger team
  • The Automatic projects idea investigated by Jesse
  • client side development of HTML/JavaScript files - integrating jMaki, JavaScript libraries etc.
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo