Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Activate extension when a R script file is opened outside of a workspace

Chiusa
#1,624 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
r, typescript, vscode

Direzione di ricerca

Apri package.json e ispeziona l'array activationEvents, iniziando dalle voci esistenti workspaceContains, command e webview. Aggiungi l'attivazione per il linguaggio R in modo che uno script R autonomo avvii l'estensione, quindi verifica che l'apertura di un file R al di fuori di un workspace abiliti le funzionalità dell'estensione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature-request

Is your feature request related to a problem? Please describe.

I often use the vscode-R extension without opening a workspace. Currently, the vscode-R extension is activated when a workspace containing R scripts is opened. The extension does not activate when opening a single R script file outside of a workspace. This means that I have to force the extension to activate so that I can have the autocomplete and popup help features working. I force the extension to activate by opening the R Help feature which I think works due to the onWebviewPanel:rhelp activation event.

Describe the solution you'd like

The following patch to the package.json file activates the extension when an R script file is opened outside of a workspace folder. Having the onLanguage:r line is consistent with other extensions, namely the Python and C/C++ extensions from Microsoft.

--- package.json.orig	2025-07-04 08:48:57.676941500 -0500
+++ package.json	2025-07-04 08:51:26.174039600 -0500
@@ -31,7 +31,8 @@
 	"activationEvents": [
 		"workspaceContains:**/*.{rproj,Rproj,r,R,rd,Rd,rmd,Rmd}",
 		"onCommand:r.runSelectionInActiveTerm",
-		"onWebviewPanel:rhelp"
+		"onWebviewPanel:rhelp",
+		"onLanguage:r"
 	],
 	"main": "./dist/extension",
 	"contributes": {

Describe alternatives you've considered

Force the vscode-R extension to activate by opening the R Help feature in the extension. Not ideal as it involves an extra step. The above patch makes the extension available seamlessly when working outside of vscode workspaces.

Additional context

Lingua principale
TypeScript
Stelle
1.2k
Fork
139
Merge medio
22h
PR unite (30g)
23

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di REditorSupport/vscode-R

Tutte le issue di REditorSupport/vscode-R

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.