You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by jl...@apache.org on 2023/11/15 13:03:25 UTC
(netbeans) branch master updated: fix for outline tab not loading in case pacakge-info.java file is present in the workspace in vscode
This is an automated email from the ASF dual-hosted git repository.
jlahoda pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 9819bc8852 fix for outline tab not loading in case pacakge-info.java file is present in the workspace in vscode
new 3647f61d97 Merge pull request #6642 from Achal1607/javavscode-23
9819bc8852 is described below
commit 9819bc8852363b7477d6d6c2f93662267adfef91
Author: Achal Talati <ac...@oracle.com>
AuthorDate: Tue Nov 7 02:23:08 2023 +0530
fix for outline tab not loading in case pacakge-info.java file is present in the workspace in vscode
Signed-off-by: Achal Talati <ac...@oracle.com>
---
.../netbeans/modules/editor/java/JavaStructureProvider.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/java/java.editor/src/org/netbeans/modules/editor/java/JavaStructureProvider.java b/java/java.editor/src/org/netbeans/modules/editor/java/JavaStructureProvider.java
index 61d08c6671..be87f4b2b8 100644
--- a/java/java.editor/src/org/netbeans/modules/editor/java/JavaStructureProvider.java
+++ b/java/java.editor/src/org/netbeans/modules/editor/java/JavaStructureProvider.java
@@ -65,10 +65,13 @@ public class JavaStructureProvider implements StructureProvider {
TreePath tp = trees.getPath(cu, cu.getPackage());
Element el = trees.getElement(tp);
if (el != null && el.getKind() == ElementKind.PACKAGE) {
- StructureElement jse = element2StructureElement(cc, el);
- if (jse != null) {
- result.add(jse);
- }
+ Builder builder = StructureProvider.newBuilder(el.getSimpleName().toString(), ElementHeaders.javaKind2Structure(el));
+ int start = (int) cc.getTrees().getSourcePositions().getStartPosition(cu, cu.getPackage());
+ int end = (int) cc.getTrees().getSourcePositions().getEndPosition(cu, cu.getPackage());
+
+ builder.expandedStartOffset(start).selectionStartOffset(start);
+ builder.expandedEndOffset(end).selectionEndOffset(end);
+ result.add(builder.build());
}
}
for (Element tel : cc.getTopLevelElements()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists