Giter Site home page Giter Site logo

jiangdequan / vscode-java-saber Goto Github PK

View Code? Open in Web Editor NEW
30.0 5.0 10.0 2.21 MB

:crossed_swords: To make the vscode work as Eclipse or IDEA when you are coding in java.

Home Page: https://marketplace.visualstudio.com/items?itemName=YouMayCallMeV.vscode-java-saber

JavaScript 100.00%
vscode-extension vscode-plugin vscode-java getters setters

vscode-java-saber's Introduction

Java IDE: Saber logo

Saber for VS Code [中文]

Marketplace Version Visual Studio Marketplace Platform Language License

This extension includes many useful utilities for Java. To make the vscode work as Eclipse or IDEA when you are coding in java.
These functions are implemented by parsing strings in java files. Therefore, your codes should best meet the specification of java.
If you have some good ideas, you can submit a feature suggestion here.

Overview

It makes users coding in java more efficient. Here`s a list of features:

  • New: Java files(annotation/class/interface/enum/package/JSP/HTML)
  • Generate Getters and Getters
  • Copy Qualified Name
  • Sort Project By Name
  • Run Maven Goals
  • Generate Docs

Some features ready to do:

  • Rename Java File

Requirements

  • JDK (version 1.8.0 or later)
  • VS Code (version 1.19.0 or later)

Install

  • Install from the Marketplace, you can find it by typing: "vscode-java-saber" "Java IDE"

How To Use

New

  • Method 1: Right click on a java file or a directory in the explorer Alt text Alt text

  • Method 2: You must open a java file in text editor => ctrl + shift + p => type: java new Alt text It will create a java file in the same directory of the opened file.

Generate Getters and Setters

Known issue: When the inner class is defined in the class, there will be problems with generating getters and setters

  • Method 1: Right click on the opened java file in the editor Alt text

  • Method 2: You must open a java file in text editor => ctrl + shift + p => type: getter setter Alt text

  • Method 3: Use keyboard shortcut 'alt + insert'

Copy Qualified Name

  • Method 1: Right click on the opened java file in the explorer Alt text

  • Method 2: You must open a java file in text editor => ctrl + shift + p => type: copy qualified name Alt text

  • Method 3: Right click on the opened java file in the editor Alt text

Sort Project By Name

Edit the config "ide.projectAutoSort" to true, it will auto sort projects by name when adding a project to the workspace, default is false

  • Method 1: Right click on the project explorer Alt text

  • Method 2: ctrl + shift + p => type: Sort Project By Name Alt text

Run Maven Goals

Edit the config "ide.mavenDefaultGoals" to what you like, default is "clean install -Dmaven.test.skip=true" and "clean install"

  • Method 1: Right click on a pom.xml file Alt text Alt text

Generate Docs

  • Method 1:
  1. Select the codes you want to generate java docs as below Alt text Alt text

  2. Then right click on the opened java file in the editor or use keyboard shortcut 'alt + i' Alt text

Feedback and Questions

You can find the full list of issues at Issue Tracker. You can submit a bug or feature suggestion.

License

Dual-licensed under BSD 2-Clause License and GPLv2 with the Classpath Exception.

This extention is included into "Java IDE Pack" extention pack.

vscode-java-saber's People

Contributors

jiangdequan avatar qxo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vscode-java-saber's Issues

Suggestion:

image
Compact package to most visible, example Inteliji
image

Can't create java new package in command palette

WechatIMG1
I just install 'Java IDE' in my vscode. I want to create a package in my directory. In command palette, I type 'java new', there is no option 'java new package' asn shown above. Please help me. Thank U.

Extension issue

  • Issue Type: Bug
  • Extension Name: vscode-java-saber
  • Extension Version: 0.1.2
  • OS Version: Linux ia32 5.18.0-kali5-686-pae
  • VSCode version: 1.32.3

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

Création de templates

Bonjour.
Je trouve votre extension très bien mais elle n'est pas complète alors je ne la connais pas bien. J'aimerai personnaliser les classes dans la création de classe. Avoir des nouvelles classes que je peux personnaliser à volonté.
Cordialement

new classes package is always io.github.jiangdequan

Hi!
When I generate a class via this extension the package is always pointing to io.github.jiangdequan. Even if I generate a package first and then a class inside it. Is this intentional? Am I missing something?

JavaFX property getter setter

For the template, when using JavaFX properties (i.e. StringProperty), could you generate the proper getter setters? (setMyString(), getMyString(), myStringProperty()). This would provide the functionality that IntelliJ has out of the box.

Trying to Generate Javadocs throws error message

Hi, when I try to use generate Javadocs , it doesn't work and always throw this error even if all my code is selected and there are many opportunities to add @return and @params
This is the error code :
{"code":"0102","msg":"Failed to invoke [generate docs], no codes were selected to generate docs!","msg_zh":"生成Java文档失败: 没有选中需要生成Java文档的代码!"}

Did someone encounter this problem ?

Extension issue

  • Issue Type: Bug
  • Extension Name: vscode-java-saber
  • Extension Version: 0.1.2
  • OS Version: Linux ia32 5.18.0-kali5-686-pae
  • VSCode version: 1.32.3

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

Failed to create a new file, cannot get the effective active text editor or selected file!

Can't create any kind of java files (class, enum, interface etc.). Every time when I try I receive the message in right down corner of VSC "Failed to create a new file, cannot get the effective active text editor or selected file!".

Version: 1.28.1
Commit: 3368db6750222d319c851f6d90eb619d886e08f5
Date: 2018-10-11T18:09:20.566Z
Electron: 2.0.9
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

Elementary OS 0.4.1 Loki
4.15.0-36-generic #39~16.04.1-Ubuntu

Extension issue

  • Issue Type: Bug
  • Extension Name: vscode-java-saber
  • Extension Version: 0.1.2
  • OS Version: Windows_NT x64 10.0.19043
  • VS Code version: 1.62.0

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

Option For Getter and Setter

Give Options for Getter and Setter, like for which attribute and variable it should generate.

Like below happens in IntelliJ

image

Extension issue

  • Issue Type: Bug
  • Extension Name: vscode-java-saber
  • Extension Version: 0.1.1
  • OS Version: Windows_NT x64 6.3.9600
  • VSCode version: 1.41.1

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

Extension issue

  • Issue Type: Bug
  • Extension Name: vscode-java-saber
  • Extension Version: 0.1.0
  • OS Version: Windows_NT x64 6.1.7601
  • VSCode version: 1.38.1

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

extension host terminated

Type: Bug

extension bisect

Extension version: 0.1.2
VS Code version: Code 1.83.1 (f1b07bd25dfad64b0167beb15359ae573aecd2cc, 2023-10-10T23:48:05.904Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz (12 x 2592)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 7.84GB (0.54GB free)
Process Argv --crash-reporter-id f4e54654-a129-4c6b-961b-caf19c1684e5
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30899288
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
282f8724:30602487
f6dab269:30613381
2i9eh265:30646982
showlangstatbar:30737416
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
welcomedialog:30910333
pythonnosmt12:30797651
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
dsvsc013:30795093
dsvsc014:30804076
dsvsc015:30845448
pythontestfixt:30902429
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:30885898
pythontbext0:30879054
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
aa_t_chat:30882232
dsvsc019:30917259

Extension issue

  • Issue Type: Bug
  • Extension Name: vscode-java-saber
  • Extension Version: 0.1.2
  • OS Version: Windows_NT x64 10.0.19042
  • VS Code version: 1.56.2

Copy qualified name` doesn't work correctly

Hi,

when using the Copy qualified name command I always end up having io.github.jiangdequan in my clipboard, regardless of where my cursor in a java class is.

It seems that this is used as a default value in case something goes wrong. In that case it would be better to just show a notification.

Extension issue

  • Issue Type: Bug
  • Extension Name: vscode-java-saber
  • Extension Version: 0.1.0
  • OS Version: Windows_NT x64 6.2.9200
  • VSCode version: 1.38.1

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

Package Name and File Structure

eclipse

  • When creating a new project, would you make the file structure like "src> package> Main.java or App.java"?
  • When creating a new class, would you write the name of the created package instead of "io.github.jiangdequan"?
  • Can we choose the default "workspace" folder?

I do not know how to code and cannot do these operations. If you do these I would be very happy. Thank you so much.

Getter and setter generation : wildcard in generics not supported

This issue relates to the same question, but it never ended.

I just generated getter and setter (and by the way, constructor all the stuff) using the 'Java: Generate All "Quick"' option. But the wildcard in generics field isn't supported.

For example, a field like this :

private Class<? extends MyClass> clazz;

Currently result in something like this :

public Constructor(Class<?extendsMyClass> clazz){
}

The spaces should be conserved, first to avoid compile time errors, but second, to be more readable. (but formatters will do)

But otherwise, great extension ! 👍🏼

Running in debug mode fails if Java app not already compiled

Issue Type: Bug

When running a Spring Boot Java app, if the application is not first compiled, then running in debug mode will fail with an error, "Could not find or load main class ..."

You can run maven clean first, then try to run in debug mode to see this failure. This happens with a Spring Boot app, but may also happen with a plain Java app (have't checked).

IDE should be smart enough to compile the app before starting debug mode.

Debug run error output

cd /home/yadav/dev/java/spring-boot/jpa-pg-student-demo2 ; /usr/bin/env /home/yadav/.sdkman/candidates/java/11.0.11.j9-adpt/bin/java -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:42191 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=33847 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dspring.application.admin.enabled=true -Dspring.jmx.enabled=true -Dfile.encoding=UTF-8 @/tmp/cp_bl46fnr8tea12tujxkvyje5rm.argfile com.example.jpastudentdemo.JpaStudentDemoApplication 
Error: Could not find or load main class com.example.jpastudentdemo.JpaStudentDemoApplication
Caused by: java.lang.ClassNotFoundException: com.example.jpastudentdemo.JpaStudentDemoApplication

Extension version: 0.1.2
VS Code version: Code - Insiders 1.57.0-insider (82767cc1d7bf8cdea0f2897276d5d15aee91f3d9, 2021-05-17T05:13:35.197Z)
OS version: Linux x64 5.12.9-1-default

System Info
Item Value
CPUs AMD Ryzen 7 2700X Eight-Core Processor (16 x 3887)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 1, 1, 1
Memory (System) 31.29GB (2.08GB free)
Process Argv . --crash-reporter-id 7994aa03-2cc6-40be-91f0-a86a9abf4373
Screen Reader no
VM 0%
DESKTOP_SESSION /usr/share/xsessions/default
XDG_CURRENT_DESKTOP KDE
XDG_SESSION_DESKTOP KDE
XDG_SESSION_TYPE x11
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
pythonvspyt602:30291494
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30291487
pythontb:30258533
vsc_aacf:30263846
vspre833:30267464
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
vscus158cf:30286554
pythonvsuse255:30319630
vscgsv2:30305091
vscorehov:30301224
vscod805cf:30301675
vscextlang:30310088
vsccppwtct:30312693

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.