Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 218976 - editor settings lost during update to 7.3 (mimetype change issue)
editor settings lost during update to 7.3 (mimetype change issue)
Status: RESOLVED FIXED
Product: web
Classification: Unclassified
Component: CSS Editor
7.3
PC Linux
: P2 (vote)
: 7.3
Assigned To: Marek Fukala
issues@javaee
:
: 218820 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-25 13:02 UTC by paolosca
Modified: 2013-01-03 02:39 UTC (History)
8 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Custom keybindings file (683 bytes, text/xml)
2012-09-25 15:42 UTC, paolosca
Details
A patch (1.11 KB, patch)
2012-12-21 13:24 UTC, Marek Fukala
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description paolosca 2012-09-25 13:02:13 UTC
Product Version: NetBeans IDE 7.3 Beta (Build 201209232010)
Java: 1.7.0_03; OpenJDK Client VM 22.0-b10
System: Linux version 3.2.0-3-686-pae running on i386; UTF-8; en_US (nb)
User directory: /home/paolo/.netbeans/7.3beta
Cache directory: /home/paolo/.cache/netbeans/7.3beta

When editing CSS files I'm now unable to comment lines using the ctrl+shift+c shortcut.

I'm pretty sure this was working in NetBeans 7.2.

Regards,

Paolo
Comment 1 Svata Dedic 2012-09-25 14:53:48 UTC
Please check your userdir, look into
config/Editors/KeyBindings/
and if there's a file org-netbeans-modules-editor-settings-CustomKeybindings.xml, please attach it here.
Comment 2 Svata Dedic 2012-09-25 15:20:48 UTC
*** Bug 218820 has been marked as a duplicate of this bug. ***
Comment 3 Svata Dedic 2012-09-25 15:24:04 UTC
Marku, the behaviour was probably caused by the change of text/x-css recognized MIME type to text/css.
Because of other issues, certain editor key bindings (incl. toggle-comment action) are defined as 'removed' at the empty MIMEpath in userdir level and the 7.2 settings (imported by users) redefine the settings again for text/x-css. But since 7.3 recognizes CSS files as text/css, some settings (incl key bindings) are lost.

I am increasing the priority, since not only key bindings, but also other settings attached to MIME type will be lost as a result of changing MIMEtype. Please consider some migration step for 7.2 settings.
Comment 4 paolosca 2012-09-25 15:42:37 UTC
Created attachment 124889 [details]
Custom keybindings file

Original path: ~/.netbeans/7.3beta/config/Editors/Keybindings/NetBeans/org-netbeans-modules-editor-settings-CustomKeybindings.xml
Comment 5 paolosca 2012-09-25 15:50:26 UTC
Hi, thank you for looking into this so quickly, I attached the file you
requested.

As you already guessed I imported the settings after installing NetBeans 7.3
but there is a twist, the settings were exported from one the latest Dev Builds
which in turn imported the settings from the previous Dev Build and so on all
the way to NB 7.2 and probably even earlier.

Perhaps there should be a way to identify which settings should be imported
because they were customized by the user and selectively merge them with the
default NB settings.

Regards,

Paolo
Comment 6 Svata Dedic 2012-10-01 14:34:52 UTC
OK, I've pushed http://hg.netbeans.org/jet-main/rev/92dcc9ba1590 which should prevent extra unchanged bindings from saving in user configuration. 

I'll use the attached file when thinking about migration which could clean up old (broken) configurations. Reassigning to CSS, to evaluate impact of the mimetype change.
Comment 7 Marek Fukala 2012-12-21 13:24:03 UTC
Created attachment 129621 [details]
A patch

I haven't found any elegant way how to convert the settings.

There're basically two ways how I can imagine it could be done:
1) either change the folder name from

config/Editors/text/x-css to config/Editors/text/css 

during the settings import.

2) or do some kind of settings postprocessing later when the ide starts.

#1 - Haven't found a way how to do that declaratively by the imports file. Also it seems that there's no elegant way how to hook own code to the import process.

The only way is to implement a generic support for the above or hardcode the conversion in the core classes.

I've created a patch which *hacks* the CopyFiles o.n.upgrade.CopyFiles to do the folder name conversion.

If anyone can provide a better solution, s/he is welcomed!

I do not see any other option so far than integration the patch :-(
Comment 8 Marek Fukala 2012-12-21 13:27:04 UTC
I'd really appreciate an opinion on the comment#7 from someone from the core team.
Comment 9 Stanislav Aubrecht 2012-12-21 13:36:53 UTC
(In reply to comment #8)
> I'd really appreciate an opinion on the comment#7 from someone from the core
> team.

J. Skrivanek used to handle settings import AFAIK, he might have some better idea...
Comment 10 Jiri Rechtacek 2012-12-21 13:42:49 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > I'd really appreciate an opinion on the comment#7 from someone from the core
> > team.
> 
> J. Skrivanek used to handle settings import AFAIK, he might have some better
> idea...

CCing also Fanis as a current owner of import settings feature.
Comment 11 Theofanis Oikonomou 2012-12-21 14:24:01 UTC
(In reply to comment #7)
> I do not see any other option so far than integration the patch :-(

this is not ideal but I guess it would work just for this one case, so go ahead and integrate it. Please file also an enhancement in order to add a more easy way to handle similar issues in the future. Also keep in mind that this cannot be solved declaratively as at the point where import settings is involved nothing is loaded and this is why the .import file from etc folder is used. Thank you
Comment 12 Marek Fukala 2013-01-02 09:19:09 UTC
OK then. The patch is integrated in web-main#6ab8046928f2
Comment 13 Marek Fukala 2013-01-02 09:26:55 UTC
Bug 224370 - Support for hooking into the import process
Comment 14 Quality Engineering 2013-01-03 02:39:34 UTC
Integrated into 'main-golden', will be available in build *201301030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6ab8046928f2
User: Marek Fukala <mfukala@netbeans.org>
Log: #218976 - WORKAROUND - editor settings lost during update to 7.3 (mimetype change issue)


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