44 *--------------------------------------------------------------------------------------------*/
55
66import { join } from 'path' ;
7- import { Outline } from '../../pages/outline.js' ;
87import { test , tags } from '../_test.setup.js' ;
98
10- const R_FILE = 'basic-outline-with-vars.r' ;
11- const PY_FILE = 'basic-outline-with-vars.py' ;
129
1310test . use ( {
1411 suiteId : __filename
@@ -20,138 +17,8 @@ test.describe('Outline', { tag: [tags.WEB, tags.WIN, tags.OUTLINE] }, () => {
2017 await hotKeys . closeAllEditors ( ) ;
2118 } ) ;
2219
23- test . describe ( 'Outline: Sessions' , { tag : [ tags . SESSIONS , tags . ARK ] } , ( ) => {
24-
25- test . beforeAll ( async function ( { app, openFile, hotKeys } ) {
26- const { outline } = app . workbench ;
27-
28- await openFile ( `workspaces/outline/${ PY_FILE } ` ) ;
29- await openFile ( `workspaces/outline/${ R_FILE } ` ) ;
30-
31- await hotKeys . closeSecondarySidebar ( ) ;
32- await outline . focus ( ) ;
33- } ) ;
34-
35- test . skip ( 'Verify outline is based on editor and per session' , async function ( { app, sessions } ) {
36- const { outline, console, editor } = app . workbench ;
37-
38- // No active session - verify no outlines
39- await editor . selectTab ( PY_FILE ) ;
40- await outline . expectOutlineToBeEmpty ( ) ;
41- await editor . selectTab ( R_FILE ) ;
42- await outline . expectOutlineToBeEmpty ( ) ;
43-
44- // Start sessions
45- const [ pySession1 , pySession2 , rSession1 , rSession2 ] = await sessions . start ( [ 'python' , 'pythonAlt' , 'r' , 'rAlt' ] ) ;
46-
47- // Select Python file
48- await editor . selectTab ( PY_FILE ) ;
49- await verifyPythonOutline ( outline ) ;
50-
51- // Select R Session 1 - verify Python outline
52- // Use last-active Python session's LSP for Python files, even if foreground session is R.
53- await sessions . select ( rSession1 . id ) ;
54- await verifyPythonOutline ( outline ) ;
55-
56- // Select Python Session 1 - verify Python outline
57- await sessions . select ( pySession1 . id ) ;
58- await console . typeToConsole ( 'global_variable="goodbye"' , true ) ;
59- await verifyPythonOutline ( outline ) ;
60-
61- // Select R file
62- await editor . selectTab ( R_FILE ) ;
63- await verifyROutline ( outline ) ;
64-
65- // Select R Session 1 - verify R outline
66- await sessions . select ( rSession1 . id ) ;
67- await verifyROutline ( outline ) ;
68-
69- // Select R Session 2 - verify R outline
70- await sessions . select ( rSession2 . id ) ;
71- await verifyROutline ( outline ) ;
72-
73- // Select Python file - verify Python outline
74- await editor . selectTab ( PY_FILE ) ;
75- await verifyPythonOutline ( outline ) ;
76-
77- // Python Session 2 - verify Python outline
78- await sessions . select ( pySession2 . id ) ;
79- await console . typeToConsole ( 'global_variable="goodbye2"' , true ) ;
80- await verifyPythonOutline ( outline ) ;
81- } ) ;
82-
83- test . skip ( 'Verify outline after reload with Python in foreground and R in background' , {
84- annotation : [ { type : 'issue' , description : 'https://github.com/posit-dev/positron/issues/7052' } ] ,
85- } , async function ( { app, runCommand, sessions } ) {
86- const { outline, editor } = app . workbench ;
87-
88- // Start sessions
89- await sessions . deleteAll ( ) ;
90- const [ , rSession ] = await sessions . start ( [ 'python' , 'r' ] ) ;
91-
92- // Verify outlines for both file types
93- await editor . selectTab ( PY_FILE ) ;
94- await verifyPythonOutline ( outline ) ;
95-
96- await editor . selectTab ( R_FILE ) ;
97- await verifyROutline ( outline ) ;
98-
99- // Reload window
100- await sessions . expectSessionCountToBe ( 2 ) ;
101- await runCommand ( 'workbench.action.reloadWindow' ) ;
102- await sessions . expectSessionCountToBe ( 2 ) ;
103-
104- // Verify outlines for both file types
105- await editor . selectTab ( PY_FILE ) ;
106- await verifyPythonOutline ( outline ) ;
107-
108- await editor . selectTab ( R_FILE ) ;
109- await sessions . select ( rSession . id ) ; // Issue 7052 - we shouldn't have to click the tab
110- await verifyROutline ( outline ) ;
111- } ) ;
112-
113- test . skip ( 'Verify outline after reload with R in foreground and Python in background' , {
114- annotation : [ { type : 'issue' , description : 'https://github.com/posit-dev/positron/issues/7052' } ] ,
115- } ,
116- async function ( { app, runCommand, sessions } ) {
117- const { outline, editor } = app . workbench ;
118-
119- // Start sessions
120- await sessions . deleteAll ( ) ;
121- await sessions . start ( [ 'r' , 'python' ] ) ;
122-
123- // Verify outlines for both file types
124- await editor . selectTab ( R_FILE ) ;
125- await verifyROutline ( outline ) ;
126-
127- await editor . selectTab ( PY_FILE ) ;
128- await verifyPythonOutline ( outline ) ;
129-
130- // Reload window
131- await runCommand ( 'workbench.action.reloadWindow' ) ;
132-
133- // Verify outlines for both file types
134- await editor . selectTab ( R_FILE ) ;
135- await verifyROutline ( outline ) ;
136-
137- await editor . selectTab ( PY_FILE ) ;
138- await verifyPythonOutline ( outline ) ;
139- } ) ;
140- } ) ;
141-
14220 test . describe ( 'Outline: Basic' , ( ) => {
14321
144- test . skip ( 'Python - Verify Outline Contents' , async function ( { app, python, openFile } ) {
145- await openFile ( join ( 'workspaces' , 'chinook-db-py' , 'chinook-sqlite.py' ) ) ;
146- await app . workbench . outline . expectOutlineToContain ( [
147- 'data_file_path' ,
148- 'conn' ,
149- 'cur' ,
150- 'rows' ,
151- 'df'
152- ] ) ;
153- } ) ;
154-
15522 test ( 'R - Verify Outline Contents' , {
15623 tag : [ tags . ARK ]
15724 } , async function ( { app, r, openFile } ) {
@@ -166,14 +33,3 @@ test.describe('Outline', { tag: [tags.WEB, tags.WIN, tags.OUTLINE] }, () => {
16633
16734} ) ;
16835
169- async function verifyPythonOutline ( outline : Outline ) {
170- await outline . expectOutlineElementCountToBe ( 2 ) ; // ensure no dupes from multisessions
171- await outline . expectOutlineElementToBeVisible ( 'global_variable = "hello"' ) ;
172- await outline . expectOutlineElementToBeVisible ( 'def demonstrate_scope' ) ;
173- }
174-
175- async function verifyROutline ( outline : Outline ) {
176- await outline . expectOutlineElementCountToBe ( 2 ) ; // ensure no dupes from multisessions
177- await outline . expectOutlineElementToBeVisible ( 'demonstrate_scope' ) ;
178- await outline . expectOutlineElementToBeVisible ( 'global_variable' ) ;
179- }
0 commit comments