From jlahoda at openjdk.java.net Tue Feb 1 15:34:58 2022 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Tue, 1 Feb 2022 15:34:58 GMT Subject: RFR: 8274148: can jshell show deprecated classes, methods and fields as strikethrough text? [v2] In-Reply-To: References: Message-ID: > This adds a limited highlighting for JShell. It underlines keywords, highlights declarations and shows deprecated elements inversed (on platforms other than Linux) or with a strikethrough (on Linux). > > For example, non-Linux platforms: > ![jshell-coloring-other](https://user-images.githubusercontent.com/51319204/149968951-df00b3a0-0463-4a9a-9d48-49925030409e.png) > > Linux: > ![jshell-coloring-linux](https://user-images.githubusercontent.com/51319204/149968969-93c75731-de41-4ac5-b5c0-a1ac2a32ddd8.png) Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: - Cleanup. - Merge branch 'master' into JDK-8274148 - 8274148: can jshell show deprecated classes, methods and fields as strikethrough text? ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7130/files - new: https://git.openjdk.java.net/jdk/pull/7130/files/dd557311..8114073e Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7130&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7130&range=00-01 Stats: 33756 lines in 1221 files changed: 22263 ins; 6448 del; 5045 mod Patch: https://git.openjdk.java.net/jdk/pull/7130.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7130/head:pull/7130 PR: https://git.openjdk.java.net/jdk/pull/7130 From jlahoda at openjdk.java.net Tue Feb 1 15:52:38 2022 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Tue, 1 Feb 2022 15:52:38 GMT Subject: RFR: 8278039: Code completion not woking after some statements such as "if" or "while" Message-ID: Consider these snippets with completion: String s = ""; if (s.c The completion here proposes: char com. which is clearly wrong. The reason is that when the completion searches for the deepest `Tree` at the cursor's position, it finds a tree for the synthetic/error recovery ';' for the then section of the command, rather than a tree in the condition. The proposed patch is to tweak the search for the deepest `Tree`, so that the tree from the if's condition is found. ------------- Commit messages: - 8278039: Code completion not woking after some statements such as "if" or "while" Changes: https://git.openjdk.java.net/jdk/pull/7308/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7308&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8278039 Stats: 17 lines in 2 files changed: 11 ins; 2 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/7308.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7308/head:pull/7308 PR: https://git.openjdk.java.net/jdk/pull/7308 From vromero at openjdk.java.net Tue Feb 1 20:25:11 2022 From: vromero at openjdk.java.net (Vicente Romero) Date: Tue, 1 Feb 2022 20:25:11 GMT Subject: RFR: 8274148: can jshell show deprecated classes, methods and fields as strikethrough text? [v2] In-Reply-To: References: Message-ID: On Tue, 1 Feb 2022 15:34:58 GMT, Jan Lahoda wrote: >> This adds a limited highlighting for JShell. It underlines keywords, highlights declarations and shows deprecated elements inversed (on Windows) or with fainted italic text (on other platforms). >> >> For example, on Windows: >> ![jshell-coloring-other](https://user-images.githubusercontent.com/51319204/149968951-df00b3a0-0463-4a9a-9d48-49925030409e.png) >> >> On other platforms: >> ![screenshot-snippet-nonwin](https://user-images.githubusercontent.com/51319204/152007244-0b95cbda-6c85-4079-b0ee-23f7141e9034.png) > > Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Cleanup. > - Merge branch 'master' into JDK-8274148 > - 8274148: can jshell show deprecated classes, methods and fields as strikethrough text? complex change, looks sensible to me ------------- Marked as reviewed by vromero (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/7130 From duke at openjdk.java.net Wed Feb 9 20:06:11 2022 From: duke at openjdk.java.net (duke) Date: Wed, 9 Feb 2022 20:06:11 GMT Subject: Withdrawn: 8277348: Use String.stripTrailing() in jdk.jshell where applicable In-Reply-To: <9ZTNjFmoBgjdsjNcBVE9J0uAJK2ZeiPKu3fs3joLHbk=.76707c97-8bf0-4868-8cec-bf6b766df0fb@github.com> References: <9ZTNjFmoBgjdsjNcBVE9J0uAJK2ZeiPKu3fs3joLHbk=.76707c97-8bf0-4868-8cec-bf6b766df0fb@github.com> Message-ID: On Fri, 12 Nov 2021 09:10:16 GMT, Andrey Turbanov wrote: > There are 2 methods in jdk.jshell module which trim trailing whitespace characters from String. > 1. jdk.internal.jshell.tool.JShellTool#trimEnd > 2. jdk.jshell.Util#trimEnd > > Since Java 11 we have a method String.stripTrailing which could be used instead. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.java.net/jdk/pull/6365 From jlahoda at openjdk.java.net Mon Feb 28 16:15:21 2022 From: jlahoda at openjdk.java.net (Jan Lahoda) Date: Mon, 28 Feb 2022 16:15:21 GMT Subject: RFR: 8282160: JShell circularly-required classes cannot be defined Message-ID: Consider JShell snippets like: jshell> class B { C c; public void run() { } } jshell> class C extends B { public void run() { } } When the first snippet is processed, it cannot be fully compiled, because `C` is missing. When the second snippet is processed, it is first processed separately, but it will turn out it needs `B` to be defined, and that there are no errors in `C` except resolution errors, and JShell will process both the snippets together, which will pass. If the second snippet is changed to: jshell> class C extends B { @Override public void run() { } } then when processing `C`, there will be error: "method does not override or implement a method from a supertype" (in addition to the "`B` does not exist"). But that error is not considered a resolution error by JShell. The proposal here is to ignore the "does not override" errors and join the `C` and `B` snippet processing. An alternative would be to not produce the error when there are erroneous supertypes, but that turns out to be tricky when the error is not in the direct supertype. So the proposal is to tweak JShell for now. ------------- Commit messages: - 8282160: JShell circularly-required classes cannot be defined Changes: https://git.openjdk.java.net/jdk/pull/7635/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7635&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8282160 Stats: 34 lines in 3 files changed: 28 ins; 0 del; 6 mod Patch: https://git.openjdk.java.net/jdk/pull/7635.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7635/head:pull/7635 PR: https://git.openjdk.java.net/jdk/pull/7635