redhat-developer / redhat-developer/vscode-java
Preventing .classpath overwrite
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.3k
- Forks
- 546
- Ø Merge
- 20 Std. 1 Min.
- Gemergte PRs (30 T.)
- 11
Beschreibung
Hello,
While I'm fully aware that Android projects are unsupported, manually crafting .classpath files provide quite satisfying results - with the caveat that they don't support env vars, so you have to hardcode the path to your Android SDK.
For example, with a classpath that looks like:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="lib" path="/Users/arnaud/dev/android-sdk/platforms/android-26/android.jar" />
</classpath>
I'm able, after indexing, to get completion for my project's classes, but also Android's.
Libraries need a little more work, but I don't mind doing everything manually, as both the platform version and libraries don't change often.
The problem is that vscode-java notices that this is a gradle project, and will overwrite.
I have to rewrite the .classpath with my version every time I reopen vscode.
I'd like to have a setting to tell the plugin never to overwrite .classpath on its own.
Environment
- Operating System: macOS & Windows
- JDK version: 1.8
- Visual Studio Code version: 1.15.1
- Java extension version: Latest as of writing
Steps To Reproduce
- Open a
- Patch the .classpath yourself. Make sure you back it up somewhere else
- Restart vscode
Current Result
.classpath was overwritten with an empty one
Expected Result
.classpath should have not been overwritten
Additional Informations
I tried setting " "java.configuration.updateBuildConfiguration": "disabled" ", but that does not help
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den Neustart-Workflow mit einer manuell bearbeiteten .classpath und der Einstellung java.configuration.updateBuildConfiguration nachzustellen. Vergleiche die Datei vor und nach dem erneuten Öffnen von VS Code und verfolge anschließend die Gradle-Projektverarbeitung der Extension. Als erledigt gilt, wenn eine dokumentierte Einstellung automatische Überschreibungen von .classpath verhindert, während normale Projektaktualisierungen weiterhin verfügbar bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java, typescript
- Bereich
- build-system, devtools, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100