Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For Java intellicode suggests a lot of poor choices #1754

Open
rajinder-yadav opened this issue Jan 3, 2021 · 5 comments
Open

For Java intellicode suggests a lot of poor choices #1754

rajinder-yadav opened this issue Jan 3, 2021 · 5 comments

Comments

@rajinder-yadav
Copy link

Issue Type: Bug

In java, when typing code, intellicode should be smart enough to know what context I am in, like coding a class and it should only provide what the most likely keyword I am going to type next.

  1. Create a class person with two private string fields
  2. Type "p", note what is suggested (should be private, public).
  3. After private, type "S", note what is suggested, in fact typing "Str" still does not yield "String" as a top choice.

This is no where close to improving productivity like with intellij, would love to see this fixed.

I'm sure this is also a problem with other languages like TypeScript, JS, GoLang.

After pressing "p"

bug-0

After pressing "S"

bug-1

After pressing "Str"

bug-2

System Info
Item Value
CPUs AMD Ryzen 7 2700X Eight-Core Processor (16 x 3967)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: disabled_off_ok
video_decode: unavailable_off
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 0, 1, 1
Memory (System) 31.29GB (9.76GB free)
Process Argv . --no-sandbox
Screen Reader no
VM 0%
Extensions (54)
Extension Author (truncated) Version
terraform 4op 0.2.1
vscode-base64 ada 0.1.0
vscode-tomcat ada 0.11.3
markdown-toc Ala 1.5.6
Bookmarks ale 11.1.0
ng-template Ang 0.1100.2
vscode-browser-preview auc 0.6.7
npm-intellisense chr 1.3.1
path-intellisense chr 2.3.0
bracket-pair-colorizer Coe 1.0.61
vscode-markdownlint Dav 0.38.0
vscode-eslint dba 2.1.8
java-decompiler dgi 0.0.2
EditorConfig Edi 0.15.1
prettier-vscode esb 5.5.0
markdown-preview-bitbucket hbr 1.0.0
java-properties ith 0.0.2
vscode-peacock joh 3.8.0
solidity Jua 0.0.76
sort-typescript-imports mic 1.4.1
vscode-docker ms- 1.1.0
python ms- 2020.5.86806
cpptools ms- 0.28.3
vscode-typescript-tslint-plugin ms- 1.3.2
debugger-for-chrome msj 4.12.8
angular2-inline nat 0.0.17
vetur oct 0.24.0
vscode-boot-dev-pack Piv 0.0.8
vscode-concourse Piv 1.24.0
vscode-manifest-yaml Piv 1.24.0
vscode-spring-boot Piv 1.24.0
platformio-ide pla 1.10.0
java-ide-pack pve 1.2.1
java red 0.59.1
vscode-yaml red 0.13.0
markdown-preview-enhanced shd 0.5.15
vscode-checkstyle she 1.3.3
java-generate-setters-getters soh 5.3.0
sonarlint-vscode Son 1.19.0
language-stylus sys 1.11.0
find-then-jump tra 2.0.4
sort-lines Tyr 1.9.0
vscodeintellicode Vis 1.2.10
vscode-java-debug vsc 0.27.1
vscode-java-dependency vsc 0.9.0
vscode-java-pack vsc 0.12.1
vscode-java-test vsc 0.22.3
vscode-maven vsc 0.27.0
vscode-spring-boot-dashboard vsc 0.1.10
vscode-spring-initializr vsc 0.6.1
better-align wwm 1.1.6
vscode-java-saber You 0.1.1
markdown-pdf yza 1.4.4
vscode-aspell zap 0.1.4

(8 theme extensions excluded)

@testforstephen
Copy link
Collaborator

@Eskibear Could you take a look whether this can be achieved by IntelliCode extension?

@Eskibear
Copy link
Contributor

Eskibear commented Jan 4, 2021

No, it's not related to IntelliCode. The behavior is the same when IntelliCode is not installed.

  • p[cursor] : classes staring with "p" are listed, because it's allowed that you don't have a public/private modifier before a member varible.
  • Str[cursor]: "String" is not on top of the list, because it's in alphabetical order.

@testforstephen
Copy link
Collaborator

I don't mean that this is a bug in IntelliCode, I mean whether IntelliCode could optimize the recommendation order for these completion choices.

@Eskibear
Copy link
Contributor

Eskibear commented Jan 4, 2021

Theoretically that can be done by machine learninig approaches or hardcoded rules. But no, currently IntelliCode only re-ranks methods of a certain type. Modifiers, types, keywords are not included.

@0dinD
Copy link
Contributor

0dinD commented Jan 5, 2021

My take on the issue in the first screenshot is that it's a non-issue if you follow the widely accepted convention of using UpperCamelCase for class names. If the class were to be named Person, the access modifiers are the top results, and you have to type a capital P in order to be suggested the Person class over the access modifiers.

But I do agree that it would be nice if the IntelliCode extension could rank types based on their usage. So if anything I think you should focus on ranking types, not modifiers and keywords @Eskibear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants