redhat-developer / redhat-developer/vscode-java
Package containing dot character not being parsed correctly
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 2.3k
- Fork
- 546
- Merge medio
- 20h 1m
- PR unite (30g)
- 11
Descrizione
Issue Type: Bug
In the src folder of a Java Gradle project, there's the package structure:
projectRoot/
└── src/
├── main/
│ ├── java/
│ │ └── javasnap.domain/
│ │ └── cli/
│ │ └── ClStringArgs.java
└── test/
├── java/
│ └── javasnap.domain/
│ └── cli/
│ └── ClStringArgsTest.java
The ClStringArgs.java and ClStringArgsTest.java file contains the package declaration:
package javasnap.domain.cli;
Which is resulting in the package delcaration being highlighted as an error by VScode in both the test and production source file:
The declared package "javasnap.domain.cli" does not match the expected package "" Java(536871240)
It's also highlighting any reference to the class ClStringArgs in both the production and test source code with the following error:
ClStringArgs cannot be resolved to a type Java(16777218)
Splitting the directory name containing the dot character into two separate directories with one nested within the other causes this error to go away.
This package naming is valid for Gradle (and Java) to be able to compile and run source code. Attempting to add a directory to the Java Source Path via VScode results in the following message:
Unsupported operation. Please use build.gradle file to manage the source directories of gradle project.
Source: Language Support for Java(TM) by Red Hat (Extension)
This source directory structure is the default structuring of Gradle builds and this package naming convention is valid and used by multiple Java libraries. Can this bug get fixed or the feature of being able to resolve package names containing the dot character correctly be added to the roadmap?
Extension version: 0.60.0
VS Code version: Code 1.44.2 (ff915844119ce9485abfe8aa9076ec76b5300ddd, 2020-04-16T17:07:18.473Z)
OS version: Darwin x64 18.7.0
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz (8 x 2700) |
| GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled viz_display_compositor: enabled_on viz_hit_test_surface_layer: disabled_off_ok webgl: enabled webgl2: enabled |
| Load (avg) | 3, 3, 3 |
| Memory (System) | 16.00GB |
| Process Argv | . |
| Screen Reader | no |
| VM | 0% |
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci l'errore con la struttura Gradle mostrata, inclusi la directory javasnap.domain con i punti, ClStringArgs.java, ClStringArgsTest.java e build.gradle. Inizia tracciando il modo in cui l'estensione individua le directory del codice sorgente Java di Gradle; il lavoro è completato quando le dichiarazioni dei package e i riferimenti vengono risolti senza errori, mentre il progetto continua a compilarsi e a essere eseguito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100