go/internal/imports
Robert Findley 3e0a5031e3 internal/lsp: use directoryFilters in import scanning
Based on dle8's CL 414454, wire in directoryFilters into the goimports
ModuleResolver scan. A few changes/fixes/additions from that CL:

- Fix a bug in filter validation that was causing -**/a not to validate.
- Fix a bug in regex building where -a was not treated as an excluded
  prefix (it was matching 'a' anywhere).
- Use absolute paths in the SkipPathInScan, so that we can evaluate
  directory filters relative to the workspace folder.
- Add several regression tests.
- Consolidate directoryFilters regression tests under a new
  directoryfilters_test.go file.
- Add several TODOs.

Fixes golang/go#46438

Change-Id: I55cd3d6410905216cc8cfbdf528f301d67c2bbac
Reviewed-on: https://go-review.googlesource.com/c/tools/+/420959
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dylan Le <dungtuanle@google.com>
2022-08-04 15:50:11 +00:00
..
testdata/mod imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
fix.go internal/lsp: use directoryFilters in import scanning 2022-08-04 15:50:11 +00:00
fix_test.go internal/imports: ignore some line directives 2022-04-06 14:24:15 +00:00
imports.go internal: remove unneeded FileSets 2022-06-06 20:47:10 +00:00
imports_test.go all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
mkindex.go all: go fmt ./... 2021-02-20 03:28:52 +00:00
mkstdlib.go internal/imports: update stdlib index for 1.18 2022-03-16 21:19:09 +00:00
mod.go internal/lsp: use directoryFilters in import scanning 2022-08-04 15:50:11 +00:00
mod_cache.go all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
mod_cache_test.go all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
mod_test.go internal/imports: use a module resolver if GOWORK is set 2022-06-24 21:03:09 +00:00
sortimports.go internal: remove unneeded FileSets 2022-06-06 20:47:10 +00:00
zstdlib.go internal/imports: update stdlib index for 1.18 2022-03-16 21:19:09 +00:00