Skip to content

Commit

Permalink
Merge pull request #351 from oracle/main
Browse files Browse the repository at this point in the history
Merging main into telemetry
  • Loading branch information
Achal1607 authored Dec 16, 2024
2 parents ca6383d + 879f59a commit 52b6a53
Show file tree
Hide file tree
Showing 25 changed files with 1,588 additions and 369 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,20 @@ Project Explorer provides an overview of logical project structure, groups sourc

## Debugger and Launch Configurations
Language Server __Java+ ...__ launch configuration supports debugging and running Java applications using JDK11 or newer.
1. The launch configuration (debugger) is invoked when `Run main | Debug main` code lense is selected in the code.
1. The launch configuration (debugger) is invoked when `Run main | Debug main` codelens is selected in the code.
2. Or __Java+...__ is selected in __Run and Debug__ activity panel.
![Debug configurations](vscode/images/debuggers.png)
### Launch Configurations
* __Launch Java App__ - Debug or Run current Java project
* __Attach to Port__ & __Attach to Process__ - Attach debugger actions. Available when __Java+ ...__ at the bottom of drop down list is selected.
* Select this configuration, then click the ![Run](vscode/images/run.png)
* Select either from available process or enter the port to connect to JVM running with JDWP.
* __Attach to Shared Memory__ is available on Windows in addtion to above mentioned _Attach..._
* __Attach to Shared Memory__ is available on Windows in addition to above mentioned _Attach..._

Default launch configurations provided by Language Server can modified in `launch.json` file.

### Run Configurations panel
Program arguments, VM options, evironment variables,... can be set in Run Configuration panel a part of Explorer. The panel is sufficient for all typical use-cases Java programmer faces. Only advanced, expert scenarios may require touching of `launch.json` (which still takes precedence).
Program arguments, VM options, environment variables,... can be set in Run Configuration panel a part of Explorer. The panel is sufficient for all typical use-cases Java programmer faces. Only advanced, expert scenarios may require touching of `launch.json` (which still takes precedence).
![Run Configuration](vscode/images/run_config.png)

## JDK Downloader
Expand Down Expand Up @@ -166,11 +166,12 @@ When adding JavaDoc to code Oracle Java Platform extension assists by suggesting
Oracle Java Platform extension provides Test Explorer view which allows to run all tests in a project, examine the results, go to source code and run particular test.
![Test Explorer](vscode/images/Test_explorer.png)

### Localisation support
Oracle Java Platform extension provides localisation support for _Japanese_ and _Simplified Chinese_.
To switch language `Go to command Palette->Configure display language` select `ja` for _Japanese_ or `zh-cn` for _Simplified Chinese_
![localisation.gif](vscode/images/localisation.gif)
### Localization support
Oracle Java Platform extension provides localization support for _Japanese_ and _Simplified Chinese_.
To switch language `Go to command Palette->Configure display language` select `ja` for _Japanese_ or `zh-cn` for _Simplified Chinese_


![Localization.gif](vscode/images/Localization.gif)
## Selecting the JDK
The JDK to build, run and debug projects is being searched in the following locations:

