Skip to content

Commit 8863d6f

Browse files
authored
Merge pull request #399 from sid-srini/telemetry
Merge main into telemetry
2 parents a63ef81 + 2639aa8 commit 8863d6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3338
-7017
lines changed

BUILD.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ This configuration will enable you to debug both the extension’s TypeScript co
121121
```json
122122
"jdk.serverVmOptions": ["-J-Dnetbeans.logger.console=true"]
123123
```
124+
4. For further debugging you can set Log Level to FINEST by appending following argument to the array:
125+
```json
126+
"jdk.serverVmOptions": ["-J-Dnetbeans.logger.console=true", "-J-Dorg.netbeans.modules.java.lsp.server.lsptrace.level=FINEST"]
127+
```
124128

125129
Both options will enable logging from the NetBeans server in the VS Code Output Channel.
126130

THIRD_PARTY_LICENSES.txt

Lines changed: 366 additions & 439 deletions
Large diffs are not rendered by default.

build.xml

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,25 @@
4545
<loadresource property="patch-files">
4646
<string>
4747
patches/6330.diff
48-
patches/7491.diff
4948
patches/7610.diff
50-
patches/7641.diff
51-
patches/7654.diff
52-
patches/7670.diff
53-
patches/7699.diff
54-
patches/7709.diff
55-
patches/7722.diff
56-
patches/7724.diff
57-
patches/7733.diff
58-
patches/7750.diff
59-
patches/7910.diff
60-
patches/7921.diff
61-
patches/7923.diff
62-
patches/7926.diff
6349
patches/8036-draft.diff
6450
patches/8038-draft.diff
51+
patches/8210.diff
52+
patches/8237.diff
53+
patches/8242.diff
54+
patches/8245.diff
55+
patches/8255.diff
56+
patches/8260.diff
57+
patches/8280.diff
58+
patches/8289.diff
59+
patches/disable-error-notification.diff
6560
patches/mvn-sh.diff
6661
patches/project-marker-jdk.diff
6762
patches/generate-dependencies.diff
6863
patches/rename-debugger.diff
6964
patches/remove-db.diff
7065
patches/nbjavac-not-required.diff
7166
patches/l10n-licence.diff
72-
patches/no-security-manager-allow.diff
7367
patches/dev-dependency-licenses.diff
7468
patches/nb-telemetry.diff
7569
</string>
@@ -209,8 +203,38 @@
209203
</ant>
210204
</target>
211205

212-
213-
206+
<target name="setup-vsce">
207+
<mkdir dir="${build.dir}/vsce" />
208+
<exec executable="npm${cmd.suffix}" failonerror="true" dir="${build.dir}/vsce">
209+
<arg value="install" />
210+
<arg value="--save" />
211+
<arg value="@vscode/vsce@2.19.0" />
212+
</exec>
213+
<antcall target="apply-vsce-patch" inheritAll="true" />
214+
</target>
215+
<target name="check-vsce-patch-status">
216+
<exec executable="patch" dir="${build.dir}/vsce/node_modules/@vscode/vsce/out" failifexecutionfails="false" failonerror="false" resultproperty="vsce-patch-status">
217+
<arg value="-p1"/>
218+
<arg value="--dry-run"/>
219+
<arg value="--force"/>
220+
<arg value="-z"/>
221+
<arg value=".orig"/>
222+
<arg value="-i"/>
223+
<arg value="${basedir}/patches/vsce-package-ContentTypes.diff"/>
224+
</exec>
225+
<condition property="vsce.patch.toBeApplied" value="true" >
226+
<equals arg1="${vsce-patch-status}" arg2="0" />
227+
</condition>
228+
</target>
229+
<target name="apply-vsce-patch" if="vsce.patch.toBeApplied" depends="check-vsce-patch-status">
230+
<exec executable="patch" dir="${build.dir}/vsce/node_modules/@vscode/vsce/out" failifexecutionfails="false" failonerror="false" resultproperty="vsce-patch-status">
231+
<arg value="-p1"/>
232+
<arg value="-z"/>
233+
<arg value=".orig"/>
234+
<arg value="-i"/>
235+
<arg value="${basedir}/patches/vsce-package-ContentTypes.diff"/>
236+
</exec>
237+
</target>
214238

215239
<target name="build-vscode-ext" depends="add-extra-modules" description="Build the Visual Studio Code extension.">
216240
<taskdef name="gitbranchhash" classname="org.netbeans.nbbuild.GitBranchHash" classpath="${nbantext.jar}" />
@@ -249,21 +273,7 @@
249273
<arg value="-Dexec.args=${build.dir}/bundles ${nb_all}" />
250274
</exec>
251275

