redhat-developer / redhat-developer/vscode-java

Q: Is there a way from my project to programmatically detect that it is in vscode

Offen
#1,155 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Gradle question
Vorherrschende Sprache
TypeScript
Sterne
2.3k
Forks
546
Ø Merge
20 Std. 1 Min.
Gemergte PRs (30 T.)
11

Beschreibung

I have a situation where a Gradle plugin I'm developing needs to take conditional actions depending on whether or not the project in which my Gradle plugin is applied, is currently being edited inside vscode.

I'm wondering if there might be someway for any random Java code that is part of a project, to programmatically detect that the project is currently opened in vscode.

Maybe something like querying the hierarchy of class loaders to see if some class that is only ever loaded by vscode-java is present? Or maybe there is something like a .lock file somewhere that would only exist if vscode-java is editing a specific project? Anything like that?

I realize I could have the code look in the root folder to see if a .vscode folder is there — or something along those lines. But I very often open projects in all of the different Java IDEs at different times. So although the project might be open in IntelliJ at any given time, it would be a false positive in the IntelliJ scenario when the detection code finds a .vscode folder from the previous times I might have edited the project in vscode.

Environment
  • Operating System: Windows/Linux/Mac OS
  • JDK version: Java 1.5 to Java 13+
  • Visual Studio Code version: 1.40.1 (system setup)
  • Java extension version: 0.53.1
  • Gradle 3.x - 6.x
Steps To Reproduce

Not Applicable

Current Result

Not Applicable

Expected Result

Not Applicable

Additional Informations

Not Applicable

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Der Issue nennt keine Repository-Dateien, Tests oder Einstiegspunkte für die Implementierung; er fragt, ob Java-Code erkennen kann, dass ein Projekt in VS Code geöffnet ist. Beginne mit der Prüfung des Issue-Kontexts und der VS Code-Erweiterungsintegration des Repositorys und ermittle dann, ob eine abgegrenzte, testbare Änderung definiert ist. Done ist nicht spezifiziert, da der Thread nur eine Frage enthält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, vscode
Bereich
developer-experience, tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
15/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.