Skip to content

Commit 09213d7

Browse files
committed
Fix Symbol/Type provider issues
Cleanup
1 parent 1674de1 commit 09213d7

7 files changed

Lines changed: 17 additions & 1113 deletions

File tree

.github/workflows/maven.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,13 @@ jobs:
5757
echo "RELEASE_MONTH=$(date +%m)" >> $GITHUB_ENV
5858
echo "RELEASE_YEAR=$(date +%y)" >> $GITHUB_ENV
5959
60-
- name: Get Previous Version
61-
run: |
62-
echo "PREVIOUS_VERSION=$(mvn help:evaluate -Dproject.version=next.version -Dexpression=previous.version -q -DforceStdout)" >> $GITHUB_ENV
63-
6460
- name: Set Spec Version
6561
run: |
6662
sed -i "s/OpenIDE-Module-Specification-Version:.*/OpenIDE-Module-Specification-Version: ${{ env.RELEASE_VERSION }}/" src/main/nbm/manifest.mf
6763
6864
- name: Build with RELEASE130
6965
run: |
70-
mvn -B clean deploy -Dnetbeans.release.version=RELEASE130 -Dnext.version=RELEASE130-${{ env.RELEASE_VERSION }} -DuntaggedName=${{ env.RELEASE_VERSION }} -DfromRef=${{ env.PREVIOUS_VERSION }} -DgitHubToken=${{ env.GITHUB_TOKEN }}
66+
mvn -B clean deploy -Dnetbeans.release.version=RELEASE130 -Dnext.version=RELEASE130-${{ env.RELEASE_VERSION }}
7167
echo "SIZE_13=$(wc -c target/nbm/python-RELEASE130-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
7268
env:
7369
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
@@ -83,8 +79,6 @@ jobs:
8379
prerelease: false
8480
release_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}
8581
tag_name: ${{ env.RELEASE_VERSION }}
86-
#TODO
87-
#body_path: CHANGELOG.md
8882
env:
8983
GITHUB_TOKEN: ${{ github.token }}
9084

CHANGELOG.md

Lines changed: 0 additions & 1059 deletions
This file was deleted.

pom.xml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -153,22 +153,6 @@
153153
</execution>
154154
</executions>
155155
</plugin>
156-
<plugin>
157-
<groupId>se.bjurr.gitchangelog</groupId>
158-
<artifactId>git-changelog-maven-plugin</artifactId>
159-
<version>1.100.6</version>
160-
<executions>
161-
<execution>
162-
<phase>prepare-package</phase>
163-
<goals>
164-
<goal>git-changelog</goal>
165-
</goals>
166-
<configuration>
167-
<templateFile>src/main/resources/org/netbeans/modules/python/changelog.mustache</templateFile>
168-
</configuration>
169-
</execution>
170-
</executions>
171-
</plugin>
172156
<plugin>
173157
<groupId>org.owasp</groupId>
174158
<artifactId>dependency-check-maven</artifactId>
@@ -813,7 +797,6 @@
813797
<keystore>target/keystore</keystore>
814798
<netbeans.release.version>RELEASE190</netbeans.release.version>
815799
<next.version>1.5</next.version>
816-
<previous.version>1.4</previous.version>
817800
<git.url>https://github.com/albilu/netbeansPython</git.url>
818801
<git.link>https://github.com/albilu/netbeansPython.git</git.link>
819802
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

