1
0
forked from VimPlug/jedi
Commit Graph

40 Commits

Author SHA1 Message Date
Marcio Mazza
fa0c064841 Fix skipped collection of pytest integration test files
On integration tests file collection,
the value of `environment.executable` can also be a symlink
(e.g. in a virtualenv) with a different name than,
but pointing to the same as `sys.executable`
(e.g. .../bin/python3.10 and .../bin/python, respectively).

That causes skipping the collection of `completion/pytest.py`
and `completion/conftest.py` a lot of times, depending on the environment.
(e.g. "60 skipped" before x "23 skipped" after, in a local virtualenv)
2022-09-02 14:23:38 -03:00
Mikhail Rudenko
cfb7e300af Improve .gitignore handling
At present, .gitignore patterns not starting with '/' are classified
as "ignored names" (opposing to "ignored paths") and not used for
filtering directories. But, according to the spec [1], the situation
is a bit different: all patterns apply to directories (and those
ending with '/' apply to directories only). Besides that, there two
kinds of patterns: those that match only w.r.t the directory where
defining .gitignore is located (they must contain a '/' in the
beginning or in the middle), which we call "absolute", and those that
also match in all subdirectories under the directory where defining
.gitignore is located (they must not contain '/' or contain only
trailing '/'), which we call "relative".

This commit implements handling of both "absolute" and "relative"
.gitignore patterns according to the spec. "Absolute" patterns are
handled mostly like `ignored_paths` were handled in the previous
implementation. "Relative" patterns are collected into a distinct set
containing `(defining_gitignore_dir, pattern)` tuples. For each
traversed `root_folder_io`, all applicable "relative" patterns are
expanded into a set of plain paths, which are then used for filtering
`folder_io`s.

While at it, also fix some minor issues. Explicitly ignore negative
and wildcard patterns, since we don't handle them correctly
anyway. Also, use '/' as a path separator instead of `os.path.sep`
when dealing with .gitignore, since the spec explicitly says that '/'
must be used on all platforms.

[1] https://git-scm.com/docs/gitignore
2022-08-21 21:50:29 +03:00
Dave Halter
6279791b24 Fix an issue with complete_search 2021-01-10 16:08:17 +01:00
Dave Halter
55c7e4eb49 Stdlib modules should not be included in the get_references search, fixes davidhalter/jedi-vim#792 2021-01-02 00:58:50 +01:00
Dave Halter
8740ff2691 Ignore the mypy cache for searching folders 2020-12-25 17:35:28 +01:00
Dave Halter
76c0c373da Merge pull request #1642 from PeterJCLaw/mypy
Add an initial mypy config
2020-08-05 01:09:49 +02:00
Dave Halter
f12ed2088a Use pathlib for file ios, because the new parso is out 2020-08-05 00:52:50 +02:00
Peter Law
35c2d660cb Fix most import related mypy errors 2020-07-24 16:10:34 +01:00
Dave Halter
9957565b37 Try to use yield from instead of yield, if possible 2020-07-19 13:34:58 +02:00
Dave Halter
7f67324210 Remove a lot more Python 2 mentions and todos 2020-07-02 10:30:58 +02:00
Dave Halter
f9a35ae42a Remove FileNotFoundError compatibility 2020-07-02 01:05:13 +02:00
Dave Halter
21a380f7cb Merge pull request #1590 from muffinmad/references-scope
Get references in the current module only
2020-06-05 19:21:34 +02:00
muffinmad
782dedd439 Get references in the current module only 2020-06-03 16:35:28 +03:00
muffinmad
1c342d36e5 Don't goto while building found_names for the current file
But goto for all non_matching_reference_maps items later
2020-05-24 22:58:04 +03:00
muffinmad
741097827d Get references in the current module only 2020-05-21 19:51:13 +03:00
Christopher Cave-Ayland
860d5e8889 Import FileNotFoundError from jedi._compatibility 2020-05-21 11:45:52 +02:00
Dave Halter
70aa7fc917 Fix a namespace issue when getting references 2020-05-16 01:05:39 +02:00
Sam Roeca
812776b9ce Add .venv to _IGNORE_FOLDERS
".venv" is a popular virtual environment folder name; project.search
gets really mucked up when it isn't ignored.
2020-05-05 21:15:18 +02:00
Dave Halter
02c3d651bd Some more code quality fixes 2020-04-11 02:23:23 +02:00
Dave Halter
bdd4deedc1 Some code cleanups 2020-04-11 02:11:52 +02:00
Dave Halter
eecdf31601 Make it possible to search folders __init__ files 2020-03-07 13:57:14 +01:00
Dave Halter
e6bdaea73e Actually implement symbol search for projects 2020-03-06 11:15:34 +01:00
Dave Halter
ebb9df07f3 Progress for recursive symbol searches 2020-03-06 10:31:48 +01:00
Dave Halter
6cfcba0d97 Use is_compiled instead of isinstance checks 2020-01-24 13:12:48 +01:00
Dave Halter
9d7858eb3a Fix remaining tests 2020-01-22 00:36:30 +01:00
Dave Halter
6df755e8b6 Reduce limits of files to parse by quite a bit 2020-01-21 22:51:57 +01:00
Dave Halter
d9960081f5 Use different limits for references and dynamic calls 2020-01-21 09:22:16 +01:00
Dave Halter
c12cbf2106 Explain why the references limits were chosen 2020-01-20 17:24:21 +01:00
Dave Halter
6e10313cca Start limiting opened files and parsed files for references 2020-01-20 17:13:22 +01:00
Dave Halter
28027a3fee Remove a few imports 2020-01-20 16:59:22 +01:00
Dave Halter
a246624f70 Make sure to not scan the same directory multiple times 2020-01-20 10:33:37 +01:00
Dave Halter
621bd7d1db Don't search for usages when we are working with params 2020-01-20 02:14:46 +01:00
Dave Halter
445dc2411e Ignore .gitignore in get_references and therefore make get_references usable again 2020-01-20 02:03:58 +01:00
Dave Halter
ed36efabeb Revisit reference finding, scan a lot of folders 2020-01-20 01:43:51 +01:00
Dave Halter
26f0fa9eb0 Move get_module_contexts_containing_name to the references module 2020-01-17 22:51:09 +01:00
Dave Halter
df7080c1da Disable flow analysis for finding usages 2020-01-14 18:37:10 +01:00
Dave Halter
e1564da23d Make sure to find both stubs and non-stubs with usages 2020-01-13 20:45:53 +01:00
Dave Halter
1087b62e95 Refactor references: Matching more names that might be related
Fixes davidhalter/jedi-vim#900.
See also davidhalter/jedi-vim#552.
2019-12-23 00:41:22 +01:00
Dave Halter
694b05bb8c usage -> reference 2019-12-20 19:26:33 +01:00
Dave Halter
bd861e40a8 Rename references file 2019-12-20 19:25:46 +01:00