-
Notifications
You must be signed in to change notification settings - Fork 43
Restrict parent directory traversal for finding the associated project #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restrict parent directory traversal for finding the associated project #251
Conversation
ced505f
to
1465694
Compare
When written like this, I see a problem if the user will have a folder in the workspace that is not under the user's home. For example, having a Maven project
|
Understood.
|
fec8965
to
992b22d
Compare
**Changes** 1. Added a launch-time JVM property for the netbeans LSP server "project.limitScanRoot", with its value set to the user's home directory path and the workspace folders, if any. - This is obtained using Node's `os.homedir()` function in *nbcode.ts* - Multiple paths are delimited by the OS-specific separator. 2. Added a configuration property "jdk.advanced.disable.projectSearchLimit" which can be used to turn off this new behaviour. **Reasons** - NetBeans supports searching for the build project information in the ancestor directories of the file or folder opened in a workspace. - Thus, NetBeans `org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation` supports a JVM launch property (i.e. System property) called **project.limitScanRoot**. - This prevents searching for the build project information when the opened file or folder is outside this specified path. Signed-off-by: Siddharth Srinivasan <[email protected]>
992b22d
to
90d6615
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @sid-srini
Changes
os.homedir()
function in nbcode.tsReasons
org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation
supports a JVM launch property (i.e. System property) called project.limitScanRoot.