Expand Down Expand Up @@ -212,4 +213,4 @@ Please consult the [security guide](https://github.com/oracle/javavscode/blob/ma
Copyright (c) 2024 Oracle and/or its affiliates.

Oracle Java Platform Extension for Visual Studio Code is licensed under [Apache 2.0 License](https://github.com/oracle/javavscode/blob/main/LICENSE.txt).
The [THIRD_PARTY_LICENSES](https://github.com/oracle/javavscode/blob/main/THIRD_PARTY_LICENSES.txt) file contains third party notices and licenses.
The [THIRD_PARTY_LICENSES](./THIRD_PARTY_LICENSES.txt) file contains third party notices and licenses.
104 changes: 44 additions & 60 deletions THIRD_PARTY_LICENSES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8761,12 +8761,14 @@ License Type: MIT
------------------ END OF DEPENDENCY LICENCE --------------------


Dependency: VSCode Language Server - Node
Dependency: vscode-languageclient
=========================================
------------------ START OF DEPENDENCY LICENSE --------------------
- vscode-languageclient

Copyright (c) Microsoft Corporation

License: MIT

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction, including without
Expand All @@ -8783,64 +8785,14 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

----------------------- Dependencies Grouped by License ------------
-------- Dependency
vscode-jsonrpc
-------- Copyrights
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft Corporation. All rights reserved.
Copyrights are respective of each contributor listed at the beginning of each definition file.
-------- Notices
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
For Microsoft vscode-jsonrpc

This project incorporates material from the project(s) listed below (collectively, “Third Party Code”).
Microsoft is not the original author of the Third Party Code. The original copyright notice and license
under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed
to you under their original license terms set forth below. Microsoft reserves all other rights not expressly
granted, whether by implication, estoppel or otherwise.

1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped)

This project is licensed under the MIT license.
Copyrights are respective of each contributor listed at the beginning of each definition file.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

-------- Dependency
vscode-languageclient
-------- Copyrights
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft Corporation. All rights reserved.
Copyrights are respective of each contributor listed at the beginning of each definition file.
Copyright (c) Isaac Z. Schlueter and Contributors
-------- Notices
--------- Notice ---------
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
For Microsoft vscode-languageclient

This project incorporates material from the project(s) listed below (collectively, “Third Party Code”).
Microsoft is not the original author of the Third Party Code. The original copyright notice and license
under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed
to you under their original license terms set forth below. Microsoft reserves all other rights not expressly
granted, whether by implication, estoppel or otherwise.

1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped)
2. semver version 6.3.0 (https://github.com/npm/node-semver)
3. minimatch version 3.0.4 (https://github.com/isaacs/minimatch)
Expand Down Expand Up @@ -8910,6 +8862,45 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF minimatch NOTICES AND INFORMATION

----------------------- Dependencies Grouped by License ------------
-------- Dependency
vscode-jsonrpc
-------- Copyrights
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft Corporation. All rights reserved.
Copyrights are respective of each contributor listed at the beginning of each definition file.
-------- Notices
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
For Microsoft vscode-jsonrpc

This project incorporates material from the project(s) listed below (collectively, “Third Party Code”).
Microsoft is not the original author of the Third Party Code. The original copyright notice and license
under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed
to you under their original license terms set forth below. Microsoft reserves all other rights not expressly
granted, whether by implication, estoppel or otherwise.

1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped)

This project is licensed under the MIT license.
Copyrights are respective of each contributor listed at the beginning of each definition file.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

-------- Dependency
vscode-languageserver-protocol
Expand Down Expand Up @@ -8978,11 +8969,6 @@ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI


----------------------- Dependencies Grouped by License ------------
-------- Dependency
lru-cache
-------- Copyrights
Copyright (c) Isaac Z. Schlueter and Contributors

-------- Dependency
minimatch
-------- Copyrights
Expand All @@ -8995,10 +8981,8 @@ Copyright (c) Isaac Z. Schlueter and Contributors
Copyright Isaac Z. Schlueter

-------- Dependencies Summary
lru-cache
minimatch
semver
yallist

-------- License used by Dependencies
SPDX:ISC
Expand Down
32 changes: 28 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@
patches/7750.diff
patches/7910.diff
patches/7921.diff
patches/7923_draft.diff
patches/7923.diff
patches/7926.diff
patches/8036-draft.diff
patches/8038-draft.diff
patches/mvn-sh.diff
patches/generate-dependencies.diff
patches/rename-debugger.diff
Expand Down Expand Up @@ -246,19 +248,36 @@

<copy file="${basedir}/LICENSE.txt" todir="${basedir}/vscode" />
<copy file="${basedir}/THIRD_PARTY_LICENSES.txt" todir="${basedir}/vscode" />

<copy file="${basedir}/README.md" todir="${basedir}/vscode" />
<replace file="${basedir}/vscode/README.md" value="">
<replacetoken><![CDATA[[![Visual Studio Marketplace](https://img.shields.io/visual-studio-marketplace/v/Oracle.oracle-java?style=for-the-badge&label=VS%20Marketplace&logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=Oracle.oracle-java)
]]></replacetoken>
</replace>
<replace file="${basedir}/vscode/README.md" value="">
<replacetoken><![CDATA[[![Installs](https://img.shields.io/visual-studio-marketplace/i/Oracle.oracle-java?style=for-the-badge)](https://marketplace.visualstudio.com/items?itemName=Oracle.oracle-java)
]]></replacetoken>
</replace>
<replace file="${basedir}/vscode/README.md" value="">
<replacetoken><![CDATA[[![Build Status](https://img.shields.io/github/actions/workflow/status/oracle/javavscode/main.yml?branch=main&style=for-the-badge&logo=github)](https://github.com/oracle/javavscode/actions?query=workflow:Java%20Platform%20Support%20for%20Visual%20Studio%20Code)
]]></replacetoken>
</replace>
<replace file="${basedir}/vscode/README.md" value="">
<replacetoken><![CDATA[[![License](https://img.shields.io/github/license/oracle/javavscode?style=for-the-badge&logo=apache)](https://github.com/oracle/javavscode/blob/main/LICENSE.txt)
]]></replacetoken>
</replace>
<exec executable="${build.dir}/vsce/node_modules/.bin/vsce${cmd.suffix}" failonerror="true" dir="${basedir}/vscode">
<arg value="package" />
<arg line="${vsce.extra.args}" />
<arg value="--baseContentUrl" />
<arg value="https://github.com/oracle/javavscode/blob/${metabuild.hash}/vscode" />
<arg value="https://github.com/oracle/javavscode/blob/${metabuild.hash}/" />
<arg value="--baseImagesUrl" />
<arg value="https://github.com/oracle/javavscode/raw/${metabuild.hash}/vscode" />
<arg value="https://github.com/oracle/javavscode/raw/${metabuild.hash}/" />
<arg value="--out" />
<arg value="${build.dir}/oracle-java-${vsix.version}.vsix" />
</exec>
<delete file="${basedir}/vscode/LICENSE.txt"/>
<delete file="${basedir}/vscode/THIRD_PARTY_LICENSES.txt"/>
<delete file="${basedir}/vscode/README.md"/>
</target>
<target name="test-lsp-server" description="Tests the LSP server behavior">
<ant dir="nbcode" target="test" inheritall="false" inheritrefs="false">
Expand All @@ -269,6 +288,11 @@
</target>

<target name="test-vscode-ext" depends="test-lsp-server" description="Tests the Visual Studio Code extension built by 'build-vscode-ext' target.">
<exec executable="npm${cmd.suffix}" failonerror="true" dir="vscode">
<arg value="--allow-same-version"/>
<arg value="run" />
<arg value="test:unit" />
</exec>
<exec executable="npm${cmd.suffix}" failonerror="true" dir="vscode">
<arg value="--allow-same-version"/>
<arg value="run" />
Expand Down
24 changes: 24 additions & 0 deletions patches/7923.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java
index a72abd44ef..12acbc7081 100644
--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java
+++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java
@@ -420,6 +420,9 @@ public final class MoveRefactoring extends CodeRefactoring {
}

private static Project getSelectedProject(NamedPath selectedProject) {
+ if (selectedProject == null) {
+ return null;
+ }
try {
String path = selectedProject.getPath();
return path != null ? FileOwnerQuery.getOwner(Utils.fromUri(path)) : null;
@@ -429,6 +432,9 @@ public final class MoveRefactoring extends CodeRefactoring {
}

private static FileObject getSelectedRoot(NamedPath selectedRoot) {
+ if (selectedRoot == null) {
+ return null;
+ }
try {
String path = selectedRoot.getPath();
return path != null ? Utils.fromUri(path) : null;
36 changes: 0 additions & 36 deletions patches/7923_draft.diff

This file was deleted.

Loading

0 comments on commit 52b6a53

Please sign in to comment.