This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 262070 - Code assistance c++11 with non-ascii IDs
Summary: Code assistance c++11 with non-ascii IDs
Status: STARTED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.0.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-16 23:23 UTC by maxdoukou
Modified: 2016-07-16 02:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The simple project. (13.12 KB, image/png)
2016-05-16 23:23 UTC, maxdoukou
Details

Note You need to log in before you can comment on or make changes to this bug.
Description maxdoukou 2016-05-16 23:23:04 UTC
Created attachment 159776 [details]
The simple project.

Even if I disable Code Assistance, 'à' is still highlighted in red. Is there a way to make Netbeans works with Unicode identifiers?

    OS Ubuntu 14.04 LTS.
    Compiler is set to CLang.
    In Project.Properties.General: Under sources, Encoding is UTF-8.
    This simple project compile/run without errors.

Thanks for your time.
Comment 1 Vladimir Voskresensky 2016-05-17 02:13:49 UTC
What is your NB version info? (Copy it from Help->About)

Thanks!
Comment 2 maxdoukou 2016-05-17 02:49:47 UTC
(In reply to Vladimir Voskresensky from comment #1)
> What is your NB version info? (Copy it from Help->About)
> 
> Thanks!

Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 2
Java: 1.7.0_101; OpenJDK Client VM 24.95-b01
Runtime: OpenJDK Runtime Environment 1.7.0_101-b00
System: Linux version 3.13.0-85-generic running on i386; UTF-8; en_US (nb)
User directory: /home/maxime/.netbeans/8.0.2
Cache directory: /home/maxime/.cache/netbeans/8.0.2

Here you go!
Comment 3 Vladimir Voskresensky 2016-05-17 13:05:28 UTC
Try to install 8.1 and then install all updates from IDE.
Comment 4 maxdoukou 2016-05-17 20:58:06 UTC
I did (8.1 and updates), but still
same errors like in the picture.
My version now:

Product Version: NetBeans IDE 8.1 (Build 201510222201)
Updates: NetBeans IDE is updated to version NetBeans 8.1 Patch 1
Java: 1.8.0_60; Java HotSpot(TM) Client VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Linux version 3.13.0-85-generic running on i386; UTF-8; en_US (nb)
User directory: /home/maxime/.netbeans/8.1
Cache directory: /home/maxime/.cache/netbeans/8.1
Comment 5 maxdoukou 2016-05-18 18:00:11 UTC
Is it suppose to work? Or it's still a not supported feature? 
I'll double check my configurations and try everything I can if it should work, if there is hope.

Thanks
Comment 6 Vladimir Voskresensky 2016-05-20 08:26:47 UTC
Yes, it's supposed to work. Although C++ standard doesn't recommend to use non ASCII symbols for IDs...
Comment 7 maxdoukou 2016-05-21 02:51:52 UTC
I reinstalled Netbeans 8.1 without updates and it seems a lot better.
Unlike in the picture, only 'à' is highlighted in red with code assistance activated.

'main' is in bold and the function 'main' appear in the window 'navigator'. So it seems very less broken. 

But still, I can't reference the 'à' with code completion, others variables without accent will work. 

Product Version: NetBeans IDE 8.1 (Build 201510222201)
Updates: Updates available to version NetBeans 8.1 Patch 1

Could the problem be in some configurations of 
Tools -> Options -> C/C++ -> Code Assistance -> Macro definition?

Or it's how the code behind parse identifiers? If so, where should I look...? Sorry for not really know where to start my research...
Thanks a lot.

I did the same installation process (8.1 without and with updates) on windows with the same results, with cygwin and clang.
Comment 8 Vladimir Voskresensky 2016-05-21 19:19:01 UTC
May I ask you why do you use the letter 'à' in identifiers which is not recommended by C++ language?
non Latin symbols in identifiers can break your code compilation on other compilers.
Comment 9 maxdoukou 2016-05-22 17:43:58 UTC
(In reply to Vladimir Voskresensky from comment #8)
> May I ask you why do you use the letter 'à' in identifiers which is not
> recommended by C++ language?
> non Latin symbols in identifiers can break your code compilation on other
> compilers.

Sure, it's simple, I'm French and I believe it will be supported soon by many compilers like Clang does. Words in french without accent means something different with accent.

For example: 'tâche' means task and 'tache' means stain, dirty mark. For the sake of programming in our own language, it get confusing to omit accents in so many circumstances. Programming in english will never be the same as programming in our natural language.

I thought in the new C++ Standards, identifiers can be composed of UCN (universal character name), even though it is not recommended...for now...

Thanks!
Comment 10 maxdoukou 2016-05-24 13:12:03 UTC
I forgot to tell it's for personnal project. Commercial project benefits a lot more for a common standard language, of course.
Comment 11 Vladimir Voskresensky 2016-07-15 17:43:03 UTC
editor's lexer:
http://hg.netbeans.org/cnd-main/rev/d4ba833dfa8a

apt lexer:
http://hg.netbeans.org/cnd-main/rev/6113a2786627
Comment 12 Quality Engineering 2016-07-16 02:09:19 UTC
Integrated into 'main-silver', will be available in build *201607160002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/6113a2786627
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixing #262070 -  Code assistance c++11 with non-ascii IDs
- fixing editor's lexer part