-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: exclude modules by wildcard name #363
feat: exclude modules by wildcard name #363
Conversation
With this PR I'd like to introduce the possibility for modules to be excluded without knowing their full name. Example: ``` { "type": "mix_task", "name": "mix phx.server", "request": "launch", "task": "phx.server", "projectDir": "${workspaceRoot}", "excludeModules": [ ":phoenix", "Phoenix", "Phoenix.*" ] } ``` This helped me to use the debugging feature of the vscode-elixir-ls extension. Without this feature I was unable to collect all the modules names that need to be excluded.
regex_pattern = | ||
wildcard_pattern | ||
|> prefix_module_name() | ||
|> String.replace(".", ~s(\.)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use Regex.excape/1
:int.interpretable(module) == true and !:code.is_sticky(module) and module != __MODULE__ and | ||
module not in exclude_modules | ||
module_name not in exclude_module_names and | ||
not Enum.any?(exclude_module_names, &module_matches_wildcard(module_name, &1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compute wildcards patterns once before instead of once for every module
@lukaszsamson I've integrated your suggestions, maybe take another look if this is good to go? |
@lukaszsamson Hey, did you have the chance to take another look? |
Sorry, I missed the notification earlier. Looks good now, thanks |
With this PR I'd like to introduce the possibility for modules to be excluded without knowing their full name.
Example:
This helped me to use the debugging feature of the vscode-elixir-ls extension which kept failing for our team. Without this feature I was unable/unwilling to collect all the modules names that need to be excluded. The only approach, to gather the required module names, seemed to be trial and error based, which combined with the debuggers starting times felt disproportionate.