src/main/java/org/netbeans/modules/python/indexing/PythonCustomIndexer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ protected void index(Iterable<? extends Indexable> files, Context context) {
5353
Project owner = root != null ? FileOwnerQuery.getOwner(root) : null;
5454
boolean pyProject = owner != null && owner.getClass()
5555
.getName().equals("org.netbeans.modules.python.project.PythonProject");
56-
boolean pyLibPath = root != null && root.getParent() != null
57-
&& root.getParent().getName().equals("lib");
56+
boolean pyLibPath = root != null && (root.getName().endsWith("Lib") || (root.getParent() != null
57+
&& root.getParent().getName().equals("lib")));
5858
if (pyProject || pyLibPath) {
5959
try {
6060
IndexingSupport is = IndexingSupport.getInstance(context);
@@ -87,7 +87,8 @@ protected void index(Iterable<? extends Indexable> files, Context context) {
8787
}
8888
long endTime = System.currentTimeMillis();
8989
if (LOG.isLoggable(Level.INFO)) {
90-
LOG.log(Level.INFO, "Processed {0} files in {1}ms.", new Object[]{cnt, endTime - startTime});
90+
LOG.log(Level.INFO, "Processed {0} files for {1} in {2}ms.", new Object[]{
91+
cnt, cnt > 0 ? root.getPath() : "null", endTime - startTime});
9192
}
9293
}
9394

src/main/java/org/netbeans/modules/python/source/PythonSymbolProvider.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
import org.netbeans.api.project.ui.OpenProjects;
1717
import org.netbeans.modules.csl.spi.GsfUtilities;
1818
import org.netbeans.modules.parsing.spi.indexing.support.IndexResult;
19-
import org.netbeans.modules.python.project.PythonProject;
2019
import org.netbeans.modules.python.PythonUtility;
2120
import org.netbeans.modules.python.indexing.PythonCustomIndexer;
2221
import org.netbeans.modules.python.indexing.PythonIndexQuery;
22+
import org.netbeans.modules.python.project.PythonProject;
2323
import org.netbeans.spi.jumpto.symbol.SymbolDescriptor;
2424
import org.netbeans.spi.jumpto.symbol.SymbolProvider;
2525
import org.netbeans.spi.jumpto.type.SearchType;
@@ -93,14 +93,18 @@ public void computeSymbolNames(Context cntxt, Result result) {
9393
// }
9494
}
9595

96-
private void computeSymbols(URL toURL, Project openProject, SearchType kind, String text, List<PythonSymbolDescriptor> typeDescriptors) {
96+
private void computeSymbols(URL toURL, Project openProject, SearchType kind, String text, List<PythonSymbolDescriptor> symbolDescriptors) {
9797
Collection<? extends IndexResult> types = PythonIndexQuery
9898
.searchIndex(toURL, PythonCustomIndexer.SYMBOLS_FIELD, kind,
9999
text);
100100
for (IndexResult type : types) {
101+
FileObject fo = type.getFile();
102+
if (fo == null) {
103+
continue;
104+
}
101105
for (Object value : type.getValues(PythonCustomIndexer.SYMBOLS_FIELD)) {
102106
String[] split = value.toString().split("#");
103-
typeDescriptors.add(new PythonSymbolDescriptor(split[0], openProject,
107+
symbolDescriptors.add(new PythonSymbolDescriptor(split[0], openProject,
104108
type.getFile(), NumberUtils.createInteger(split[1]), split[2]));
105109

106110
}

src/main/java/org/netbeans/modules/python/source/PythonTypeProvider.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
import org.netbeans.api.project.ui.OpenProjects;
1717
import org.netbeans.modules.csl.spi.GsfUtilities;
1818
import org.netbeans.modules.parsing.spi.indexing.support.IndexResult;
19-
import org.netbeans.modules.python.project.PythonProject;
2019
import org.netbeans.modules.python.PythonUtility;
2120
import org.netbeans.modules.python.indexing.PythonCustomIndexer;
2221
import org.netbeans.modules.python.indexing.PythonIndexQuery;
22+
import org.netbeans.modules.python.project.PythonProject;
2323
import org.netbeans.spi.jumpto.type.SearchType;
2424
import org.netbeans.spi.jumpto.type.TypeDescriptor;
2525
import org.netbeans.spi.jumpto.type.TypeProvider;
@@ -104,6 +104,10 @@ private void computeTypes(URL toURL, Project openProject, SearchType kind, Strin
104104
.searchIndex(toURL, PythonCustomIndexer.TYPE_FIELD, kind,
105105
text);
106106
for (IndexResult type : types) {
107+
FileObject fo = type.getFile();
108+
if (fo == null) {
109+
continue;
110+
}
107111
for (Object value : type.getValues(PythonCustomIndexer.TYPE_FIELD)) {
108112
String[] split = value.toString().split("#");
109113
typeDescriptors.add(new PythonTypeDescriptor(split[0], openProject,

src/main/resources/org/netbeans/modules/python/changelog.mustache

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)