Skip to content
This repository has been archived by the owner on Apr 10, 2021. It is now read-only.

File naming when using NetBeans "New File" wizard #73

Open
ZaLiTHkA opened this issue May 21, 2015 · 4 comments
Open

File naming when using NetBeans "New File" wizard #73

ZaLiTHkA opened this issue May 21, 2015 · 4 comments

Comments

@ZaLiTHkA
Copy link

In a nutshell: Trying to create a new .editorconfig file from within NetBeans (Windows platform, NB 8.0.2 x86) doesn't allow the file to be saved without a filename.. Which means it can't be created using the built-in new file dialog in such a way as to be read by the plugin.

I'm not sure if I could build it myself, since I'm very much a script junkie playing in the Java sandpit here, so if I could make a request/suggestion: Could the plugin perhaps make use of a project context-menu branch?

I'm just thinking, a sub-menu here would allow space for options such as:

  • EditorConfig ->
    • New config file here
    • Edit config file

The "new" menu item would obviously create a config in the project root file if used on the project name (I believe that's called a project "node"?), or in the selected folder otherwise.

The "edit" item could scan up the project tree, starting at the selected folder, and open the first .editorconfig file it finds. Naturally, the last one in the list would be the "root" file.

And as an added bonus, this way you also don't need to worry about accidentally creating badly named config files... (:

@johnny-bit
Copy link

Can confirm same behaviour on Linux with
Product Version: NetBeans IDE 8.0.2 (Build 20150207-unknown-revn)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 1
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14

@Yserz
Copy link
Member

Yserz commented May 23, 2015

Hey, thanks for your comment.
The behaviour is already known and is related to the default NetBeans "create file" wizard. In there it's not possible to define a file without a name (in general for NetBeans). For this we accept editorconfig files with names as well. This is also allowed by the spec. So if editorconfig files with names are not accepted by the plugin this is a bug.

@ZaLiTHkA
Copy link
Author

I can find no issues with reading the files, both with a normal filename and a "hidden file" name. I was simply trying to point out a quirk about the NetBeans file creation wizard that didn't meet the plugin's needs.

Don't you think a project context menu would be this plugin's best friend..? :) I certainly do..

[edit]: I've just updated the issue title to be more direct with the regards to the root of the discussion.

@ZaLiTHkA ZaLiTHkA changed the title Naming issue with creating new control file File naming when using NetBeans "New File" wizard May 24, 2015
@junichi11
Copy link
Member

@bennyn @Yserz Probably, we can use .editorconfig as a new file name if the template file name is changed from EditorConfigExample.editorconfig to .editorconfig. It will be new.editorconfig by default. But we can just remove new in the new file wizard like an empty file.

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants