rope_py3k / ropetest / refactor / renametest.py

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
import unittest

import rope.base.codeanalyze
import rope.base.project
import rope.refactor.occurrences
import ropetest
from rope.refactor import rename
from rope.refactor.rename import Rename


class RenameRefactoringTest(unittest.TestCase):

    def setUp(self):
        super(RenameRefactoringTest, self).setUp()
        self.project_root = 'sample_project'
        ropetest.testutils.remove_recursively(self.project_root)
        self.project = rope.base.project.Project(self.project_root)
        self.pycore = self.project.get_pycore()

    def tearDown(self):
        ropetest.testutils.remove_recursively(self.project_root)
        super(RenameRefactoringTest, self).tearDown()

    def _local_rename(self, source_code, offset, new_name):
        testmod = self.pycore.create_module(self.project.root, 'testmod')
        testmod.write(source_code)
        changes = Rename(self.project, testmod, offset).\
                  get_changes(new_name, in_file=True)
        self.project.do(changes)
        return testmod.read()

    def _rename(self, resource, offset, new_name, in_hierarchy=False):
        changes = Rename(self.project, resource, offset).\
                  get_changes(new_name, in_hierarchy=in_hierarchy)
        self.project.do(changes)

    def test_simple_global_variable_renaming(self):
        refactored = self._local_rename('a_var = 20\n', 2, 'new_var')
        self.assertEquals('new_var = 20\n', refactored)

    def test_variable_renaming_only_in_its_scope(self):
        refactored = self._local_rename(
            'a_var = 20\ndef a_func():\n    a_var = 10\n', 32, 'new_var')
        self.assertEquals('a_var = 20\ndef a_func():\n    new_var = 10\n',
                          refactored)

    def test_not_renaming_dot_name(self):
        refactored = self._local_rename(
            "replace = True\n'aaa'.replace('a', 'b')\n", 1, 'new_var')
        self.assertEquals("new_var = True\n'aaa'.replace('a', 'b')\n", refactored)

    def test_renaming_multiple_names_in_the_same_line(self):
        refactored = self._local_rename(
            'a_var = 10\na_var = 10 + a_var / 2\n', 2, 'new_var')
        self.assertEquals('new_var = 10\nnew_var = 10 + new_var / 2\n', refactored)

    def test_renaming_names_when_getting_some_attribute(self):
        refactored = self._local_rename(
            "a_var = 'a b c'\na_var.split('\\n')\n", 2, 'new_var')
        self.assertEquals("new_var = 'a b c'\nnew_var.split('\\n')\n", refactored)

    def test_renaming_names_when_getting_some_attribute2(self):
        refactored = self._local_rename(
            "a_var = 'a b c'\na_var.split('\\n')\n", 20, 'new_var')
        self.assertEquals("new_var = 'a b c'\nnew_var.split('\\n')\n", refactored)

    def test_renaming_function_parameters1(self):
        refactored = self._local_rename(
            "def f(a_param):\n    print a_param\n", 8, 'new_param')
        self.assertEquals("def f(new_param):\n    print new_param\n", refactored)

    def test_renaming_function_parameters2(self):
        refactored = self._local_rename("def f(a_param):\n    print a_param\n", 30, 'new_param')
        self.assertEquals("def f(new_param):\n    print new_param\n", refactored)

    def test_renaming_occurrences_inside_functions(self):
        code = 'def a_func(p1):\n    a = p1\na_func(1)\n'
        refactored = self._local_rename(code, code.index('p1') + 1, 'new_param')
        self.assertEquals('def a_func(new_param):\n    a = new_param\na_func(1)\n',
                          refactored)

    def test_renaming_arguments_for_normal_args_changing_calls(self):
        code = 'def a_func(p1=None, p2=None):\n    pass\na_func(p2=1)\n'
        refactored = self._local_rename(code, code.index('p2') + 1, 'p3')
        self.assertEquals('def a_func(p1=None, p3=None):\n    pass\na_func(p3=1)\n',
                          refactored)

    def test_renaming_function_parameters_of_class_init(self):
        code = 'class A(object):\n    def __init__(self, a_param):\n        pass\n' \
               'a_var = A(a_param=1)\n'
        refactored = self._local_rename(code, code.index('a_param') + 1, 'new_param')
        expected = 'class A(object):\n    def __init__(self, new_param):\n        pass\n' \
                   'a_var = A(new_param=1)\n'
        self.assertEquals(expected, refactored)

    def test_renaming_functions_parameters_and_occurances_in_other_modules(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        mod2 = self.pycore.create_module(self.project.root, 'mod2')
        mod1.write('def a_func(a_param):\n    print a_param\n')
        mod2.write('from mod1 import a_func\na_func(a_param=10)\n')
        self._rename(mod1, mod1.read().index('a_param') + 1, 'new_param')
        self.assertEquals('def a_func(new_param):\n    print new_param\n', mod1.read())
        self.assertEquals('from mod1 import a_func\na_func(new_param=10)\n', mod2.read())

    def test_renaming_with_backslash_continued_names(self):
        refactored = self._local_rename("replace = True\n'ali'.\\\nreplace\n", 2, 'is_replace')
        self.assertEquals("is_replace = True\n'ali'.\\\nreplace\n", refactored)

    def test_not_renaming_string_contents(self):
        refactored = self._local_rename("a_var = 20\na_string='a_var'\n", 2, 'new_var')
        self.assertEquals("new_var = 20\na_string='a_var'\n", refactored)

    def test_not_renaming_comment_contents(self):
        refactored = self._local_rename("a_var = 20\n# a_var\n", 2, 'new_var')
        self.assertEquals("new_var = 20\n# a_var\n", refactored)

    def test_renaming_all_occurances_in_containing_scope(self):
        code = 'if True:\n    a_var = 1\nelse:\n    a_var = 20\n'
        refactored = self._local_rename(code, 16, 'new_var')
        self.assertEquals('if True:\n    new_var = 1\nelse:\n    new_var = 20\n',
                          refactored)

    def test_renaming_a_variable_with_arguement_name(self):
        code = 'a_var = 10\ndef a_func(a_var):\n    print a_var\n'
        refactored = self._local_rename(code, 1, 'new_var')
        self.assertEquals('new_var = 10\ndef a_func(a_var):\n    print a_var\n',
                          refactored)

    def test_renaming_an_arguement_with_variable_name(self):
        code = 'a_var = 10\ndef a_func(a_var):\n    print a_var\n'
        refactored = self._local_rename(code, len(code) - 3, 'new_var')
        self.assertEquals('a_var = 10\ndef a_func(new_var):\n    print new_var\n',
                          refactored)

    def test_renaming_function_with_local_variable_name(self):
        code = 'def a_func():\n    a_func=20\na_func()'
        refactored = self._local_rename(code, len(code) - 3, 'new_func')
        self.assertEquals('def new_func():\n    a_func=20\nnew_func()',
                          refactored)

    def test_renaming_functions(self):
        code = 'def a_func():\n    pass\na_func()\n'
        refactored = self._local_rename(code, len(code) - 5, 'new_func')
        self.assertEquals('def new_func():\n    pass\nnew_func()\n',
                          refactored)

    def test_renaming_functions_across_modules(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        mod1.write('def a_func():\n    pass\na_func()\n')
        mod2 = self.pycore.create_module(self.project.root, 'mod2')
        mod2.write('import mod1\nmod1.a_func()\n')
        self._rename(mod1, len(mod1.read()) - 5, 'new_func')
        self.assertEquals('def new_func():\n    pass\nnew_func()\n', mod1.read())
        self.assertEquals('import mod1\nmod1.new_func()\n', mod2.read())

    def test_renaming_functions_across_modules_from_import(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        mod1.write('def a_func():\n    pass\na_func()\n')
        mod2 = self.pycore.create_module(self.project.root, 'mod2')
        mod2.write('from mod1 import a_func\na_func()\n')
        self._rename(mod1, len(mod1.read()) - 5, 'new_func')
        self.assertEquals('def new_func():\n    pass\nnew_func()\n', mod1.read())
        self.assertEquals('from mod1 import new_func\nnew_func()\n', mod2.read())

    def test_renaming_functions_from_another_module(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        mod1.write('def a_func():\n    pass\na_func()\n')
        mod2 = self.pycore.create_module(self.project.root, 'mod2')
        mod2.write('import mod1\nmod1.a_func()\n')
        self._rename(mod2, len(mod2.read()) - 5, 'new_func')
        self.assertEquals('def new_func():\n    pass\nnew_func()\n', mod1.read())
        self.assertEquals('import mod1\nmod1.new_func()\n', mod2.read())

    def test_applying_all_changes_together(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        mod1.write('import mod2\nmod2.a_func()\n')
        mod2 = self.pycore.create_module(self.project.root, 'mod2')
        mod2.write('def a_func():\n    pass\na_func()\n')
        self._rename(mod2, len(mod2.read()) - 5, 'new_func')
        self.assertEquals('import mod2\nmod2.new_func()\n', mod1.read())
        self.assertEquals('def new_func():\n    pass\nnew_func()\n', mod2.read())

    def test_renaming_modules(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        mod1.write('def a_func():\n    pass\n')
        mod2 = self.pycore.create_module(self.project.root, 'mod2')
        mod2.write('from mod1 import a_func\n')
        self._rename(mod2, mod2.read().index('mod1') + 1, 'newmod')
        self.assertTrue(not mod1.exists() and
                        self.pycore.find_module('newmod') is not None)
        self.assertEquals('from newmod import a_func\n', mod2.read())

    def test_renaming_packages(self):
        pkg = self.pycore.create_package(self.project.root, 'pkg')
        mod1 = self.pycore.create_module(pkg, 'mod1')
        mod1.write('def a_func():\n    pass\n')
        mod2 = self.pycore.create_module(pkg, 'mod2')
        mod2.write('from pkg.mod1 import a_func\n')
        self._rename(mod2, 6, 'newpkg')
        self.assertTrue(self.pycore.find_module('newpkg.mod1') is not None)
        new_mod2 = self.pycore.find_module('newpkg.mod2')
        self.assertEquals('from newpkg.mod1 import a_func\n', new_mod2.read())

    def test_module_dependencies(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        mod1.write('class AClass(object):\n    pass\n')
        mod2 = self.pycore.create_module(self.project.root, 'mod2')
        mod2.write('import mod1\na_var = mod1.AClass()\n')
        self.pycore.resource_to_pyobject(mod2).get_attributes()['mod1']
        mod1.write('def AClass():\n    return 0\n')

        self._rename(mod2, len(mod2.read()) - 3, 'a_func')
        self.assertEquals('def a_func():\n    return 0\n', mod1.read())
        self.assertEquals('import mod1\na_var = mod1.a_func()\n', mod2.read())

    def test_renaming_class_attributes(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        mod1.write('class AClass(object):\n    def __init__(self):\n'
                   '        self.an_attr = 10\n')
        mod2 = self.pycore.create_module(self.project.root, 'mod2')
        mod2.write('import mod1\na_var = mod1.AClass()\nanother_var = a_var.an_attr')

        self._rename(mod1, mod1.read().index('an_attr'), 'attr')
        self.assertEquals('class AClass(object):\n    def __init__(self):\n'
                          '        self.attr = 10\n', mod1.read())
        self.assertEquals('import mod1\na_var = mod1.AClass()\nanother_var = a_var.attr',
                          mod2.read())

    def test_renaming_class_attributes2(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        mod1.write('class AClass(object):\n    def __init__(self):\n'
                   '        an_attr = 10\n        self.an_attr = 10\n')
        mod2 = self.pycore.create_module(self.project.root, 'mod2')
        mod2.write('import mod1\na_var = mod1.AClass()\nanother_var = a_var.an_attr')

        self._rename(mod1, mod1.read().rindex('an_attr'), 'attr')
        self.assertEquals('class AClass(object):\n    def __init__(self):\n'
                          '        an_attr = 10\n        self.attr = 10\n', mod1.read())
        self.assertEquals('import mod1\na_var = mod1.AClass()\nanother_var = a_var.attr',
                          mod2.read())

    def test_renaming_methods_in_subclasses(self):
        mod = self.pycore.create_module(self.project.root, 'mod1')
        mod.write('class A(object):\n    def a_method(self):\n        pass\n'
                  'class B(A):\n    def a_method(self):\n        pass\n')

        self._rename(mod, mod.read().rindex('a_method') + 1, 'new_method',
                     in_hierarchy=True)
        self.assertEquals('class A(object):\n    def new_method(self):\n        pass\n'
                          'class B(A):\n    def new_method(self):\n        pass\n', mod.read())

    def test_renaming_methods_in_sibling_classes(self):
        mod = self.pycore.create_module(self.project.root, 'mod1')
        mod.write('class A(object):\n    def a_method(self):\n        pass\n'
                  'class B(A):\n    def a_method(self):\n        pass\n'
                  'class C(A):\n    def a_method(self):\n        pass\n')

        self._rename(mod, mod.read().rindex('a_method') + 1, 'new_method',
                     in_hierarchy=True)
        self.assertEquals('class A(object):\n    def new_method(self):\n        pass\n'
                  'class B(A):\n    def new_method(self):\n        pass\n'
                  'class C(A):\n    def new_method(self):\n        pass\n', mod.read())

    def test_not_renaming_methods_in_hierarchies(self):
        mod = self.pycore.create_module(self.project.root, 'mod1')
        mod.write('class A(object):\n    def a_method(self):\n        pass\n'
                  'class B(A):\n    def a_method(self):\n        pass\n')

        self._rename(mod, mod.read().rindex('a_method') + 1, 'new_method',
                     in_hierarchy=False)
        self.assertEquals('class A(object):\n    def a_method(self):\n        pass\n'
                          'class B(A):\n    def new_method(self):\n        pass\n', mod.read())

    def test_undoing_refactorings(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        mod1.write('def a_func():\n    pass\na_func()\n')
        self._rename(mod1, len(mod1.read()) - 5, 'new_func')
        self.project.history.undo()
        self.assertEquals('def a_func():\n    pass\na_func()\n', mod1.read())

    def test_undoing_renaming_modules(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        mod1.write('def a_func():\n    pass\n')
        mod2 = self.pycore.create_module(self.project.root, 'mod2')
        mod2.write('from mod1 import a_func\n')
        self._rename(mod2, 6, 'newmod')
        self.project.history.undo()
        self.assertEquals('mod1.py', mod1.path)
        self.assertEquals('from mod1 import a_func\n', mod2.read())

    def test_rename_in_module_renaming_one_letter_names_for_expressions(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        mod1.write('a = 10\nprint (1+a)\n')
        pymod = self.pycore.get_module('mod1')
        old_pyname = pymod.get_attribute('a')
        finder = rope.refactor.occurrences.FilteredOccurrenceFinder(
            self.pycore, 'a', [old_pyname])
        refactored = rename.rename_in_module(
            finder, 'new_var', pymodule=pymod, replace_primary=True)
        self.assertEquals('new_var = 10\nprint (1+new_var)\n', refactored)

    def test_renaming_for_loop_variable(self):
        code = 'for var in range(10):\n    print var\n'
        refactored = self._local_rename(code, code.find('var') + 1, 'new_var')
        self.assertEquals('for new_var in range(10):\n    print new_var\n',
                          refactored)

    def test_renaming_parameters(self):
        code = 'def a_func(param):\n    print param\na_func(param=hey)\n'
        refactored = self._local_rename(code, code.find('param') + 1, 'new_param')
        self.assertEquals('def a_func(new_param):\n    print new_param\n'
                          'a_func(new_param=hey)\n', refactored)

    def test_renaming_parameters_not_renaming_others(self):
        code = 'def a_func(param):\n    print param\nparam=10\na_func(param)\n'
        refactored = self._local_rename(code, code.find('param') + 1, 'new_param')
        self.assertEquals('def a_func(new_param):\n    print new_param\n'
                          'param=10\na_func(param)\n', refactored)

    def test_renaming_parameters_not_renaming_others2(self):
        code = 'def a_func(param):\n    print param\nparam=10\na_func(param=param)'
        refactored = self._local_rename(code, code.find('param') + 1, 'new_param')
        self.assertEquals('def a_func(new_param):\n    print new_param\n'
                          'param=10\na_func(new_param=param)', refactored)

    def test_renaming_parameters_with_multiple_params(self):
        code = 'def a_func(param1, param2):\n    print param1\na_func(param1=1, param2=2)\n'
        refactored = self._local_rename(code, code.find('param1') + 1, 'new_param')
        self.assertEquals('def a_func(new_param, param2):\n    print new_param\n'
                          'a_func(new_param=1, param2=2)\n', refactored)

    def test_renaming_parameters_with_multiple_params2(self):
        code = 'def a_func(param1, param2):\n    print param1\na_func(param1=1, param2=2)\n'
        refactored = self._local_rename(code, code.rfind('param2') + 1, 'new_param')
        self.assertEquals('def a_func(param1, new_param):\n    print param1\n'
                          'a_func(param1=1, new_param=2)\n', refactored)

    def test_renaming_parameters_on_calls(self):
        code = 'def a_func(param):\n    print param\na_func(param = hey)\n'
        refactored = self._local_rename(code, code.rfind('param') + 1, 'new_param')
        self.assertEquals('def a_func(new_param):\n    print new_param\n'
                          'a_func(new_param = hey)\n', refactored)

    def test_renaming_parameters_spaces_before_call(self):
        code = 'def a_func(param):\n    print param\na_func  (param=hey)\n'
        refactored = self._local_rename(code, code.rfind('param') + 1, 'new_param')
        self.assertEquals('def a_func(new_param):\n    print new_param\n'
                          'a_func  (new_param=hey)\n', refactored)

    def test_renaming_variables_in_init_dot_pys(self):
        pkg = self.pycore.create_package(self.project.root, 'pkg')
        init_dot_py = pkg.get_child('__init__.py')
        init_dot_py.write('a_var = 10\n')
        mod = self.pycore.create_module(self.project.root, 'mod')
        mod.write('import pkg\nprint pkg.a_var\n')
        self._rename(mod, mod.read().index('a_var') + 1, 'new_var')
        self.assertEquals('new_var = 10\n', init_dot_py.read())
        self.assertEquals('import pkg\nprint pkg.new_var\n', mod.read())

    def test_renaming_variables_in_init_dot_pys2(self):
        pkg = self.pycore.create_package(self.project.root, 'pkg')
        init_dot_py = pkg.get_child('__init__.py')
        init_dot_py.write('a_var = 10\n')
        mod = self.pycore.create_module(self.project.root, 'mod')
        mod.write('import pkg\nprint pkg.a_var\n')
        self._rename(init_dot_py,
                     init_dot_py.read().index('a_var') + 1, 'new_var')
        self.assertEquals('new_var = 10\n', init_dot_py.read())
        self.assertEquals('import pkg\nprint pkg.new_var\n', mod.read())

    def test_renaming_variables_in_init_dot_pys3(self):
        pkg = self.pycore.create_package(self.project.root, 'pkg')
        init_dot_py = pkg.get_child('__init__.py')
        init_dot_py.write('a_var = 10\n')
        mod = self.pycore.create_module(self.project.root, 'mod')
        mod.write('import pkg\nprint pkg.a_var\n')
        self._rename(mod, mod.read().index('a_var') + 1, 'new_var')
        self.assertEquals('new_var = 10\n', init_dot_py.read())
        self.assertEquals('import pkg\nprint pkg.new_var\n', mod.read())

    def test_renaming_resources_using_rename_module_refactoring(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        mod2 = self.pycore.create_module(self.project.root, 'mod2')
        mod1.write('a_var = 1')
        mod2.write('import mod1\nmy_var = mod1.a_var\n')
        renamer = rename.Rename(self.project, mod1)
        renamer.get_changes('newmod').do()
        self.assertEquals('import newmod\nmy_var = newmod.a_var\n', mod2.read())

    def test_renaming_resources_using_rename_module_refactoring_for_packages(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        pkg = self.pycore.create_package(self.project.root, 'pkg')
        mod1.write('import pkg\nmy_pkg = pkg')
        renamer = rename.Rename(self.project, pkg)
        renamer.get_changes('newpkg').do()
        self.assertEquals('import newpkg\nmy_pkg = newpkg', mod1.read())

    def test_renaming_resources_using_rename_module_refactoring_for_init_dot_py(self):
        mod1 = self.pycore.create_module(self.project.root, 'mod1')
        pkg = self.pycore.create_package(self.project.root, 'pkg')
        mod1.write('import pkg\nmy_pkg = pkg')
        renamer = rename.Rename(self.project, pkg.get_child('__init__.py'))
        renamer.get_changes('newpkg').do()
        self.assertEquals('import newpkg\nmy_pkg = newpkg', mod1.read())

    def test_renaming_global_variables(self):
        code = 'a_var = 1\ndef a_func():\n    global a_var\n    var = a_var\n'
        refactored = self._local_rename(code, code.index('a_var'), 'new_var')
        self.assertEquals(
            'new_var = 1\ndef a_func():\n    global new_var\n    var = new_var\n',
            refactored)

    def test_renaming_global_variables2(self):
        code = 'a_var = 1\ndef a_func():\n    global a_var\n    var = a_var\n'
        refactored = self._local_rename(code, code.rindex('a_var'), 'new_var')
        self.assertEquals(
            'new_var = 1\ndef a_func():\n    global new_var\n    var = new_var\n',
            refactored)


if __name__ == '__main__':
    unittest.main()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.