252-
<mkdir dir="${build.dir}/vsce" />
253-
<exec executable="npm${cmd.suffix}" failonerror="true" dir="${build.dir}/vsce">
254-
<arg value="install" />
255-
<arg value="--save" />
256-
<arg value="@vscode/vsce@2.19.0" />
257-
</exec>
258-
259-
<exec executable="patch" dir="${build.dir}/vsce/node_modules/@vscode/vsce/out" failifexecutionfails="false" failonerror="false">
260-
<arg value="-p1"/>
261-
<arg value="-z"/>
262-
<arg value=".orig"/>
263-
<arg value="-i"/>
264-
<arg value="${basedir}/patches/vsce-package-ContentTypes.diff"/>
265-
</exec>
266-
276+
<antcall target="setup-vsce" inheritAll="true" />
267277
<move todir="${basedir}/vscode/node_modules" includeemptydirs="false">
268278
<fileset dir="${basedir}/vscode/node_modules">
269279
<include name="**/LICENSE"/>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.netbeans.modules.nbcode.integration;
20+
21+
import org.netbeans.modules.java.lsp.server.ui.AbstractApplyEditsImplementation;
22+
import org.netbeans.spi.lsp.ApplyEditsImplementation;
23+
import org.openide.util.lookup.ServiceProvider;
24+
25+
/**
26+
*
27+
* @author sdedic
28+
*/
29+
@ServiceProvider(service = ApplyEditsImplementation.class, position = 10000)
30+
public class LspApplyEditsImplementation extends AbstractApplyEditsImplementation{
31+
32+
}

nbcode/nbproject/platform.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ disabled.modules=\
394394
org.netbeans.modules.j2ee.sun.dd,\
395395
org.netbeans.modules.j2ee.sun.ddui,\
396396
org.netbeans.modules.jakarta.transformer,\
397-
org.netbeans.modules.jakarta.web.beans,\
398397
org.netbeans.modules.jakartaee8.api,\
399398
org.netbeans.modules.jakartaee8.platform,\
400399
org.netbeans.modules.javaee7.api,\

netbeans

Submodule netbeans updated 5298 files

patches/6330.diff

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ConnectionSpec.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ConnectionSpec.java
2-
index 9ab389564c..9b7c044c81 100644
2+
index bb8a4e8183..b9662fe6cd 100644
33
--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ConnectionSpec.java
44
+++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/ConnectionSpec.java
55
@@ -25,7 +25,7 @@ import java.io.OutputStream;
@@ -86,11 +86,10 @@ index 9ab389564c..9b7c044c81 100644
8686
} catch (IOException ex) {
8787
if (isClosed(server)) {
8888
break;
89-
@@ -129,26 +152,54 @@ final class ConnectionSpec implements Closeable {
90-
}
89+
@@ -130,25 +153,53 @@ final class ConnectionSpec implements Closeable {
9190
};
9291
listeningThread.start();
93-
- out.write((prefix + " listening at port " + localPort).getBytes());
92+
out.write((prefix + " listening at port " + localPort + "\n").getBytes());
9493
+ StringBuilder message = new StringBuilder();
9594
+ message.append(prefix).append(" listening at port ").append(localPort);
9695
+ if (hash) {
@@ -128,7 +127,6 @@ index 9ab389564c..9b7c044c81 100644
128127
+ if (hashContent != null) {
129128
+ for (char c : hashContent) {
130129
+ byte b = (byte) in.read();
131-
+
132130
+ if (b != c) {
133131
+ IOException toThrow = new IOException("Hash validation failed!");
134132
+ try {
@@ -146,15 +144,21 @@ index 9ab389564c..9b7c044c81 100644
146144
connectionObject.getRunningFuture().get();
147145
} catch (IOException | InterruptedException | ExecutionException ex) {
148146
diff --git a/java/java.lsp.server/test/unit/src/org/netbeans/modules/java/lsp/server/ConnectionSpecTest.java b/java/java.lsp.server/test/unit/src/org/netbeans/modules/java/lsp/server/ConnectionSpecTest.java
149-
index 1035cf9bc8..55c0488d03 100644
147+
index f538c953f6..728228c63c 100644
150148
--- a/java/java.lsp.server/test/unit/src/org/netbeans/modules/java/lsp/server/ConnectionSpecTest.java
151149
+++ b/java/java.lsp.server/test/unit/src/org/netbeans/modules/java/lsp/server/ConnectionSpecTest.java
152-
@@ -118,7 +118,7 @@ public class ConnectionSpecTest {
150+
@@ -118,10 +118,12 @@ public class ConnectionSpecTest {
153151
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
154152
ByteArrayOutputStream os = new ByteArrayOutputStream();
155153
conn.prepare("Pipe server", in, os, new LspSession(), ConnectionSpecTest::setCopy, ConnectionSpecTest::copy);
156154
- String reply = os.toString("UTF-8");
157155
+ String reply = os.toString("UTF-8").replaceAll("\n$", "");
158156
String exp = "Pipe server listening at port ";
159157
assertTrue(reply, reply.startsWith(exp));
160-
int port = Integer.parseInt(reply.substring(exp.length()));
158+
- int port = Integer.parseInt(reply.substring(exp.length(), reply.indexOf('\n', exp.length())));
159+
+ int nextLineIdx = reply.indexOf('\n', exp.length());
160+
+ if (nextLineIdx < 0) nextLineIdx = reply.length();
161+
+ int port = Integer.parseInt(reply.substring(exp.length(), nextLineIdx));
162+
assertTrue("port is specified: " + port, port >= 1024);
163+
try (ConnectionSpec second = ConnectionSpec.parse("connect:" + port)) {
164+
second.prepare("Pipe client", in, os, new LspSession(), ConnectionSpecTest::setCopy, ConnectionSpecTest::copy);

0 commit comments

Comments
 (0)