redhat-developer / redhat-developer/vscode-java

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

Ouverte
#1,155 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Gradle question
Langage dominant
TypeScript
Étoiles
2.3k
Forks
546
Merge moyen
20 h 1 min
PR mergées (30 j)
11

Description

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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

L’issue ne nomme aucun fichier du dépôt, test ou point d’entrée de l’implémentation ; elle demande si du code Java peut détecter qu’un projet est ouvert dans VS Code. Commencez par examiner le contexte de l’issue et l’intégration de l’extension VS Code du dépôt, puis déterminez si une modification limitée et testable est définie. Done n’est pas spécifié, car le fil ne contient qu’une question.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java, vscode
Domaine
developer-experience, tooling
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
15/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.