Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 409086 - [1.8][syntax highlighting] Only Strings are highlighted if a method contains a lambda expression
Summary: [1.8][syntax highlighting] Only Strings are highlighted if a method contains ...
Status: CLOSED DUPLICATE of bug 403927
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: All Windows 8
: P3 enhancement (vote)
Target Milestone: BETA J8   Edit
Assignee: Noopur Gupta CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 405305
  Show dependency tree
 
Reported: 2013-05-26 12:06 EDT by Timo Kinnunen CLA
Modified: 2013-05-28 14:32 EDT (History)
2 users (show)

See Also:


Attachments
Screenshot (14.21 KB, image/png)
2013-05-27 06:46 EDT, Noopur Gupta CLA
no flags Details
Workspace with test project (52.48 KB, application/octet-stream)
2013-05-27 12:45 EDT, Timo Kinnunen CLA
no flags Details
Screenshot showing missing syntax highlighting (72.46 KB, image/png)
2013-05-27 12:46 EDT, Timo Kinnunen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Kinnunen CLA 2013-05-26 12:06:38 EDT
Assign custom colors to classes, static and instance method calls, then add the following methods:

  private static void m1() {
    for(String s : Arrays.asList("Hello", "world")) {
      System.out.println(s);
    }
  }

  private static void m2() {
    Arrays.asList("Hello", "world").forEach((String s) -> {
      System.out.println(s);
    });
  }
  
Method m2 only has syntax highlighting in Strings "Hello" and "world". Further code additions to method m2 also don't get highlighted, unlike within method m1.
Comment 1 Dani Megert CLA 2013-05-27 03:58:39 EDT
Which build did you use? Note that our normal builds do not yet have any Java 8 related support and the UI work for Lambda is still in progress (see bug 405305).
Comment 2 Timo Kinnunen CLA 2013-05-27 05:41:17 EDT
Build is from source, following the instructions in Platform-releng/Platform Build and JDT Core/Java8 wiki articles. The build ID in installation details ended up as eclipse.buildId=4.3.0.I20130525-2218.

I'll try to use the latest versions in source control until more official builds are available.
Comment 3 Noopur Gupta CLA 2013-05-27 06:46:00 EDT
Created attachment 231539 [details]
Screenshot
Comment 4 Noopur Gupta CLA 2013-05-27 06:47:14 EDT
I am not able to reproduce the issue with latest code and JRE.
Attached a screenshot for the same in comment #3.
Please confirm with latest versions.
Comment 5 Timo Kinnunen CLA 2013-05-27 12:45:10 EDT
Created attachment 231565 [details]
Workspace with test project
Comment 6 Timo Kinnunen CLA 2013-05-27 12:46:31 EDT
Created attachment 231566 [details]
Screenshot showing missing syntax highlighting
Comment 7 Timo Kinnunen CLA 2013-05-27 13:04:51 EDT
Tested with JDK™ 8 Early Access Releases

May 23, 2013
8 Build b91 

and source code checked out after comment 4. The build process was: 

1) update source code according to http://wiki.eclipse.org/Platform-releng/Platform_Build#cloning_platform_source_tree:
 git fetch origin
 git merge origin/master
 git pull --recurse-submodules
 git submodule update
2) copy updated repository (D:\z) to a new directory (D:\x)
3) using an Eclipse 4.2.2 instance, add new local repository (D:\x) and check-out BETA_JAVA8 branches for eclipse.jdt.core and eclipse.jdt.ui (Git Repository Exploring->Git Repositories->x->Submodules->eclipse.jdt.core or ui->Switch to->Other...->Remote Tracking->origin->BETA_JAVA8)
4) do mvn clean verify in D:\x
5) extract  D:\x\eclipse.platform.releng.tychoeclipsebuilder\sdk\target\products\org.eclipse.sdk.ide-win32.win32.x86_64.zip to D:\build
6) copy jre folder from OpenJDK (C:\Program Files\Java\jdk1.8.0) to eclipse (D:\build\eclipse)
Comment 8 Markus Keller CLA 2013-05-28 09:43:07 EDT
We're just not there yet, that's why we didn't produce any preview builds yet.

This will be fixed as part of bug 403927. Currently, the BETA_JAVA8 branch doesn't use a JLS8 AST, since that's still work in progress. Noopur has probably enabled JLS8 in her workspace.

*** This bug has been marked as a duplicate of bug 403927 ***
Comment 9 Noopur Gupta CLA 2013-05-28 14:32:01 EDT
(In reply to comment #8)
That is correct. I have enabled JLS8 locally in my workspace. Sorry, didn't mention it earlier.